Hi, The following testcase reduced from Python's mathmodule.c is miscompiled with gcc 3.3-hammer at -O2 and FSF gcc version 4.0.3 20051103 at -O2 -fno-unit-at-a-time as otherwise gcc is smart enough to optimize out the function descriptor and the problem disappears.
Looking at the generated assembly, the second func() TOC is loaded too early and what is to contain 2.0 is garbaged (value loaded from elsewhere). -- Summary: Python miscompilation - TOC reload Product: gcc Version: 4.0.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: gbeauchesne at mandriva dot com GCC build triplet: powerpc64-unknown-linux-gnu GCC host triplet: powerpc64-unknown-linux-gnu GCC target triplet: powerpc64-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24779