public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/105189] New: [9/10/11/12 Regression] Wrong code with -O1
@ 2022-04-06 18:50 vsevolod.livinskiy at gmail dot com
  2022-04-06 19:09 ` [Bug tree-optimization/105189] " jakub at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: vsevolod.livinskiy at gmail dot com @ 2022-04-06 18:50 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105189
           Summary: [9/10/11/12 Regression] Wrong code with -O1
           Product: gcc
           Version: 12.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://gcc.godbolt.org/z/zGn1a49KT

Reproducer:
#include <stdio.h>

int var_16 = -1;

int a(int b) { return b; }

int main() {
    int c = (unsigned int)a(var_16) >= 0 && 4;
    printf("%d\n", c);
    if (c != 1)
        __builtin_abort();
}

Error:
>$ g++ -O1 driver.cpp && ./a.out 
0
>$ g++ -O0 driver.cpp && ./a.out 
1

gcc version 12.0.1 20220406 (git://gcc.gnu.org/git/gcc.git:master
9fd377a747375a82912bd81c67b275301489785c)

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

end of thread, other threads:[~2022-05-11  6:36 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-06 18:50 [Bug tree-optimization/105189] New: [9/10/11/12 Regression] Wrong code with -O1 vsevolod.livinskiy at gmail dot com
2022-04-06 19:09 ` [Bug tree-optimization/105189] " jakub at gcc dot gnu.org
2022-04-06 21:35 ` davidfromonline at gmail dot com
2022-04-07  9:03 ` jakub at gcc dot gnu.org
2022-04-07  9:44 ` jakub at gcc dot gnu.org
2022-04-08  7:16 ` cvs-commit at gcc dot gnu.org
2022-04-08  8:10 ` [Bug tree-optimization/105189] [9/10/11 " jakub at gcc dot gnu.org
2022-04-13  4:28 ` cvs-commit at gcc dot gnu.org
2022-04-13  5:59 ` [Bug tree-optimization/105189] [9/10 " jakub at gcc dot gnu.org
2022-05-10  8:26 ` cvs-commit at gcc dot gnu.org
2022-05-11  6:26 ` cvs-commit at gcc dot gnu.org
2022-05-11  6:36 ` 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).