This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Enable GCC with CMOVxx
Hi Michael and John,
Thank you for your replies.
I managed to get around it for my particular case: determining the
performance difference of the "-fif-conversion" option. I copy this to
the list in case someone else has similar problem in the future.
You're both right on that the "-fif-conversion" option works only with
certain optimization level specified, such as "-O" and "-O2".
And you can turn it off by "-fno-if-conversion". So "-O2
-fno-if-conversion" would compile the code with all the optimization
options in O2 default except for "-fif-conversion".
For general case, link:
http://gcc.gnu.org/onlinedocs/gcc-4.3.3/gcc/Optimize-Options.html#Optimize-Options
says:
"Options of the form -fflag specify machine-independent flags. Most
flags have both positive and negative forms; the negative form of
-ffoo would be -fno-foo."
Please correct if I misunderstand anything.
Thank you.
LC
On Mon, Jul 20, 2009 at 6:15 PM, Michael
Meissner<meissner@linux.vnet.ibm.com> wrote:
> On Mon, Jul 20, 2009 at 05:37:29PM -0400, Lingchuan (LC) Meng wrote:
>> Hi all,
>>
>> I'm trying to enable gcc 4.3.2 on Ubuntu to compile C code with
>> support of conditional moves. (and Conditional Moves as the only
>> enabled optimization)
>>
>> I can see CMOVxx in the assembly compiled with "-O" option. However,
>> no CMOVxx is found in the assembly generated with just
>> "-fif-conversion" option.
>>
>> More surprisingly (well, at least to me), I listed all the enabled
>> optimization options of "-O", and put them in one line. Then I
>> compiled the same code as:
>
> Several optimizations require a certain optimization level, and are not done
> even if you specify the -f option. ?If conversion is one such optimization,
> where the functions gate_handle_if_conversion and
> gate_handle_if_conversion_after_combine, and
> gate_handle_if_conversion_after_reload in ifcvt.c all have explicit tests for
> optimize being greater than 0 in addition to the -f option flag(s). ?I would
> suspect this is because if conversion needs some of the dataflow passes that
> are not normally run for -O0. ?From the ChangeLogs, it looks like the functions
> were originally added in July 2005.
>
> --
> Michael Meissner, IBM
> 4 Technology Place Drive, MS 2203A, Westford, MA, 01886, USA
> meissner@linux.vnet.ibm.com
>
--
Best regards,
Lingchuan Meng