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: Possible bug in optimization


"Chris Croswhite" <ccroswhite@get2chip.com> writes:

> How is this casting & masking undefined in O but -g works OKAY?
> Also, why does 2.95.x treat this as expected?  Also, Sun, HP and
> Intel compilers treat this as expected?  What am I not understanding
> about c/c++ standard?

It's always undefined.  Undefined behavior means the C standard does
not define the behavior, which means C compilers are free to do
whatever they like with it.  They are allowed to produce the behavior
that you expected; they are also allowed to produce behavior that you
did not expect.

zw


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