This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] 4.8: Fix RTX sharing problem in ifcvt


Hi,

the GCC 4.8.0 release unfortunately does not bootstrap on S/390.  It
fails with a bootstrap comparison failure.

The problem is an RTL sharing bug created by ifcvt. I never noticed it
because the problem does *not* occur with --enable-checking which I'm
usually using on my daily build system.

In fact enable-checking is supposed to detect that kind of problems
but in this case it unfortunately hides it.  I'll address this with a
separate patch.

noce_try_move in ifcvt.c creates a copy of if_info->a or if_info->b
when emitting the additional move but end_ifcvt_sequence does not mark
it for unsharing the RTX. The result is an shared MEM RTX which later
on generates broken code when IRA replaces the address register of one
of the copies.

This results in a bootstrap comparison failure since stage1 is always
built with enable-checking which papers over the problem for the
stage2 compiler. stage3 then is broken.

Bootstrapped and tested with no regressions on x86_64, ppc64 and s390x.
Ok for 4.8 and mainline?

Bye,

-Andreas-

2013-04-11  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

	* ifcvt.c (end_ifcvt_sequence): Mark a and b for unsharing as
	well.

---
 gcc/ifcvt.c |    2 ++
 1 file changed, 2 insertions(+)

Index: gcc/ifcvt.c
===================================================================
*** gcc/ifcvt.c.orig
--- gcc/ifcvt.c
*************** end_ifcvt_sequence (struct noce_if_info
*** 964,969 ****
--- 964,971 ----
  
    set_used_flags (if_info->x);
    set_used_flags (if_info->cond);
+   set_used_flags (if_info->a);
+   set_used_flags (if_info->b);
    unshare_all_rtl_in_chain (seq);
    end_sequence ();
  


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]