public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/108256] New: Missing integer overflow instrumentation when assignment LHS is narrow
@ 2022-12-31 15:12 amonakov at gcc dot gnu.org
  2023-01-03  9:48 ` [Bug sanitizer/108256] " jakub at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: amonakov at gcc dot gnu.org @ 2022-12-31 15:12 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 108256
           Summary: Missing integer overflow instrumentation when
                    assignment LHS is narrow
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: amonakov at gcc dot gnu.org
  Target Milestone: ---

For

unsigned short f(unsigned short x, unsigned short y)
{
    return x * y;
}

unsigned short g(unsigned short x, unsigned short y)
{
    int r = x * y;
    return r;
}

gcc -O2 -fsanitize=undefined emits instrumentation only for 'g', although both
are equivalent. When 'int r' is changed to 'unsigned short r', 'g' is also not
instrumented.

PR 107912 shows a slightly more complicated variant of this. Affects both C and
C++.

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

end of thread, other threads:[~2024-06-03  9:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-31 15:12 [Bug middle-end/108256] New: Missing integer overflow instrumentation when assignment LHS is narrow amonakov at gcc dot gnu.org
2023-01-03  9:48 ` [Bug sanitizer/108256] " jakub at gcc dot gnu.org
2023-01-04  9:53 ` cvs-commit at gcc dot gnu.org
2023-01-04  9:55 ` jakub at gcc dot gnu.org
2024-02-01 10:01 ` pinskia at gcc dot gnu.org
2024-02-01 10:02 ` pinskia at gcc dot gnu.org
2024-03-10  3:35 ` pinskia at gcc dot gnu.org
2024-05-19  7:18 ` pinskia at gcc dot gnu.org
2024-06-03  9:13 ` pinskia 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).