bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GCC optimizes integer overflow: bug or feature?


From: Matthew Woehlke
Subject: Re: GCC optimizes integer overflow: bug or feature?
Date: Wed, 20 Dec 2006 17:06:52 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.8) Gecko/20061025 Thunderbird/1.5.0.8 Mnenhy/0.7.4.0

Andreas Schwab wrote:
Matthew Woehlke <address@hidden> writes:

That said, I've seen even stranger things, too. For example:

foo->bar = make_a_bar();
foo->bar->none = value;

being rendered as:

call make_a_bar
foo->bar->none = value
foo->bar = <result of make_a_bar()>

You are not describing a C compiler.

Um, I'm describing what gcc did? I gave C code first (names changed, but almost exactly what I was doing), then described the assembly that was emitted. The resulting assembly called the function that is supposed to provide the value of 'foo->bar', and then dereferenced members of foo->bar /before/ assigning the return value to foo->bar. Trust me, I looked at the assembly, and that's what it was doing.

--
Matthew
Hi! I'm a .signature virus! Copy me into your ~/.signature, please!





reply via email to

[Prev in Thread] Current Thread [Next in Thread]