This is the mail archive of the gcc-bugs@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]

[Bug target/24623] [4.1 Regression] internal compiler error: in propagate_one_insn, at flow.c:1702



------- Comment #5 from krebbel1 at de dot ibm dot com  2005-11-04 08:02 -------
The problem occurs when a landing pad is optimized away but
the special code in s390_regs_ever_clobbered insists on saving all eh
registers. The special code in that function exists because the eh regs
may be read in a function (inside the landing pad) without beeing set
before. In that case s390_regs_ever_clobbered would not consider them
to be saved. With the attached patch the eh regs for a landing pad are
only saved if regs_ever_live is true for them.

I will not post the patch until I have decided how to fix PR 24624. It
is possible that 24624 can only be fixed by reverting my patch introducing
regs_ever_clobbered. If that patch gets reverted this fix is obsolete of
course.

That fixes the testcase in the PR.

Bootstrapped on s390 and s390x - no testsuite regressions.

OK for mainline?

Bye,

-Andreas-


2005-11-03  Andreas Krebbel  <krebbel1@de.ibm.com>

        * config/s390/s390.c (s390_regs_ever_clobbered): Only save LIVE eh regs
        for a function containing a landing pad.


Index: gcc/config/s390/s390.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/s390.c,v
retrieving revision 1.257
diff -p -c -r1.257 s390.c
*** gcc/config/s390/s390.c      30 Sep 2005 15:36:15 -0000      1.257
--- gcc/config/s390/s390.c      3 Nov 2005 12:56:06 -0000
*************** s390_regs_ever_clobbered (int *regs_ever
*** 5874,5880 ****
       deal with this automatically.  */
    if (current_function_calls_eh_return || cfun->machine->has_landing_pad_p)
      for (i = 0; EH_RETURN_DATA_REGNO (i) != INVALID_REGNUM ; i++)
!       regs_ever_clobbered[EH_RETURN_DATA_REGNO (i)] = 1;

    /* For nonlocal gotos all call-saved registers have to be saved.
       This flag is also set for the unwinding code in libgcc.
--- 5874,5883 ----
       deal with this automatically.  */
    if (current_function_calls_eh_return || cfun->machine->has_landing_pad_p)
      for (i = 0; EH_RETURN_DATA_REGNO (i) != INVALID_REGNUM ; i++)
!       if (current_function_calls_eh_return 
!         || (cfun->machine->has_landing_pad_p 
!             && regs_ever_live [EH_RETURN_DATA_REGNO (i)]))
!       regs_ever_clobbered[EH_RETURN_DATA_REGNO (i)] = 1;

    /* For nonlocal gotos all call-saved registers have to be saved.
       This flag is also set for the unwinding code in libgcc.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24623


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