This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Force ret to be at the end of a function
Wei Qin writes:
> I notice that gcc sometimes places the "ret" instruction in the middle
> of a function, or sometimes emits multiple "ret" instructions for a
> function. For some reason, I wish that my gcc emits only one "ret" at
> the end of a function. Is there a gcc switch to force that without
> disabling optimization?
There is no standard option. There are several passes that reorder
basic blocks. You'd have to find them all and disable them
individually.
Andrew.
--
Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, UK
Registered in England and Wales No. 3798903