public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug sanitizer/115899] New: [14 Regression] Misaligned address check missing
@ 2024-07-12 19:19 bic60176 at gmail dot com
  2024-07-12 19:21 ` [Bug sanitizer/115899] " bic60176 at gmail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: bic60176 at gmail dot com @ 2024-07-12 19:19 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 115899
           Summary: [14 Regression] Misaligned address check missing
           Product: gcc
           Version: 14.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bic60176 at gmail dot com
                CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
                    jakub at gcc dot gnu.org, kcc at gcc dot gnu.org
  Target Milestone: ---

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

* [Bug sanitizer/115899] [14 Regression] Misaligned address check missing
  2024-07-12 19:19 [Bug sanitizer/115899] New: [14 Regression] Misaligned address check missing bic60176 at gmail dot com
@ 2024-07-12 19:21 ` bic60176 at gmail dot com
  2024-07-12 19:22 ` bic60176 at gmail dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: bic60176 at gmail dot com @ 2024-07-12 19:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Bi6c <bic60176 at gmail dot com> ---
Created attachment 58643
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58643&action=edit
testcase

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

* [Bug sanitizer/115899] [14 Regression] Misaligned address check missing
  2024-07-12 19:19 [Bug sanitizer/115899] New: [14 Regression] Misaligned address check missing bic60176 at gmail dot com
  2024-07-12 19:21 ` [Bug sanitizer/115899] " bic60176 at gmail dot com
@ 2024-07-12 19:22 ` bic60176 at gmail dot com
  2024-07-12 19:34 ` [Bug sanitizer/115899] Signed integer overflow check is not done if on left side comma operator and unused pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: bic60176 at gmail dot com @ 2024-07-12 19:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Bi6c <bic60176 at gmail dot com> ---
OS: Ubuntu 22.04.3 LTS
We found that GCC failed to detect a signed integer overflow error in
gcc-14.1.0 at optimization level 0.

$ ~/compiler-builds/gcc-13.2.0_build/bin/gcc -fsanitize=undefined -g -lgcc_s -w
-O0 testcase.c -o exec
$ timeout 2s ./exec 2>exec.err
-2
$ cat exec.err
testcase.c:20:64: runtime error: signed integer overflow: 61952 * 61952 cannot
be represented in type 'int'
$ ~/compiler-builds/gcc-14.1.0_build/bin/gcc -fsanitize=undefined -g -lgcc_s -w
-O0 testcase.c -o exec
$ timeout 2s ./exec 2>exec.err
-2
$ cat exec.err
$

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

* [Bug sanitizer/115899] Signed integer overflow check is not done if on left side comma operator and unused
  2024-07-12 19:19 [Bug sanitizer/115899] New: [14 Regression] Misaligned address check missing bic60176 at gmail dot com
  2024-07-12 19:21 ` [Bug sanitizer/115899] " bic60176 at gmail dot com
  2024-07-12 19:22 ` bic60176 at gmail dot com
@ 2024-07-12 19:34 ` pinskia at gcc dot gnu.org
  2024-07-17  3:46 ` xry111 at gcc dot gnu.org
  2024-07-17  3:47 ` xry111 at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-07-12 19:34 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[14 Regression] Misaligned  |Signed integer overflow
                   |address check missing       |check is not done if on
                   |                            |left side comma operator
                   |                            |and unused

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Reduced testcase:
```
int16_t  func_1(void)
{ 
    int32_t l_4 = 0x9351F200;
    int t = (((uint16_t)l_4 * (uint16_t)l_4) == 123), 1 ;
    return t;
}
```

First off GCC never produced an overflow check here; which I think is correct
as left hand side of the comma operator has no side effects otherwise. Yes
there is undefined behavior in that multiply with respect to an overflow but I
am not sure GCC needs to report it ...

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

* [Bug sanitizer/115899] Signed integer overflow check is not done if on left side comma operator and unused
  2024-07-12 19:19 [Bug sanitizer/115899] New: [14 Regression] Misaligned address check missing bic60176 at gmail dot com
                   ` (2 preceding siblings ...)
  2024-07-12 19:34 ` [Bug sanitizer/115899] Signed integer overflow check is not done if on left side comma operator and unused pinskia at gcc dot gnu.org
@ 2024-07-17  3:46 ` xry111 at gcc dot gnu.org
  2024-07-17  3:47 ` xry111 at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: xry111 at gcc dot gnu.org @ 2024-07-17  3:46 UTC (permalink / raw)
  To: gcc-bugs

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

Xi Ruoyao <xry111 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=115225
                 CC|                            |xry111 at gcc dot gnu.org
         Resolution|---                         |INVALID

--- Comment #4 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
Per PR115225 we have a consensus that the sanitizers do not care dead code.

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

* [Bug sanitizer/115899] Signed integer overflow check is not done if on left side comma operator and unused
  2024-07-12 19:19 [Bug sanitizer/115899] New: [14 Regression] Misaligned address check missing bic60176 at gmail dot com
                   ` (3 preceding siblings ...)
  2024-07-17  3:46 ` xry111 at gcc dot gnu.org
@ 2024-07-17  3:47 ` xry111 at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: xry111 at gcc dot gnu.org @ 2024-07-17  3:47 UTC (permalink / raw)
  To: gcc-bugs

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

Xi Ruoyao <xry111 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|INVALID                     |WONTFIX

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

end of thread, other threads:[~2024-07-17  3:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-12 19:19 [Bug sanitizer/115899] New: [14 Regression] Misaligned address check missing bic60176 at gmail dot com
2024-07-12 19:21 ` [Bug sanitizer/115899] " bic60176 at gmail dot com
2024-07-12 19:22 ` bic60176 at gmail dot com
2024-07-12 19:34 ` [Bug sanitizer/115899] Signed integer overflow check is not done if on left side comma operator and unused pinskia at gcc dot gnu.org
2024-07-17  3:46 ` xry111 at gcc dot gnu.org
2024-07-17  3:47 ` xry111 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).