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 middle-end/37359] [4.4 Regression] IRA miscompiled transfer.o in libgfortran



------- Comment #2 from hjl dot tools at gmail dot com  2008-09-03 20:57 -------
IRA doesn't handle setjmp properly. For

 if (setjmp (eof_jump))
    {    
      generate_error (&dtp->common, LIBERROR_END, NULL);
      return;
    }    

IRA generates

.L594:
        .loc 1 2859 0
        .mmi
        mov r36 = r32
        nop 0
        addl r37 = -1, r0
        .mmb
        mov r38 = r0
        nop 0
        br.call.sptk.many b0 = _gfortrani_generate_error
        ;;

The problem is r32 isn't preserved across setjmp. Before IRA, we have

.L599:
        .loc 1 2859 0
        .mmi
        adds r16 = 736, r12
        addl r37 = -1, r0
        mov r38 = r0
        ;;
        .mib
        ld8 r36 = [r16] 
        nop 0
        br.call.sptk.many b0 = _gfortrani_generate_error
        ;;

r12 is preserved across setjmp.


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.4.0                       |---


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


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