This is the mail archive of the gcc-bugs@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: gcc 4.0.0 on amd64: problem with -O2?



On May 8, 2005, at 2:21 AM, Harald Dunkel wrote:


Andrew Pinski wrote:

Wrong, try again. Violating aliasing rules cause undefined behavior so seg faulting is an okay thing to do.

But producing a warning message and bad code is not OK. Either using a "type-punned pointer" should be treated as a fatal error, because gcc would create bad code, or gcc should create working code.

If gcc knows that the code is bad, why does it continue?

Undefined code is required to compile. There is a C defect report about undefined and erroring out. The code is undefined at runtime and not at compile time.

So GCC is not producing bad code at all, your code/X11R6's code is bad.

-- Pinski


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