public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/95810] New: Spurious UBSan warning when computing the opposite of the absolute value of INT_MIN
@ 2020-06-22  7:52 felix.von.s at posteo dot de
  2020-06-22  8:51 ` [Bug middle-end/95810] " pinskia at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: felix.von.s at posteo dot de @ 2020-06-22  7:52 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95810
           Summary: Spurious UBSan warning when computing the opposite of
                    the absolute value of INT_MIN
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: felix.von.s at posteo dot de
  Target Milestone: ---

When the expression (x <= 0 ? x : -x) with x having type int is compiled with
-fsanitize=undefined -O3, setting (x = INT_MIN) triggers a spurious UBSan
warning about INT_MIN being negated.

Not sure if I should file this against tree-ssa or the frontend(s), because the
expression apparently becomes (-ABS_EXPR <x>) very early, even at -O0. I
checked this with C, C++ and D frontends.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-05-14 14:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-22  7:52 [Bug tree-optimization/95810] New: Spurious UBSan warning when computing the opposite of the absolute value of INT_MIN felix.von.s at posteo dot de
2020-06-22  8:51 ` [Bug middle-end/95810] " pinskia at gcc dot gnu.org
2020-06-22  9:36 ` jakub at gcc dot gnu.org
2020-06-22  9:53 ` jakub at gcc dot gnu.org
2020-06-24  8:41 ` cvs-commit at gcc dot gnu.org
2020-09-16 19:22 ` cvs-commit at gcc dot gnu.org
2021-04-28 17:56 ` [Bug middle-end/95810] [8 only] " pinskia at gcc dot gnu.org
2021-05-14 14:02 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).