Suggestion of a new peephole (fwd)

Piotr Buciak P.Buciak@elka.pw.edu.pl
Thu Oct 12 10:12:00 GMT 2000


Hello!

When I compile my programs with gcc 2.95.2 under Linux and generate
assembler listings with following optimization options: -O2
-fomit-frame-pointer -fcaller-saves -freg-struct-return
in result I get code with numerous sequnces of following instructions:
add $32,%esp
add $-8,%esp
In most of the cases there are 2 add to %esp instructions, but sometimes
3 one after another happen. I suggest to combine them, for example to make
add $24,%esp 
from the example shown above. Consider also combining add/sub and sub/sub
repetitions into one instrution.

To proove it I send you following files:
listy.c - C source file
listy.lst - assembler listing
xa1 - shell script with the command line I use to compile.

The main function of listy.lst consist of some 10 such repetitions.

Best regards

Piotr Buciak


More information about the Gcc-bugs mailing list