Re: Force ret to be at the end of a function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks for the suggestion. But I wish to use the stock gcc so that other people
can repeat what I do.

Since no standard option works, I am thinking of other tricks.
Is it possible to add some "barrier" code at the end of a function so
that gcc will not
move any basic blocks after that? So that my real code is a
single-entry single-exit
region.

Weiqin



On 4/6/07, Andrew Haley <aph@xxxxxxxxxx> wrote:
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


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux