]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR rtl-optimization/7871 (ICE on legal code, global register variables problems)
authorIan Lance Taylor <ian@gcc.gnu.org>
Sat, 28 Feb 2004 13:36:28 +0000 (13:36 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Sat, 28 Feb 2004 13:36:28 +0000 (13:36 +0000)
PR optimization/7871
* flow.c (mark_set_1): Don't add LOG_LINKS for global registers
from or to call insns.
(propagate_one_insn): Interpret calls as setting global registers,
not merely clobbering them.

From-SVN: r78618

gcc/ChangeLog
gcc/flow.c

index 4e0768eab95dfb62cc37f04ff4113587a0071f67..3392469efa9ebd7ef12b69c7107968e5c4182dcc 100644 (file)
@@ -1,3 +1,15 @@
+2004-02-27  Ian Lance Taylor  <ian@wasabisystems.com>
+
+       PR optimization/7871
+       * flow.c (mark_set_1): Don't add LOG_LINKS for global registers
+       from or to call insns.  
+
+2004-02-27  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       PR optimization/7871
+       * flow.c (propagate_one_insn): Interpret calls as setting global
+       registers, not merely clobbering them.
+
 2004-02-26  Richard Earnshaw  <rearnsha@arm.com>
        Daniel Jacobowitz  <drow@mvista.com>
 
index 7882b25ae9a8aacb6080a84a5bd47a1e716c3e9b..c5699b77e4d30f4c35260d2a3b6b2a1e2992bf3a 100644 (file)
@@ -1799,8 +1799,9 @@ propagate_one_insn (pbi, insn)
                                              current_function_return_rtx,
                                              (rtx *) 0)))
              {
+               enum rtx_code code = global_regs[i] ? SET : CLOBBER;
                /* We do not want REG_UNUSED notes for these registers.  */
-               mark_set_1 (pbi, CLOBBER, regno_reg_rtx[i], cond, insn,
+               mark_set_1 (pbi, code, regno_reg_rtx[i], cond, insn,
                            pbi->flags & ~(PROP_DEATH_NOTES | PROP_REG_INFO));
              }
        }
@@ -2813,10 +2814,18 @@ mark_set_1 (pbi, code, reg, cond, insn, flags)
                     in ASM_OPERANDs.  If these registers get replaced,
                     we might wind up changing the semantics of the insn,
                     even if reload can make what appear to be valid
-                    assignments later.  */
+                    assignments later.
+
+                    We don't build a LOG_LINK for global registers to
+                    or from a function call.  We don't want to let
+                    combine think that it knows what is going on with
+                    global registers.  */
                  if (y && (BLOCK_NUM (y) == blocknum)
                      && (regno_first >= FIRST_PSEUDO_REGISTER
-                         || asm_noperands (PATTERN (y)) < 0))
+                         || (asm_noperands (PATTERN (y)) < 0
+                             && ! ((GET_CODE (insn) == CALL_INSN
+                                    || GET_CODE (y) == CALL_INSN)
+                                   && global_regs[regno_first]))))
                    LOG_LINKS (y) = alloc_INSN_LIST (insn, LOG_LINKS (y));
                }
            }