This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Conditional compilation
- From: Ian Lance Taylor <iant at google dot com>
- To: StÃphane FORNENGO <sfornengo at gmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Tue, 10 May 2011 07:33:42 -0700
- Subject: Re: Conditional compilation
- References: <BANLkTi=RXat87SbJtucu_PBJmhkOgzKa2w@mail.gmail.com>
StÃphane FORNENGO <sfornengo@gmail.com> writes:
> Is the following idea possible ?
> take for example the strcmp function with the standard following code:
...
> this usages could be detect at compile time and the function code
> greatly optimized knowing this information !
Yes, this is possible, and the x86 backend already uses this
information, when available, when selecting the strcmp strategy. This
kind of optimization is inherently machine dependent; I'm not sure
whether any other backends implement it.
Ian