+2015-10-09 Richard Biener <rguenth@suse.de>
+
+ PR target/67366
+ * gimple-fold.c (optabs-query.h): Include
+ (gimple_fold_builtin_memory_op): Allow unaligned stores
+ when movmisalign_optabs are available.
+
2015-10-09 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
PR target/67366
#include "tree-eh.h"
#include "gimple-match.h"
#include "gomp-constants.h"
+#include "optabs-query.h"
+
/* Return true when DECL can be referenced from current unit.
FROM_DECL (if non-null) specify constructor of variable DECL was taken from.
/* If the destination pointer is not aligned we must be able
to emit an unaligned store. */
&& (dest_align >= GET_MODE_ALIGNMENT (TYPE_MODE (type))
- || !SLOW_UNALIGNED_ACCESS (TYPE_MODE (type), dest_align)))
+ || !SLOW_UNALIGNED_ACCESS (TYPE_MODE (type), dest_align)
+ || (optab_handler (movmisalign_optab, TYPE_MODE (type))
+ != CODE_FOR_nothing)))
{
tree srctype = type;
tree desttype = type;
srcmem = tem;
else if (src_align < GET_MODE_ALIGNMENT (TYPE_MODE (type))
&& SLOW_UNALIGNED_ACCESS (TYPE_MODE (type),
- src_align))
+ src_align)
+ && (optab_handler (movmisalign_optab,
+ TYPE_MODE (type))
+ == CODE_FOR_nothing))
srcmem = NULL_TREE;
if (srcmem)
{
+2015-10-09 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
+
+ PR target/67366
+ * lib/target-supports.exp (check_effective_target_non_strict_align):
+ Adjust for arm*-*-*.
+ * gcc.target/arm/pr67366.c: New test.
+
2015-10-09 Richard Biener <rguenther@suse.de>
PR tree-optimization/67891
--- /dev/null
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_unaligned } */
+/* { dg-options "-O2" } */
+
+typedef unsigned int u32;
+u32
+read32 (const void* ptr)
+{
+ u32 v;
+ __builtin_memcpy (&v, ptr, sizeof(v));
+ return v;
+}
+
+/* { dg-final { scan-assembler "@ unaligned" } } */
# Return 1 if the target does *not* require strict alignment.
proc check_effective_target_non_strict_align {} {
+
+ # On ARM, the default is to use STRICT_ALIGNMENT, but there
+ # are interfaces defined for misaligned access and thus
+ # depending on the architecture levels unaligned access is
+ # available.
+ if [istarget "arm*-*-*"] {
+ return [check_effective_target_arm_unaligned]
+ }
+
return [check_no_compiler_messages non_strict_align assembly {
char *y;
typedef char __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) c;