This is the mail archive of the gcc-patches@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: PATCH RFC: -fstrict-overflow


Ian Lance Taylor wrote on 01/24/07 12:29:

Basically, -fwrapv extends the language standard to say "signed
integers wrap."  -fno-strict-overflow does not change the language
standard--signed overflow remains undefined--but the compiler does not
take advantage of that fact.

In particular, with -fno-strict-overflow, the compiler does not change
code which might overflow into code which will not overflow.  With
-fwrapv, the compiler permits overflow when folding constants.

Sorry, I'm dense today. My suggestion is along the lines of: Since -fwrapv allows integers to wrap, the compiler should not take advantage of the fact there was overflow.

That was sort of the mindset I had when doing the -fwrapv checking in VRP initially. I'm not good with language lawyering, so that's probably why I can't find a great difference between -fwrapv and -fstrict-overflow. Don't let me stand in the way, though. If the consensus is that the -fstrict-overflow flag improves things, I'll go with that.


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