public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/97812] New: Wrong output when compiling the testcase with -O2 -flto
@ 2020-11-12 12:19 qiaopeixin at huawei dot com
  2020-11-12 12:23 ` [Bug lto/97812] " jakub at gcc dot gnu.org
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: qiaopeixin at huawei dot com @ 2020-11-12 12:19 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 97812
           Summary: Wrong output when compiling the testcase with -O2
                    -flto
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: qiaopeixin at huawei dot com
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

Hi, gcc-trunk outputs wrong result when compiling the following testcase with
-O2 -flto:

#include<stdio.h>
short a;
volatile short b = 4066;
char c;
int main() {
  unsigned d = b & 2305;
  signed char e = d;
  c = e ? : e;
  if (d) {
    printf("%d\n", a);
  }
}

$gcc -O0 -w test.c && ./a.out
0

$gcc -O2 -flto -w test.c && ./a.out
(nothing)

gcc version 11.0.0 20201111 (experimental) (GCC)

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

end of thread, other threads:[~2020-12-02 12:27 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-12 12:19 [Bug lto/97812] New: Wrong output when compiling the testcase with -O2 -flto qiaopeixin at huawei dot com
2020-11-12 12:23 ` [Bug lto/97812] " jakub at gcc dot gnu.org
2020-11-12 12:24 ` marxin at gcc dot gnu.org
2020-11-12 13:12 ` qiaopeixin at huawei dot com
2020-11-12 13:16 ` qiaopeixin at huawei dot com
2020-11-12 13:24 ` jakub at gcc dot gnu.org
2020-11-12 13:35 ` marxin at gcc dot gnu.org
2020-11-12 13:55 ` marxin at gcc dot gnu.org
2020-11-13  8:53 ` [Bug lto/97812] [9/10/11 Regression] Wrong output when compiling the testcase with -O2 -flto since r9-4558-g476a31b55b5471262 marxin at gcc dot gnu.org
2020-11-13 10:15 ` rguenth at gcc dot gnu.org
2020-11-13 10:27 ` rguenth at gcc dot gnu.org
2020-11-13 10:38 ` [Bug tree-optimization/97812] " rguenth at gcc dot gnu.org
2020-11-13 11:25 ` cvs-commit at gcc dot gnu.org
2020-11-13 11:25 ` [Bug tree-optimization/97812] [9/10 " rguenth at gcc dot gnu.org
2020-12-01 15:44 ` cvs-commit at gcc dot gnu.org
2020-12-02 12:21 ` [Bug tree-optimization/97812] [9 " cvs-commit at gcc dot gnu.org
2020-12-02 12:27 ` rguenth 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).