simplify-rtx.c (avoid_constant_pool_reference): Avoid calling simplify_subreg with...
authorAndreas Krebbel <krebbel1@de.ibm.com>
Thu, 9 Nov 2006 17:56:04 +0000 (17:56 +0000)
committerAndreas Krebbel <krebbel@gcc.gnu.org>
Thu, 9 Nov 2006 17:56:04 +0000 (17:56 +0000)
2006-11-09  Andreas Krebbel  <krebbel1@de.ibm.com>

* simplify-rtx.c (avoid_constant_pool_reference): Avoid calling
simplify_subreg with BLKmode outer mode.

2006-11-09  Andreas Krebbel  <krebbel1@de.ibm.com>

* gcc.dg/20061109-1.c: New testcase.

From-SVN: r118622

gcc/ChangeLog
gcc/simplify-rtx.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/20061109-1.c [new file with mode: 0644]

index 79191a1d70a74ccb4326d5d5265e5f7d9668aa8f..ea975cdbbf6930d904da1f218a42dffc35b97b3a 100644 (file)
@@ -1,3 +1,8 @@
+2006-11-09  Andreas Krebbel  <krebbel1@de.ibm.com>
+
+       * simplify-rtx.c (avoid_constant_pool_reference): Avoid calling 
+       simplify_subreg with BLKmode outer mode.
+
 2006-11-08  Brooks Moses  <brooks.moses@codesourcery.com>
 
        * doc/invoke.texi: Minor formatting fixes in option lists.
index fe5463a3f27079470d901cf94d00dfa27f4dd47b..6a9464ca8aa380b7a85ff7e5729bb6a592f423d6 100644 (file)
@@ -158,6 +158,9 @@ avoid_constant_pool_reference (rtx x)
       return x;
     }
 
+  if (GET_MODE (x) == BLKmode)
+    return x;
+
   addr = XEXP (x, 0);
 
   /* Call target hook to avoid the effects of -fpic etc....  */
index 93da32fe3331e7b6da84632b449ba985f87763bb..7980bf9e258e0bb92bec747b6a51760882893cdb 100644 (file)
@@ -1,3 +1,7 @@
+2006-11-09  Andreas Krebbel  <krebbel1@de.ibm.com>
+
+       * gcc.dg/20061109-1.c: New testcase.
+
 2006-11-09  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * gcc.dg/builtins-20.c: Use fabs, not __builtin_fabs.
diff --git a/gcc/testsuite/gcc.dg/20061109-1.c b/gcc/testsuite/gcc.dg/20061109-1.c
new file mode 100644 (file)
index 0000000..70ee36d
--- /dev/null
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+
+/* This assignment might be implemented with a mem copy from the
+   literal pool with two BLKmode operands.  This produced an ICE on S/390
+   since simplify_subreg was called for such a BLKmode operand.  */
+
+struct a
+{
+  unsigned int b:24;
+};
+
+void
+foo (struct a *t)
+{
+  t->b = 32;
+}