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/44075] New: __builtin_eh_return miscompiled


At any optimisation level other than -O0, it seems that __builtin_eh_return
loses its handler arg.  For -m32 -O2 -S the following:

long offset;
void *handler;

void foo (void)
{
  __builtin_eh_return (offset, handler);
}

compiles to:

foo:
        stwu 1,-32(1)
        lis 9,offset@ha
        mflr 0
        stw 0,36(1)
        stw 3,16(1)
        stw 4,20(1)
        stw 5,24(1)
        stw 6,28(1)
        lwz 10,offset@l(9)
        lwz 0,36(1)
        lwz 3,16(1)
        lwz 4,20(1)
        lwz 5,24(1)
        mtlr 0
        lwz 6,28(1)
        addi 1,1,32
        add 1,1,10
        blr


-- 
           Summary: __builtin_eh_return miscompiled
           Product: gcc
           Version: 4.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: amodra at gmail dot com
GCC target triplet: powerpc*-*-linux


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


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