public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/97980] New: wrong code with "-O3 -fno-dce -fno-inline-functions-called-once -fno-inline-small-functions -fno-tree-ccp -fno-tree-dce -fno-tree-vrp"
@ 2020-11-25 7:46 suochenyao at 163 dot com
2020-11-25 8:00 ` [Bug tree-optimization/97980] " pinskia at gcc dot gnu.org
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: suochenyao at 163 dot com @ 2020-11-25 7:46 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97980
Bug ID: 97980
Summary: wrong code with "-O3 -fno-dce
-fno-inline-functions-called-once
-fno-inline-small-functions -fno-tree-ccp
-fno-tree-dce -fno-tree-vrp"
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
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:
int a=2;
static int b(int *c) { (0 >= *c) & (a--); return 0; }
int main() {
int d=0;
b(&d);
}
*******************************************************************************
gcc version:
$ gcc -v
Using built-in specs.
COLLECT_GCC=/home/suocy/bin/gcc-dev/bin/gcc
COLLECT_LTO_WRAPPER=/home/suocy/bin/gcc-dev/libexec/gcc/x86_64-pc-linux-gnu/11.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure --prefix=/home/suocy/bin/gcc-dev/
--disable-multilib --enable-languages=c,c++
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.0.0 20201124 (experimental) (GCC)
*******************************************************************************
Command Lines:
$ gcc -Wall -Wextra -fno-strict-aliasing -fwrapv -O3 -fno-dce
-fno-inline-functions-called-once -fno-inline-small-functions -fno-tree-ccp
-fno-tree-dce -fno-tree-vrp a.c
a.c: In function ‘b’:
a.c:2:34: warning: value computed is not used [-Wunused-value]
2 | static int b(int *c) { (0 >= *c) & (a--); return 0; }
| ~~~~~~~~~~^~~~~~~
a.c: In function ‘b.constprop.isra’:
a.c:2:30: warning: ‘c’ is used uninitialized [-Wuninitialized]
2 | static int b(int *c) { (0 >= *c) & (a--); return 0; }
| ^~
$ ./a.out
Segmentation fault
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug tree-optimization/97980] wrong code with "-O3 -fno-dce -fno-inline-functions-called-once -fno-inline-small-functions -fno-tree-ccp -fno-tree-dce -fno-tree-vrp"
2020-11-25 7:46 [Bug c/97980] New: wrong code with "-O3 -fno-dce -fno-inline-functions-called-once -fno-inline-small-functions -fno-tree-ccp -fno-tree-dce -fno-tree-vrp" suochenyao at 163 dot com
@ 2020-11-25 8:00 ` pinskia at gcc dot gnu.org
2020-11-25 8:18 ` [Bug tree-optimization/97980] wrong code with "-O3 -fno-dce -fno-inline-functions-called-once -fno-inline-small-functions -fno-tree-ccp -fno-tree-dce -fno-tree-vrp" since r10-3311-gff6686d2e5f797d6 marxin at gcc dot gnu.org
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2020-11-25 8:00 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97980
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |wrong-code
Component|c |tree-optimization
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I think it is due to -fno-tree-dce .
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug tree-optimization/97980] wrong code with "-O3 -fno-dce -fno-inline-functions-called-once -fno-inline-small-functions -fno-tree-ccp -fno-tree-dce -fno-tree-vrp" since r10-3311-gff6686d2e5f797d6
2020-11-25 7:46 [Bug c/97980] New: wrong code with "-O3 -fno-dce -fno-inline-functions-called-once -fno-inline-small-functions -fno-tree-ccp -fno-tree-dce -fno-tree-vrp" suochenyao at 163 dot com
2020-11-25 8:00 ` [Bug tree-optimization/97980] " pinskia at gcc dot gnu.org
@ 2020-11-25 8:18 ` marxin at gcc dot gnu.org
2020-11-25 8:38 ` [Bug tree-optimization/97980] [10/11 Regression] " rguenth at gcc dot gnu.org
2020-11-26 12:01 ` jamborm at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-11-25 8:18 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97980
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to fail| |10.2.0, 11.0
Known to work| |9.3.0
Last reconfirmed| |2020-11-25
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
Target Milestone|--- |10.3
CC| |jamborm at gcc dot gnu.org,
| |marxin at gcc dot gnu.org
Summary|wrong code with "-O3 |wrong code with "-O3
|-fno-dce |-fno-dce
|-fno-inline-functions-calle |-fno-inline-functions-calle
|d-once |d-once
|-fno-inline-small-functions |-fno-inline-small-functions
|-fno-tree-ccp -fno-tree-dce |-fno-tree-ccp -fno-tree-dce
|-fno-tree-vrp" |-fno-tree-vrp" since
| |r10-3311-gff6686d2e5f797d6
--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r10-3311-gff6686d2e5f797d6.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug tree-optimization/97980] [10/11 Regression] wrong code with "-O3 -fno-dce -fno-inline-functions-called-once -fno-inline-small-functions -fno-tree-ccp -fno-tree-dce -fno-tree-vrp" since r10-3311-gff6686d2e5f797d6
2020-11-25 7:46 [Bug c/97980] New: wrong code with "-O3 -fno-dce -fno-inline-functions-called-once -fno-inline-small-functions -fno-tree-ccp -fno-tree-dce -fno-tree-vrp" suochenyao at 163 dot com
2020-11-25 8:00 ` [Bug tree-optimization/97980] " pinskia at gcc dot gnu.org
2020-11-25 8:18 ` [Bug tree-optimization/97980] wrong code with "-O3 -fno-dce -fno-inline-functions-called-once -fno-inline-small-functions -fno-tree-ccp -fno-tree-dce -fno-tree-vrp" since r10-3311-gff6686d2e5f797d6 marxin at gcc dot gnu.org
@ 2020-11-25 8:38 ` rguenth at gcc dot gnu.org
2020-11-26 12:01 ` jamborm at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-11-25 8:38 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97980
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|wrong code with "-O3 |[10/11 Regression] wrong
|-fno-dce |code with "-O3 -fno-dce
|-fno-inline-functions-calle |-fno-inline-functions-calle
|d-once |d-once
|-fno-inline-small-functions |-fno-inline-small-functions
|-fno-tree-ccp -fno-tree-dce |-fno-tree-ccp -fno-tree-dce
|-fno-tree-vrp" since |-fno-tree-vrp" since
|r10-3311-gff6686d2e5f797d6 |r10-3311-gff6686d2e5f797d6
Priority|P3 |P2
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug tree-optimization/97980] [10/11 Regression] wrong code with "-O3 -fno-dce -fno-inline-functions-called-once -fno-inline-small-functions -fno-tree-ccp -fno-tree-dce -fno-tree-vrp" since r10-3311-gff6686d2e5f797d6
2020-11-25 7:46 [Bug c/97980] New: wrong code with "-O3 -fno-dce -fno-inline-functions-called-once -fno-inline-small-functions -fno-tree-ccp -fno-tree-dce -fno-tree-vrp" suochenyao at 163 dot com
` (2 preceding siblings ...)
2020-11-25 8:38 ` [Bug tree-optimization/97980] [10/11 Regression] " rguenth at gcc dot gnu.org
@ 2020-11-26 12:01 ` jamborm at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: jamborm at gcc dot gnu.org @ 2020-11-26 12:01 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97980
Martin Jambor <jamborm at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |DUPLICATE
--- Comment #3 from Martin Jambor <jamborm at gcc dot gnu.org> ---
This is quite clearly a duplicate of PR 93385 (IPA-SRA relies on DCE). Let me
try again to come up with a more acceptable patch to fix it.
*** This bug has been marked as a duplicate of bug 93385 ***
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-11-26 12:01 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-25 7:46 [Bug c/97980] New: wrong code with "-O3 -fno-dce -fno-inline-functions-called-once -fno-inline-small-functions -fno-tree-ccp -fno-tree-dce -fno-tree-vrp" suochenyao at 163 dot com
2020-11-25 8:00 ` [Bug tree-optimization/97980] " pinskia at gcc dot gnu.org
2020-11-25 8:18 ` [Bug tree-optimization/97980] wrong code with "-O3 -fno-dce -fno-inline-functions-called-once -fno-inline-small-functions -fno-tree-ccp -fno-tree-dce -fno-tree-vrp" since r10-3311-gff6686d2e5f797d6 marxin at gcc dot gnu.org
2020-11-25 8:38 ` [Bug tree-optimization/97980] [10/11 Regression] " rguenth at gcc dot gnu.org
2020-11-26 12:01 ` jamborm 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).