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]

[Bug c/56956] ftrapv traps on valid abs-like code


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56956

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
Yeah, unfortunately that doesn't look correct :(

I've always wanted to have an ABS_EXPR variant that returns an unsigned value
(so with no undefined behavior).  Maybe just overload ABS_EXPR in this way.
You'd need to assure expansion doesn't use absv optabs, that is, trapping
behavior / undefinedness would depend on the ABS_EXPR result type.  The
argument type would still be signed.


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