This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: simple example -O3 optimizer problem?


On 07/18/2014 09:40 AM, Dennis Luehring wrote:
> Am 18.07.2014 10:29, schrieb Andrew Haley:
>> On 18/07/14 08:30, Dennis Luehring wrote:
>>>    int* array = (int*)&argv;
>>
>> This looks like undefined behaviour.  Don't you get a warning?
> 
> no warning - its an valid typed pointer to stack and i don't care what 
> the values are
> its just an anti-optimizer trick nothing more

And if you give it the correct type, doe that make any difference?

Andrew.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]