[PATCH] enable -finline-functions optimization

Christopher Faylor cgf@redhat.com
Mon Apr 14 18:04:00 GMT 2003


On Mon, Apr 14, 2003 at 04:30:46PM +0200, Thomas Pfaff wrote:
>Christopher Faylor wrote:
>>On Mon, Apr 14, 2003 at 10:19:33AM +0200, Thomas Pfaff wrote:
>>
>>>According to
>>>http://gcc.gnu.org/onlinedocs/gcc-3.2.1/gcc/Function-Attributes.html
>>>__attribute__((used)) should do the trick, but it doesn't seem to work.
>>
>>Look at exceptions.cc: unused_sig_wrapper.
>
>Look at my patch: unused_sig_wrapper is removed when the code is 
>compiled with -finline-functions.
>
>I tried
>static void unused_sig_wrapper () __attribute__((const, used, noinline));
>
>and __attribute__((used)) should prevent the removal, but it didn't.

Ok.  In that case the final answer is that I'm not going to sacrifice
correct code to gcc bugs.  The attribute stuff used to be sufficient to
cause the functions to be kept.  At one point, aliasing the function
also kept the function around, if you want to try that.  I don't mind
hiding stuff in a macro.  I just don't want to have to comment every
should-be-static function in cygwin with a "I know it looks like it
should be static but it can't be really."

cgf



More information about the Cygwin-patches mailing list