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] Document arithmetic overflow semantics


    At the GCC internal level there should be no such thing as undefined
    behaviour, this is a front-end concept.  

I disagree.  As I said, it's quite valuable to be able to know that we
don't care, for optimization purposes, if an overflow has or has
not occurred.

    As for trap on overflow, that is currently supported and honored in
    the middle-end, by flag_trapv and flag_non_call_exceptions.

I'm talking about *per expression*.

    You may have noticed that my original patch, was a simple
    documentation patch that just described what GCC currently does, and
    what is assumed at several points in the code.

Nope.  Lots of places in the optimizer assume that overflow signed
integers are undefined.  Your proposed documentation doesn't mention that.


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