* [PATCH, i386]: FIX PR 52882, ICE in memory_address_length, at config/i386/i386.c:23373
@ 2012-04-05 21:52 Uros Bizjak
0 siblings, 0 replies; only message in thread
From: Uros Bizjak @ 2012-04-05 21:52 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 621 bytes --]
Hello!
We can allow AND zero-extended CONST_INT operands in
ix86_decompose_address. These are sometimes generated by IRA for
certain corner cases, as in attached testcase.
2012-04-05 Uros Bizjak <ubizjak@gmail.com>
PR target/52882
* config/i386/i386.c (ix86_decompose_address): Allow VOIDmode
CONST_INT operands, zero-extended with AND.
testsuite/ChangeLog:
2012-04-05 Uros Bizjak <ubizjak@gmail.com>
PR target/52882
* gcc.target/i386/pr52882.c: New test.
Patch was bootstrapped and regression tested on x86_64-pc-linux-gnu
{,-m32} and committed to mainline SVN.
Uros.
[-- Attachment #2: p.diff.txt --]
[-- Type: text/plain, Size: 911 bytes --]
Index: config/i386/i386.c
===================================================================
--- config/i386/i386.c (revision 186169)
+++ config/i386/i386.c (working copy)
@@ -11510,7 +11510,7 @@ ix86_decompose_address (rtx addr, struct ix86_addr
addr = SUBREG_REG (addr);
else if (GET_MODE (addr) == DImode)
addr = gen_rtx_SUBREG (SImode, addr, 0);
- else
+ else if (GET_MODE (addr) != VOIDmode)
return 0;
}
}
Index: testsuite/gcc.target/i386/pr52882.c
===================================================================
--- testsuite/gcc.target/i386/pr52882.c (revision 0)
+++ testsuite/gcc.target/i386/pr52882.c (revision 0)
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+struct S1 {
+ int f0;
+ int f1;
+};
+
+int fn1 ();
+void fn2 (struct S1);
+
+void
+fn3 () {
+ struct S1 a = { 1, 0 };
+ if (fn1 ())
+ fn2 (a);
+ for (; a.f1;) {
+ }
+}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-04-05 21:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-05 21:52 [PATCH, i386]: FIX PR 52882, ICE in memory_address_length, at config/i386/i386.c:23373 Uros Bizjak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).