From d82a02fa4f3cd88f8d8f080ffe4bd9c7536c7e8f Mon Sep 17 00:00:00 2001 From: Andreas Krebbel Date: Thu, 9 Nov 2006 17:56:04 +0000 Subject: [PATCH] simplify-rtx.c (avoid_constant_pool_reference): Avoid calling simplify_subreg with BLKmode outer mode. 2006-11-09 Andreas Krebbel * simplify-rtx.c (avoid_constant_pool_reference): Avoid calling simplify_subreg with BLKmode outer mode. 2006-11-09 Andreas Krebbel * gcc.dg/20061109-1.c: New testcase. From-SVN: r118622 --- gcc/ChangeLog | 5 +++++ gcc/simplify-rtx.c | 3 +++ gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.dg/20061109-1.c | 17 +++++++++++++++++ 4 files changed, 29 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/20061109-1.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 79191a1d70a7..ea975cdbbf69 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2006-11-09 Andreas Krebbel + + * simplify-rtx.c (avoid_constant_pool_reference): Avoid calling + simplify_subreg with BLKmode outer mode. + 2006-11-08 Brooks Moses * doc/invoke.texi: Minor formatting fixes in option lists. diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index fe5463a3f270..6a9464ca8aa3 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -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.... */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 93da32fe3331..7980bf9e258e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2006-11-09 Andreas Krebbel + + * gcc.dg/20061109-1.c: New testcase. + 2006-11-09 Kaveh R. Ghazi * 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 index 000000000000..70ee36d47a8e --- /dev/null +++ b/gcc/testsuite/gcc.dg/20061109-1.c @@ -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; +} -- 2.47.2