This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][configure] Make sure CFLAGS_FOR_TARGET And CXXFLAGS_FOR_TARGET contain -O2
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: Christophe Lyon <christophe dot lyon at st dot com>
- Cc: "gcc-patches\ at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, "bonzini\ at gnu dot org" <bonzini at gnu dot org>, "dj\ at redhat dot com" <dj at redhat dot com>, "neroden\ at gcc dot gnu dot org" <neroden at gcc dot gnu dot org>, "Ralf dot Wildenhues\ at gmx dot de" <Ralf dot Wildenhues at gmx dot de>
- Date: Thu, 28 Jun 2012 04:32:16 -0300
- Subject: Re: [PATCH][configure] Make sure CFLAGS_FOR_TARGET And CXXFLAGS_FOR_TARGET contain -O2
- References: <4F744C01.8030909@st.com> <4F8C15DC.3020503@st.com> <4FE8818D.6020808@st.com> <Pine.LNX.4.64.1206251524260.15303@digraph.polyomino.org.uk> <4FE976CF.1010000@st.com> <orvcidbzfu.fsf@livre.localdomain> <4FEACD80.1000305@st.com>
On Jun 27, 2012, Christophe Lyon <christophe.lyon@st.com> wrote:
>> I looked at the patch in there, and I'm afraid I don't understand how it
>> achieves the ChangeLog-suggested purpose of ensuring -O2 makes to
>> C*FLAGS_FOR_TARGET, when all it appears to do is to prepend -g. Can you
>> please clarify?
> With more context, the current code fragment is:
> CFLAGS_FOR_TARGET=$CFLAGS
> case " $CFLAGS " in
> *" -O2 "*) ;;
> *) CFLAGS_FOR_TARGET="-O2 $CFLAGS" ;;
> esac
> case " $CFLAGS " in
> *" -g "* | *" -g3 "*) ;;
> *) CFLAGS_FOR_TARGET="-g $CFLAGS" ;;
> esac
> where pre-pending -g discards -O2 if it was pre-pended just above.
I see, thanks for clarifying.
I suggest changing both occurrences of $CFLAGS within the case
statements, then; the more uniform logic is more appealing to me.
Patch approved with these changes.
Thanks,
--
Alexandre Oliva, freedom fighter http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/ FSF Latin America board member
Free Software Evangelist Red Hat Brazil Compiler Engineer