[PATCH] ICE caused by calling simplify_subreg with BLKmode

Andreas Krebbel Andreas.Krebbel@de.ibm.com
Thu Nov 9 08:52:00 GMT 2006


Hi,

> AIUI, we should never have a BLKmode constant pool entry, so perhaps
> it would be clearer to add a BLKmode shortcut to the MEM case.
> Just a suggestion though.

Agreed. Here is the revised version. Bootstrapped on s390 and s390x.

Bye,

-Andreas-


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.


Index: gcc/simplify-rtx.c
===================================================================
*** gcc/simplify-rtx.c.orig	2006-11-07 10:10:30.000000000 +0100
--- gcc/simplify-rtx.c	2006-11-08 16:07:36.000000000 +0100
*************** avoid_constant_pool_reference (rtx x)
*** 139,144 ****
--- 139,146 ----
    switch (GET_CODE (x))
      {
      case MEM:
+       if (GET_MODE (x) == BLKmode)
+ 	return x;
        break;
  
      case FLOAT_EXTEND:
Index: gcc/testsuite/gcc.dg/20061109-1.c
===================================================================
*** /dev/null	1970-01-01 00:00:00.000000000 +0000
--- gcc/testsuite/gcc.dg/20061109-1.c	2006-11-08 16:37:20.000000000 +0100
***************
*** 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;
+ }



More information about the Gcc-patches mailing list