Fix shorten_branches bugs
authorBernd Schmidt <bernds@redhat.co.uk>
Tue, 19 Sep 2000 16:43:36 +0000 (16:43 +0000)
committerBernd Schmidt <crux@gcc.gnu.org>
Tue, 19 Sep 2000 16:43:36 +0000 (16:43 +0000)
From-SVN: r36538

gcc/ChangeLog
gcc/final.c

index 4000a6c69867d61f93a02d51cc52fe8ea617fc5e..148ec20d2d607baa995213024677d01b490f62c9 100644 (file)
@@ -1,5 +1,9 @@
 2000-09-19  Bernd Schmidt  <bernds@redhat.co.uk>
 
+       * final.c (insn_current_reference_address): Use INSN_SHUID of seq
+       rather than that of branch.
+       (shorten_branches): Don't increment insn_current_address twice.
+
        Undo most of the Wed Jan 27 23:39:53 1999 patch:
        * loop.h (struct induction): Delete members derived, ix and last_use.
        (struct loop_ivs): Delete members first_increment_giv and
@@ -22,8 +26,6 @@
        increments.
        Don't set derived_regs.
 
-2000-09-19  Bernd Schmidt  <bernds@redhat.co.uk>
-
        Fix misapplied earlier patch:
        * config/sh/sh.md (floatsisf_ie): Reenable.  Remove explicit reference
        to fpul.
index c22df2f4c9669c77148ebda0207b85393005a5cb..bfd47545d6ac984c1bfdb4cebfd525b93ca4fae4 100644 (file)
@@ -932,8 +932,9 @@ insn_current_reference_address (branch)
     return insn_current_address;
   dest = JUMP_LABEL (branch);
 
-  /* BRANCH has no proper alignment chain set, so use SEQ.  */
-  if (INSN_SHUID (branch) < INSN_SHUID (dest))
+  /* BRANCH has no proper alignment chain set, so use SEQ.  
+     BRANCH also has no INSN_SHUID.  */
+  if (INSN_SHUID (seq) < INSN_SHUID (dest))
     {
       /* Forward branch.  */
       return (insn_last_address + insn_lengths[seq_uid]
@@ -1241,7 +1242,6 @@ shorten_branches (first)
              int align = 1 << log;
              int new_address = (insn_current_address + align - 1) & -align;
              insn_lengths[uid] = new_address - insn_current_address;
-             insn_current_address = new_address;
            }
        }