This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Order of passing optimization flags to gcc
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Mohamed Boussaa <mohamedboussaa3 at gmail dot com>
- Cc: gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Wed, 14 Oct 2015 15:10:37 +0100
- Subject: Re: Order of passing optimization flags to gcc
- Authentication-results: sourceware.org; auth=none
- References: <CADEOxiPgB+cjHeiCS=2ALBX8MidLxpi_aLtsB=uZiE6bfCJNeg at mail dot gmail dot com>
On 14 October 2015 at 05:50, Mohamed Boussaa wrote:
> I would like to define a set of 10 optimization options to an input C program.
> example: gcc -fauto-inc-dec -fbranch-count-reg
> -fcombine-stack-adjustments ... test.c -o out.o
> Does the order of these options affect the effectiveness of the produced code?
No.
The only time the order of options makes a difference is for options
that cancel or override each other, in which case the last such
options wins.
For example, given -ffoo -fno-foo the order matters, and given
-march=i586 -march=i686 the order matters.