[Bug c/116193] enhancement: type attribute that causes overflow for unsigned integer types to trap

2024-08-02 Thread muecker at gwdg dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116193 Martin Uecker changed: What|Removed |Added CC||muecker at gwdg dot de --- Comment #5 f

[Bug c/116193] enhancement: type attribute that causes overflow for unsigned integer types to trap

2024-08-02 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116193 --- Comment #4 from Richard Biener --- -y is OK when y == 0 I hope you are not suggesting that it's UB to overflow though. The attribute should make the frontend to lower operations according to semantics and leave everything in the middle-end

[Bug c/116193] enhancement: type attribute that causes overflow for unsigned integer types to trap

2024-08-02 Thread uecker at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116193 --- Comment #3 from uecker at gcc dot gnu.org --- It came up as a possibility in various discussions, including on the kernel mailing list or inside WG14. I personally use signed type if I want to detect overflow and unsigned only if I want m

[Bug c/116193] enhancement: type attribute that causes overflow for unsigned integer types to trap

2024-08-02 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116193 --- Comment #2 from Jakub Jelinek --- That opens the door of issues how you can actually subtract those things validly. Would x - y and x + (-y) then behave differently for it?

[Bug c/116193] enhancement: type attribute that causes overflow for unsigned integer types to trap

2024-08-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116193 Andrew Pinski changed: What|Removed |Added Last reconfirmed||2024-08-02 Status|UNCONFIRM

[Bug c/116193] enhancement: type attribute that causes overflow for unsigned integer types to trap

2024-08-02 Thread uecker at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116193 uecker at gcc dot gnu.org changed: What|Removed |Added Severity|normal |enhancement