This is the mail archive of the gcc@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]

Re: Useless assembly


Hi Sam,

> Optimizing it at -O3 (which I'm sure includes SSA, DCE, and CCP)
> just made the compilation take longer and generate more assembly
> then the first time.

-O3 does not enable SSA-based optimizations.

> Also, when I just compiled a "return 0;", I would expect that to
> just generate main and the instruction "ret" (or is it
> "retn?"). Instead, it generated a lot of extra instructions, then
> finally "ret".

Add an option -fomit-frame-pointer.

Kazu Hirata


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