[PATCH 0/9] Cleanups to i386 prologue/epilogue generation

Jack Howarth howarth@bromo.med.uc.edu
Wed Aug 4 13:22:00 GMT 2010


On Tue, Aug 03, 2010 at 04:53:07PM -0700, Richard Henderson wrote:
> I've been preparing the i386 backend to add Win64 SEH unwind info.
> At first ktietz and I believed that RBP *must* point below the
> register save area (instead of at the top like the traditional
> frame pointer), but that turned out to be a bit of confusion in
> the reading of the spec and noticing that MSVC *does* point RBP
> below the register save area.
> 
> In preparation for this movement of the frame pointer, I noticed
> how convoluted this prologue/epilogue code is, and how decentralized
> the knowledge is.
> 
> This patch series cleans up the generation so that much more of the
> knowledge of frame layout is centralized in ix86_compute_frame_layout.
> Sequential conditions (e.g. where to save the registers) that must
> be mutually exclusive are changed to use boolean variables instead
> of replicating complicated conditions.
> 
> The result is, I think, significantly more readable.
> 
> Tested on x86_64-linux.  There are no code generation changes within
> x86_64 cc1 after the patch series.  Final testing on i686-linux is
> yet to complete; I'll check on that tomorrow morning.

Richard,
   These nine patches introduce 164 regressions in the -m32 libstdc++
testsuite on x86_64-apple-darwin10...

http://gcc.gnu.org/ml/gcc-testresults/2010-08/msg00331.html

The failures are due to warnings and are of the form...

Executing on host: /sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/./gcc/g++ -shared-libgcc -B/sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/./gcc -nostdinc++ -L/sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/x86_64-apple-darwin10.4.0/i386/libstdc++-v3/src -L/sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/x86_64-apple-darwin10.4.0/i386/libstdc++-v3/src/.libs -B/sw/lib/gcc4.6/x86_64-apple-darwin10.4.0/bin/ -B/sw/lib/gcc4.6/x86_64-apple-darwin10.4.0/lib/ -isystem /sw/lib/gcc4.6/x86_64-apple-darwin10.4.0/include -isystem /sw/lib/gcc4.6/x86_64-apple-darwin10.4.0/sys-include -m32 -B/sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/x86_64-apple-darwin10.4.0/i386/libstdc++-v3/src/.libs -g -O2 -D_GLIBCXX_ASSERT -fmessage-length=0 -ffunction-sections -fdata-sections -g -O2 -g -O2 -DLOCALEDIR="." -nostdinc++ -I/sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/x86_64-apple-darwin10.4.0/i386/libstdc++-v3/include/x86_64-apple-darwin10.4.0 -I/sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/x86_64-apple-darwin10.4.0/i386/libstdc++-v3/include -I/sw/src/fink.build/gcc46-4.6.0-1000/gcc-4.6-20100803/libstdc++-v3/libsupc++ -I/sw/src/fink.build/gcc46-4.6.0-1000/gcc-4.6-20100803/libstdc++-v3/include/backward -I/sw/src/fink.build/gcc46-4.6.0-1000/gcc-4.6-20100803/libstdc++-v3/testsuite/util /sw/src/fink.build/gcc46-4.6.0-1000/gcc-4.6-20100803/libstdc++-v3/testsuite/19_diagnostics/error_code/cons/39882.cc   -std=gnu++0x ./libtestc++.a   -lm   -m32 -o ./39882.exe    (timeout = 600)
ld: warning: can't add line info to anonymous symbol initializer$0 from /var/tmp//ccuyXXr3.o^M
output is:
ld: warning: can't add line info to anonymous symbol initializer$0 from /var/tmp//ccuyXXr3.o^M

FAIL: 19_diagnostics/error_code/cons/39882.cc (test for excess errors)
Excess errors:
ld: warning: can't add line info to anonymous symbol initializer$0 from /var/tmp//ccuyXXr3.o

I suspect this may be related to the fact that these tests use a static lib version of libtestc++.a.
              Jack
> 
> 
> 
> r~
> 
> 
> Richard Henderson (9):
>   Eliminate most of the conditional compilation from dwarf2out.c.
>   Simplify logic saving the int registers in the prologue.
>   Consolidate red-zone logic into ix86_using_red_zone.
>   Cleanup 32-bit ms_hook code.
>   Remove duplicate definition of TARGET_64BIT_MS_ABI.
>   Emit the prologue/epilogue using frame offsets.
>   Describe unwinding for realigned frames explicitly.
>   Remove code duplication in ix86_expand_epilogue.
>   Force the use of stack_pointer_offset in computing the frame size.
> 
>  gcc/config/i386/cygming.h |    3 -
>  gcc/config/i386/i386.c    | 1193 +++++++++++++++++++++++++--------------------
>  gcc/config/i386/i386.h    |   43 ++-
>  gcc/config/i386/i386.md   |   11 -
>  gcc/dwarf2out.c           |  145 ++----
>  gcc/reg-notes.def         |    6 +
>  6 files changed, 773 insertions(+), 628 deletions(-)
> 
> -- 
> 1.7.2



More information about the Gcc-patches mailing list