public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/110954] New: [14 Regression] Wrong code with -O0
@ 2023-08-09  0:34 vsevolod.livinskiy at gmail dot com
  2023-08-09  0:39 ` [Bug tree-optimization/110954] " pinskia at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: vsevolod.livinskiy at gmail dot com @ 2023-08-09  0:34 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110954
           Summary: [14 Regression] Wrong code with -O0
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vsevolod.livinskiy at gmail dot com
  Target Milestone: ---

Link to the compiler explorer:
https://godbolt.org/z/WYoT4hW9v

Reproducer:
#include <stdio.h>
unsigned long long a;
void b(unsigned long long *c, int g) { *c = g; }
int d, e = -38921963;
long f;
int main() {
  d = (-1807546494482798067UL - f < (6033086967267 > 0)) & e |
      !(-1807546494482798067UL - f < (6033086967267 > 0));
  b(&a, d);
  printf("%llu\n", a);
  if (a != 1)
    __builtin_abort();
}

Error:
>$ g++ -O0 test.cpp && ./a.out 
18446744073670629653
Aborted (core dumped)
>$ /usr/bin/g++-11 -O0 test.cpp && ./a.out 
1

gcc version 14.0.0 20230808 (20659be04c2749f9f47b085f1789eee0d145fb36)

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

end of thread, other threads:[~2023-08-15  0:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-09  0:34 [Bug tree-optimization/110954] New: [14 Regression] Wrong code with -O0 vsevolod.livinskiy at gmail dot com
2023-08-09  0:39 ` [Bug tree-optimization/110954] " pinskia at gcc dot gnu.org
2023-08-09  0:44 ` [Bug middle-end/110954] " pinskia at gcc dot gnu.org
2023-08-09 19:39 ` pinskia at gcc dot gnu.org
2023-08-10  0:21 ` pinskia at gcc dot gnu.org
2023-08-10 18:41 ` pinskia at gcc dot gnu.org
2023-08-11  6:51 ` cvs-commit at gcc dot gnu.org
2023-08-13 17:50 ` pinskia at gcc dot gnu.org
2023-08-15  0:11 ` 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).