This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/20928] [4.0/4.1 regression] ICE: unrecognizable insns with -fPIC -O1



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]