looking for a way to tell gcc not to remove some code he thinks is unreachable.

looking for a way to tell gcc not to remove some code he thinks is unreachable.

Michael Vasiliev mycroft at yandex.ru
Wed Mar 9 11:13:23 IST 2011


On 03/07/2011 12:11 PM, Erez D wrote:
> I have a function which is not called in a regular way, so gcc thinks
> it is dead code.
> however it is not, and i am looking for a way to tell the linker not
> to remove it.
>
> i can call it from some place with a flag that tells it to do nothing,
> but this is a ugly hack
> is there a directive telling gcc not to remove that certain function ?
>
I did not exactly try, but if there is -fdce, which is by default
enabled an -O*, there should be also -fno-dce and fno-tree-dce, is it not?

> thanks,
> erez.
>
>
> _______________________________________________
> Linux-il mailing list
> Linux-il at cs.huji.ac.il
> http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cs.huji.ac.il/pipermail/linux-il/attachments/20110309/ca454d46/attachment.html>


More information about the Linux-il mailing list