This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[lno] Fix for PR14658
- From: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 20 Mar 2004 00:40:55 +0100
- Subject: [lno] Fix for PR14658
Hello,
this patch fixes the bug in invariant motion causing
PR optimization/14658.
Zdenek
Index: ChangeLog.lno
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/ChangeLog.lno,v
retrieving revision 1.1.2.92
diff -c -3 -p -r1.1.2.92 ChangeLog.lno
*** ChangeLog.lno 18 Mar 2004 22:49:33 -0000 1.1.2.92
--- ChangeLog.lno 19 Mar 2004 23:38:07 -0000
***************
*** 1,3 ****
--- 1,9 ----
+ 2004-03-20 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ PR optimization/14658
+ * loop-invariant.c (move_invariant_reg): Handle assignments
+ with nontrivial lhs correctly.
+
2004-03-18 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
* df.c (df_reg_def_chain_create, df_reg_use_chain_create): Do not clean
Index: loop-invariant.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/loop-invariant.c,v
retrieving revision 1.1.4.4
diff -c -3 -p -r1.1.4.4 loop-invariant.c
*** loop-invariant.c 12 Mar 2004 01:28:29 -0000 1.1.4.4
--- loop-invariant.c 19 Mar 2004 23:38:07 -0000
*************** move_invariant_reg (struct loop *loop, u
*** 800,809 ****
/* Replace the uses we know to be dominated. It saves work for copy
propagation, and also it is necessary so that dependent invariants
are computed right. */
! for (use = inv->def->uses; use; use = use->next)
{
! *use->pos = reg;
! df_insn_modify (df, BLOCK_FOR_INSN (use->insn), use->insn);
}
}
--- 800,812 ----
/* Replace the uses we know to be dominated. It saves work for copy
propagation, and also it is necessary so that dependent invariants
are computed right. */
! if (inv->def)
{
! for (use = inv->def->uses; use; use = use->next)
! {
! *use->pos = reg;
! df_insn_modify (df, BLOCK_FOR_INSN (use->insn), use->insn);
! }
}
}