gcse.c (do_local_cprop): Do not extend lifetimes of registers set by do_local_cprop.
authorJan Hubicka <jh@suse.cz>
Sun, 21 Jul 2002 19:38:08 +0000 (21:38 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sun, 21 Jul 2002 19:38:08 +0000 (19:38 +0000)
* gcse.c (do_local_cprop): Do not extend lifetimes of registers set by
do_local_cprop.

From-SVN: r55626

gcc/ChangeLog
gcc/gcse.c

index 3d4ad2769b1efc43502b4dcd6a31f35c4a469b66..0f5b87b1305252409cb9aa879ed15354c7c4335d 100644 (file)
@@ -1,3 +1,8 @@
+Sun Jul 21 21:36:41 CEST 2002  Jan Hubicka  <jh@suse.cz>
+
+       * gcse.c (do_local_cprop): Do not extend lifetimes of registers set by
+       do_local_cprop.
+
 2002-07-21  Andreas Jaeger  <aj@suse.de>
 
         * reload1.c (fixup_abnormal_edges): Remove unused variable.
index d46f81bc800adb56796670bf3eb2d4eb5f811cad..7fdcdea2a6c547bc75794cc766122e2eae3fd1f0 100644 (file)
@@ -4312,9 +4312,18 @@ do_local_cprop (x, insn, alter_jumps)
       for (l = val->locs; l; l = l->next)
        {
          rtx this_rtx = l->loc;
+         rtx note;
+
          if (CONSTANT_P (this_rtx))
            newcnst = this_rtx;
-         if (REG_P (this_rtx) && REGNO (this_rtx) >= FIRST_PSEUDO_REGISTER)
+         if (REG_P (this_rtx) && REGNO (this_rtx) >= FIRST_PSEUDO_REGISTER
+             /* Don't copy propagate if it has attached REG_EQUIV note.
+                At this point this only function parameters should have
+                REG_EQUIV notes and if the argument slot is used somewhere
+                explicitly, it means address of parameter has been taken,
+                so we should not extend the lifetime of the pseudo.  */
+             && (!(note = find_reg_note (l->setting_insn, REG_EQUIV, NULL_RTX))
+                 || GET_CODE (XEXP (note, 0)) != MEM))
            newreg = this_rtx;
        }
       if (newcnst && constprop_register (insn, x, newcnst, alter_jumps))