This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/51933] [4.7 regression] wrong code due to -free
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 21 Jan 2012 15:57:23 +0000
- Subject: [Bug rtl-optimization/51933] [4.7 regression] wrong code due to -free
- Auto-submitted: auto-generated
- References: <bug-51933-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51933
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-01-21 15:57:23 UTC ---
Completely untested fix:
--- gcc/ree.c.jj 2011-12-28 10:52:44.000000000 +0100
+++ gcc/ree.c 2012-01-21 16:55:27.290731139 +0100
@@ -776,6 +776,23 @@ add_removable_extension (rtx x ATTRIBUTE
}
return;
}
+ else
+ {
+ rtx set = single_set (DF_REF_INSN (def->ref));
+ if (set == NULL_RTX
+ || !REG_P (SET_DEST (set))
+ || GET_MODE (SET_DEST (set)) != GET_MODE (XEXP (src, 0)))
+ {
+ if (dump_file)
+ {
+ fprintf (dump_file, "Cannot eliminate extension:\n");
+ print_rtl_single (dump_file, rei->insn);
+ fprintf (dump_file,
+ " because def insn has different mode\n");
+ }
+ return;
+ }
+ }
/* Then add the candidate to the list and insert the reaching
definitions
into the definition map. */