public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/98117] New: wrong code with "-O3 -fno-tree-scev-cprop"
@ 2020-12-03 11:31 suochenyao at 163 dot com
  2020-12-03 11:51 ` [Bug tree-optimization/98117] [8/9/10/11 Regression] wrong code with "-O3 -fno-tree-scev-cprop" since r8-1163-g7078979b291419f3 marxin at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: suochenyao at 163 dot com @ 2020-12-03 11:31 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98117
           Summary: wrong code with "-O3 -fno-tree-scev-cprop"
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: suochenyao at 163 dot com
  Target Milestone: ---

*******************************************************************************
OS and Platform:
CentOS Linux release 7.8.2003 (Core), x86_64 GNU/Linux
*******************************************************************************
Program:
$ cat a.c
int printf(const char *, ...);
int a=0;
char b=0, c=0;
short d=0;
void e() {
  for (; b; b++)
    d = a + 8;
  for (; d;)
    ;
f:
  c++;
  if (c)
    goto f;
}
int main() {
  e();
  printf("%d\n", c);
}
*******************************************************************************
gcc version:
$ gcc --version
gcc (GCC) 11.0.0 20201203 (experimental)
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*******************************************************************************
Command Lines:
$ gcc a.c -o a1.o
$ gcc -Wall -Wextra -fno-strict-aliasing -fwrapv -O3 -fno-tree-scev-cprop  a.c
-o a2.o
$ ./a1.o
0
$ ./a2.o
-32

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

end of thread, other threads:[~2021-04-26 10:49 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-03 11:31 [Bug tree-optimization/98117] New: wrong code with "-O3 -fno-tree-scev-cprop" suochenyao at 163 dot com
2020-12-03 11:51 ` [Bug tree-optimization/98117] [8/9/10/11 Regression] wrong code with "-O3 -fno-tree-scev-cprop" since r8-1163-g7078979b291419f3 marxin at gcc dot gnu.org
2020-12-03 12:30 ` rguenth at gcc dot gnu.org
2020-12-07  8:39 ` rguenth at gcc dot gnu.org
2020-12-07  8:51 ` rguenth at gcc dot gnu.org
2020-12-07  9:27 ` rguenth at gcc dot gnu.org
2020-12-07 11:06 ` cvs-commit at gcc dot gnu.org
2020-12-07 11:06 ` [Bug tree-optimization/98117] [8/9/10 " rguenth at gcc dot gnu.org
2021-01-11 14:10 ` cvs-commit at gcc dot gnu.org
2021-03-17  9:35 ` [Bug tree-optimization/98117] [8/9 " cvs-commit at gcc dot gnu.org
2021-04-26 10:46 ` [Bug tree-optimization/98117] [8 " cvs-commit at gcc dot gnu.org
2021-04-26 10:49 ` 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).