]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[ARC] Fix logic set UNALIGNED_ACCESS
authorClaudiu Zissulescu <claziss@synopsys.com>
Wed, 6 Mar 2019 10:45:51 +0000 (11:45 +0100)
committerClaudiu Zissulescu <claziss@gcc.gnu.org>
Wed, 6 Mar 2019 10:45:51 +0000 (11:45 +0100)
gcc/
xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com>

* config/arc/arc-c.def (__ARC_UNALIGNED__): Set it on
unaligned_access variable.
* config/arc/arc.c (arc_override_options): Set unaligned access
default on for HS CPUs.
* config/arc/arc.h (STRICT_ALIGNMENT): Fix logic.

From-SVN: r269417

gcc/ChangeLog
gcc/config/arc/arc-c.def
gcc/config/arc/arc.c
gcc/config/arc/arc.h

index 2603a777ee135969c77d2d09dd25088f64541826..3408e67b2c53488134bb2112826f5d5a9167baaf 100644 (file)
@@ -1,3 +1,11 @@
+2019-03-06  Claudiu Zissulescu  <claziss@synopsys.com>
+
+       * config/arc/arc-c.def (__ARC_UNALIGNED__): Set it on
+       unaligned_access variable.
+       * config/arc/arc.c (arc_override_options): Set unaligned access
+       default on for HS CPUs.
+       * config/arc/arc.h (STRICT_ALIGNMENT): Fix logic.
+
 2019-03-06  Martin Liska  <mliska@suse.cz>
 
        PR gcov-profile/89577
index 9c0ba2c9c294db1962b33d921b875139b6ea8aa1..9472b48aa7bc186638e3719a5a01924eb3cd92d6 100644 (file)
@@ -29,7 +29,7 @@ ARC_C_DEF ("__ARC_MUL64__",   TARGET_MUL64_SET)
 ARC_C_DEF ("__ARC_MUL32BY16__", TARGET_MULMAC_32BY16_SET)
 ARC_C_DEF ("__ARC_SIMD__",     TARGET_SIMD_SET)
 ARC_C_DEF ("__ARC_RF16__",     TARGET_RF16)
-ARC_C_DEF ("__ARC_UNALIGNED__", !STRICT_ALIGNMENT)
+ARC_C_DEF ("__ARC_UNALIGNED__", unaligned_access)
 
 ARC_C_DEF ("__ARC_BARREL_SHIFTER__", TARGET_BARREL_SHIFTER)
 
index de2c8d5df9cfb35b4e0ff4bb0303928544b1349e..3b8c29981b9a98ce0370093e1624a0a62027f2d5 100644 (file)
@@ -1313,6 +1313,10 @@ arc_override_options (void)
   if (TARGET_LONG_CALLS_SET)
     target_flags &= ~MASK_MILLICODE_THUNK_SET;
 
+  /* Set unaligned to all HS cpus.  */
+  if (!global_options_set.x_unaligned_access && TARGET_HS)
+    unaligned_access = 1;
+
   /* These need to be done at start up.  It's convenient to do them here.  */
   arc_init ();
 }
index 12b4b62bba7b56adde5ce07ed591aaa909c11649..894eb39460006feb9c54fa1e1b99bc24163e3f91 100644 (file)
@@ -285,7 +285,7 @@ if (GET_MODE_CLASS (MODE) == MODE_INT               \
 /* On the ARC the lower address bits are masked to 0 as necessary.  The chip
    won't croak when given an unaligned address, but the insn will still fail
    to produce the correct result.  */
-#define STRICT_ALIGNMENT (!unaligned_access && !TARGET_HS)
+#define STRICT_ALIGNMENT (!unaligned_access)
 
 /* Layout of source language data types.  */