This is the mail archive of the
mailing list for the GCC project.
Re: Disable calling convention optimization for local functions
- From: Florian Weimer <fw at deneb dot enyo dot de>
- To: Satyam Sharma <satyam dot sharma at gmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Sat, 11 Nov 2017 20:04:44 +0100
- Subject: Re: Disable calling convention optimization for local functions
- Authentication-results: sourceware.org; auth=none
- References: <CAOc2av=oaNuJELB6cynxE+-pbiWVta+2WVSDUuu1xcRgTah2KA@mail.gmail.com>
* Satyam Sharma:
> Note, I tried specifying __attribute__((cdecl)) for the local static
> function (whose calling convention I wish to prevent from getting
> optimized), but the optimization still happens.
You could try __attribute__ ((used)). This is supposed to tell the
compiler that the function is referenced in ways it cannot detect, and
it should inhibit calling convention optimizations due to this.