Patchwork A fix for PR44554

login
register
mail settings
Submitter Vladimir Makarov
Date Sept. 8, 2010, 8:11 p.m.
Message ID <4C87EE05.2060307@redhat.com>
Download mbox | patch
Permalink /patch/64202/
State New
Headers show

Comments

Vladimir Makarov - Sept. 8, 2010, 8:11 p.m.
The following patch fixes PR40386.  The problem in details is 
described on http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44554.

Is it ok to commit into trunk, gcc4.4 and gcc 4.5 branches?

2010-09-08  Vladimir Makarov <vmakarov@redhat.com>

         PR middle-end/44554
         * ira.c (ira): Switch off sharing spill slots if setjmp is called.
Richard Henderson - Sept. 8, 2010, 8:23 p.m.
On 09/08/2010 01:11 PM, Vladimir Makarov wrote:
>         PR middle-end/44554
>         * ira.c (ira): Switch off sharing spill slots if setjmp is called.

Ok everywhere.


r~

Patch

Index: ira.c
===================================================================
--- ira.c	(revision 164011)
+++ ira.c	(working copy)
@@ -3179,9 +3178,12 @@  ira (FILE *f)
   ira_assert (ira_conflicts_p || !loops_p);
 
   saved_flag_ira_share_spill_slots = flag_ira_share_spill_slots;
-  if (too_high_register_pressure_p ())
+  if (too_high_register_pressure_p () || cfun->calls_setjmp)
     /* It is just wasting compiler's time to pack spilled pseudos into
-       stack slots in this case -- prohibit it.  */
+       stack slots in this case -- prohibit it.  We also do this if
+       there is setjmp call because a variable not modified between
+       setjmp and longjmp the compiler is required to preserve its
+       value and sharing slots does not guarantee it.  */
     flag_ira_share_spill_slots = FALSE;
 
   ira_color ();