This is the mail archive of the gcc-help@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: shift+test optimization error


On 19 January 2017 at 14:02, Bob Rorschach wrote:
> My mistake was that I didn't realize the sweeping effect of
> an undefined operation. I knew the shift was suspect; I thought
> that just meant the result of that operation could be anything.

That would be the case if the result a left shift by too many bits was
"unspecified".

But "undefined" means there are no requirements imposed whatsoever.
The program could fail to compile, run with the results you expect,
set fire to your hair, or anything else.


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