This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/20928] [4.0/4.1 regression] ICE: unrecognizable insns with -fPIC -O1
- From: "hubicka at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Oct 2005 18:00:09 -0000
- Subject: [Bug target/20928] [4.0/4.1 regression] ICE: unrecognizable insns with -fPIC -O1
- References: <bug-20928-260@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #16 from hubicka at gcc dot gnu dot org 2005-10-30 18:00 -------
testing fix that should make legitimize_pic_address correctly decompose the
address. Similar to Steven's but I think it actually works ;)
Index: config/i386/i386.c
===================================================================
--- config/i386/i386.c (revision 106026)
+++ config/i386/i386.c (working copy)
@@ -6016,7 +6016,18 @@ legitimize_pic_address (rtx orig, rtx re
}
else
{
- if (GET_CODE (addr) == CONST)
+ if (GET_CODE (addr) == CONST_INT
+ && !x86_64_immediate_operand (addr, VOIDmode))
+ {
+ if (reg)
+ {
+ emit_move_insn (reg, addr);
+ new = reg;
+ }
+ else
+ new = force_reg (DImode, addr);
+ }
+ else if (GET_CODE (addr) == CONST)
{
addr = XEXP (addr, 0);
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20928