This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/58831] [4.8/4.9 Regression] wrong code at -O2 and -O3 on x86_64-linux-gnu in 64-bit mode
- From: "ebotcazou at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 24 Oct 2013 15:34:03 +0000
- Subject: [Bug rtl-optimization/58831] [4.8/4.9 Regression] wrong code at -O2 and -O3 on x86_64-linux-gnu in 64-bit mode
- Auto-submitted: auto-generated
- References: <bug-58831-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58831
Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC|ebotcazou at gcc dot gnu.org |
Assignee|unassigned at gcc dot gnu.org |ebotcazou at gcc dot gnu.org
--- Comment #6 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
Looking into it. The non-deterministic behavior is cured by:
Index: recog.c
===================================================================
--- recog.c (revision 203876)
+++ recog.c (working copy)
@@ -3068,6 +3068,9 @@ peep2_reg_dead_p (int ofs, rtx reg)
return 1;
}
+/* Regno offset to be used in the register search. */
+static int search_ofs;
+
/* Try to find a hard register of mode MODE, matching the register class in
CLASS_STR, which is available at the beginning of insn CURRENT_INSN and
remains available until the end of LAST_INSN. LAST_INSN may be NULL_RTX,
@@ -3083,7 +3086,6 @@ rtx
peep2_find_free_register (int from, int to, const char *class_str,
enum machine_mode mode, HARD_REG_SET *reg_set)
{
- static int search_ofs;
enum reg_class cl;
HARD_REG_SET live;
df_ref *def_rec;
@@ -3548,6 +3550,7 @@ peephole2_optimize (void)
/* Initialize the regsets we're going to use. */
for (i = 0; i < MAX_INSNS_PER_PEEP2 + 1; ++i)
peep2_insn_data[i].live_before = BITMAP_ALLOC (®_obstack);
+ search_ofs = 0;
live = BITMAP_ALLOC (®_obstack);
FOR_EACH_BB_REVERSE (bb)
but there is something wrong in the alias.c machinery as well.