This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Is the GCC optimazer too smart?
- From: Andrew Haley <aph at redhat dot com>
- To: thomas dot martitz at student dot HTW-Berlin dot de
- Cc: gcc-help at gcc dot gnu dot org
- Date: Thu, 10 Dec 2009 14:22:15 +0000
- Subject: Re: Is the GCC optimazer too smart?
- References: <2280d7230912100403k6bf05d01p4d719e89c1ed2b52@mail.gmail.com> <4B20E545.5020501@redhat.com> <4B210229.408@htw-berlin.de>
Thomas Martitz wrote:
> Am 10.12.2009 13:10, schrieb Andrew Haley:
>
>>> Now my question is: is it correct that the compiler enforces the
>>> constantness of the variable, even tought it states in the warning
>>> that the const qualifier has been discarded?
>>>
>> Yes.
>>
> and
>> behavior is undefined. ...
>>
>>
>
> doesn't really match though. The standard doesn't give the answer.
Sure it does. The behaviour is undefined, so the compiler can do
anything it likes. Demons may fly out of your nose.
Andrew.