]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
rs6000.c (rs6000_legitimize_address): Check for non-word-aligned REG+CONST addressing.
authorNathan Froyd <froydnj@codesourcery.com>
Wed, 7 Jan 2009 23:21:26 +0000 (23:21 +0000)
committerNathan Froyd <froydnj@gcc.gnu.org>
Wed, 7 Jan 2009 23:21:26 +0000 (23:21 +0000)
gcc/

* config/rs6000/rs6000.c (rs6000_legitimize_address): Check for
non-word-aligned REG+CONST addressing.

gcc/testsuite/

* gcc.c-torture/compile/20090107-1.c: New test.

Co-Authored-By: Alan Modra <amodra@bigpond.net.au>
From-SVN: r143171

gcc/ChangeLog
gcc/config/rs6000/rs6000.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/20090107-1.c [new file with mode: 0644]

index 92ffefea476b778be814efb3820cdc0d6db9bea2..29c4ba4a4314a305455960a3a6e3f669029d1cf2 100644 (file)
@@ -1,3 +1,9 @@
+2009-01-07  Nathan Froyd  <froydnj@codesourcery.com>
+           Alan Modra  <amodra@bigpond.net.au>
+
+       * config/rs6000/rs6000.c (rs6000_legitimize_address): Check for
+       non-word-aligned REG+CONST addressing.
+
 2009-01-07  Uros Bizjak  <ubizjak@gmail.com>
 
        PR target/38706
index 49551f61b5808a15b7913ae5853ad6aca4f89109..6d7327b5ea4dd5cb3ec1d9ae2602bdd2e80473a3 100644 (file)
@@ -3804,7 +3804,10 @@ rs6000_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
       && GET_CODE (XEXP (x, 0)) == REG
       && GET_CODE (XEXP (x, 1)) == CONST_INT
       && (unsigned HOST_WIDE_INT) (INTVAL (XEXP (x, 1)) + 0x8000) >= 0x10000
-      && !(SPE_VECTOR_MODE (mode)
+      && !((TARGET_POWERPC64
+           && (mode == DImode || mode == TImode)
+           && (INTVAL (XEXP (x, 1)) & 3) != 0)
+          || SPE_VECTOR_MODE (mode)
           || ALTIVEC_VECTOR_MODE (mode)
           || (TARGET_E500_DOUBLE && (mode == DFmode || mode == TFmode
                                      || mode == DImode || mode == DDmode
index e0fb09524d236da9cb0c07265c6b67bb06201d4c..ccd555e4c990f028eb19a181af948c62b9f26368 100644 (file)
@@ -1,3 +1,8 @@
+2009-01-07  Nathan Froyd  <froydnj@codesourcery.com>
+           Alan Modra  <amodra@bigpond.net.au>
+
+       * gcc.c-torture/compile/20090107-1.c: New test.
+
 2009-01-07  Uros Bizjak  <ubizjak@gmail.com>
 
        PR target/38706
diff --git a/gcc/testsuite/gcc.c-torture/compile/20090107-1.c b/gcc/testsuite/gcc.c-torture/compile/20090107-1.c
new file mode 100644 (file)
index 0000000..b5d4c1a
--- /dev/null
@@ -0,0 +1,25 @@
+/* Verify that we don't ICE by forming invalid addresses for unaligned
+   doubleword loads (originally for PPC64).  */
+
+struct a
+{
+ unsigned int x;
+ unsigned short y;
+} __attribute__((packed));
+
+struct b {
+ struct a rep;
+ unsigned long long seq;
+} __attribute__((packed));
+
+struct c {
+ int x;
+ struct a a[5460];
+ struct b b;
+};
+
+extern void use_ull(unsigned long long);
+extern void f(struct c *i) {
+  use_ull(i->b.seq);
+  return;
+}