]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR rtl-optimization/18577 (variable use moved before initialization)
authorFalk Hueffner <falk@debian.org>
Sat, 27 Nov 2004 16:59:16 +0000 (17:59 +0100)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Sat, 27 Nov 2004 16:59:16 +0000 (16:59 +0000)
PR optimization/18577
* unroll.c (unroll_loop): Test both REGNO_LAST_UID and
REGNO_LAST_NOTE_UID to decide whether a pseudo is local
to the loop.

Co-Authored-By: Eric Botcazou <ebotcazou@libertysurf.fr>
From-SVN: r91383

gcc/ChangeLog
gcc/regclass.c
gcc/regs.h
gcc/unroll.c

index bbfd8f5efcd53c853bb1d584957b53c657000843..8882add1203b87c910b4c68c4c27bc439fb5c3e8 100644 (file)
@@ -1,3 +1,11 @@
+2004-11-27  Falk Hueffner  <falk@debian.org>
+            Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       PR optimization/18577
+       * unroll.c (unroll_loop): Test both REGNO_LAST_UID and
+       REGNO_LAST_NOTE_UID to decide whether a pseudo is local
+       to the loop.
+
 2004-11-27  Alan Modra  <amodra@bigpond.net.au>
 
        PR target/12769
index 45c69d8b89a1cd66bc66c640fbdd7d11f88be73e..ecc630f42da3ce4e838818d84277d01d7768e4b0 100644 (file)
@@ -2415,9 +2415,15 @@ reg_scan_mark_refs (x, insn, note_flag, min_regno)
 
        if (regno >= min_regno)
          {
+           /* While the following 3 lines means that the inequality
+                REGNO_LAST_UID (regno) <= REGNO_LAST_NOTE_UID (regno)
+              is true at the end of the scanning, it may be subsequently
+              invalidated (e.g. in load_mems) so it should not be relied
+              upon.  */
            REGNO_LAST_NOTE_UID (regno) = INSN_UID (insn);
            if (!note_flag)
              REGNO_LAST_UID (regno) = INSN_UID (insn);
+
            if (REGNO_FIRST_UID (regno) == 0)
              REGNO_FIRST_UID (regno) = INSN_UID (insn);
            /* If we are called by reg_scan_update() (indicated by min_regno
index 2e838e329398a563525077f5b38a40825234fd79..e823298614de43d9a97651bc34b63ceca21c7d22 100644 (file)
@@ -49,6 +49,9 @@ typedef struct reg_info_def
   int first_uid;               /* UID of first insn to use (REG n) */
   int last_uid;                        /* UID of last insn to use (REG n) */
   int last_note_uid;           /* UID of last note to use (REG n) */
+                               /* See the comment in reg_scan_mark_refs on
+                                  the relationship between last_uid and
+                                  last_note_uid.  */
 
                                /* fields set by reg_scan & flow_analysis */
   int sets;                    /* # of times (REG n) is set */
index a8142080918040ed88e9cc2ecdaec1855e83d32e..8498874df41bee9ecd9db588452aff8a4286e2f6 100644 (file)
@@ -794,6 +794,10 @@ unroll_loop (loop, insn_count, strength_reduce_p)
       for (r = FIRST_PSEUDO_REGISTER; r < max_reg_before_loop; ++r)
        if (REGNO_FIRST_UID (r) > 0 && REGNO_FIRST_UID (r) < max_uid_for_loop
            && REGNO_FIRST_LUID (r) >= copy_start_luid
+           /* See the comment in reg_scan_mark_refs on the relationship between
+              last_uid and last_note_uid.  */
+           && REGNO_LAST_UID (r) > 0 && REGNO_LAST_UID (r) < max_uid_for_loop
+           && REGNO_LAST_LUID (r) <= copy_end_luid
            && REGNO_LAST_NOTE_UID (r) > 0 && REGNO_LAST_NOTE_UID (r) < max_uid_for_loop
            && REGNO_LAST_NOTE_LUID (r) <= copy_end_luid)
          {