]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[ARC] Enable unaligned access.
authorClaudiu Zissulescu <claziss@synopsys.com>
Mon, 8 Jan 2018 10:49:01 +0000 (11:49 +0100)
committerClaudiu Zissulescu <claziss@gcc.gnu.org>
Mon, 8 Jan 2018 10:49:01 +0000 (11:49 +0100)
Use munaligned-access to control if we can have unaligned accesses.  For ARC
HS family unaligned access is always on.

2018-01-08  Claudiu Zissulescu  <claziss@synopsys.com>

* config/arc/arc-c.def (__ARC_UNALIGNED__): New define.
* config/arc/arc.h (STRICT_ALIGNMENT): Control this macro using
munaligned-access.

From-SVN: r256333

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

index bcbb551f0536cb9e38d0eec82dce29b8aeaa0384..75bf6b88e6b9e602cf08002276c5a6f6bcf98705 100644 (file)
@@ -1,3 +1,9 @@
+2018-01-08  Claudiu Zissulescu  <claziss@synopsys.com>
+
+       * config/arc/arc-c.def (__ARC_UNALIGNED__): New define.
+       * config/arc/arc.h (STRICT_ALIGNMENT): Control this macro using
+       munaligned-access.
+
 2018-01-08  Sebastian Huber  <sebastian.huber@embedded-brains.de>
 
        PR target/83681
index bb7ba4ad2964941bed49a2043779391a98250230..aefaeb443131a256a96ff09c72fd41067edcf07a 100644 (file)
@@ -28,6 +28,7 @@ ARC_C_DEF ("__ARC_NORM__",    TARGET_NORM)
 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_UNALIGNED__", !STRICT_ALIGNMENT)
 
 ARC_C_DEF ("__ARC_BARREL_SHIFTER__", TARGET_BARREL_SHIFTER)
 
index a04a3e9f1167db2a04fe33f5d59d002381074d93..ae3d9c1c75b3178b0e65d25fd9ce461c34f42d3f 100644 (file)
@@ -288,7 +288,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 1
+#define STRICT_ALIGNMENT (!unaligned_access && !TARGET_HS)
 
 /* Layout of source language data types.  */