public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/108308] New: wrong code at -Os and -O2 with "-fno-tree-ccp" on x86_64-linux-gnu
@ 2023-01-05 23:28 zhendong.su at inf dot ethz.ch
2023-01-06 6:29 ` [Bug tree-optimization/108308] [13 Regression] " pinskia at gcc dot gnu.org
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: zhendong.su at inf dot ethz.ch @ 2023-01-05 23:28 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108308
Bug ID: 108308
Summary: wrong code at -Os and -O2 with "-fno-tree-ccp" on
x86_64-linux-gnu
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: zhendong.su at inf dot ethz.ch
Target Milestone: ---
This appears to be a recent regression as it does not reproduce with 12.2.
Compiler Explorer: https://godbolt.org/z/h1hfa44We
[650] % gcctk -v
Using built-in specs.
COLLECT_GCC=gcctk
COLLECT_LTO_WRAPPER=/local/suz-local/software/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/13.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --disable-bootstrap
--enable-checking=yes --prefix=/local/suz-local/software/local/gcc-trunk
--enable-sanitizers --enable-languages=c,c++ --disable-werror --enable-multilib
--with-system-zlib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 13.0.0 20230105 (experimental) [master r13-5035-g4413365616e] (GCC)
[651] %
[651] % gcctk -Os small.c; ./a.out
[652] %
[652] % gcctk -Os -fno-tree-ccp small.c
[653] % ./a.out
Floating point exception
[654] %
[654] % cat small.c
int a = 1, *d = &a, f = 2766708631, h;
unsigned b = -1, c, e, g;
static void i(int j) {
if (a) {
c = ~c;
while (e)
j = 0;
goto k;
}
l:
h = 1;
k:
*d = (!j) | 80;
int m = ~(~(-1 / b) | (a ^ 1)), n = ~(~g / (11 >> m)), o = -1 / n;
if (f) {
b = 9518150474215344 ^ ~f;
f = 0;
if (c)
goto l;
if (o)
goto k;
}
}
int main() {
i(1);
return 0;
}
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug tree-optimization/108308] [13 Regression] wrong code at -Os and -O2 with "-fno-tree-ccp" on x86_64-linux-gnu
2023-01-05 23:28 [Bug tree-optimization/108308] New: wrong code at -Os and -O2 with "-fno-tree-ccp" on x86_64-linux-gnu zhendong.su at inf dot ethz.ch
@ 2023-01-06 6:29 ` pinskia at gcc dot gnu.org
2023-01-06 9:37 ` jakub at gcc dot gnu.org
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-01-06 6:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108308
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Version|unknown |13.0
Summary|wrong code at -Os and -O2 |[13 Regression] wrong code
|with "-fno-tree-ccp" on |at -Os and -O2 with
|x86_64-linux-gnu |"-fno-tree-ccp" on
| |x86_64-linux-gnu
Target Milestone|--- |13.0
Keywords| |wrong-code
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug tree-optimization/108308] [13 Regression] wrong code at -Os and -O2 with "-fno-tree-ccp" on x86_64-linux-gnu
2023-01-05 23:28 [Bug tree-optimization/108308] New: wrong code at -Os and -O2 with "-fno-tree-ccp" on x86_64-linux-gnu zhendong.su at inf dot ethz.ch
2023-01-06 6:29 ` [Bug tree-optimization/108308] [13 Regression] " pinskia at gcc dot gnu.org
@ 2023-01-06 9:37 ` jakub at gcc dot gnu.org
2023-01-06 9:54 ` [Bug target/108308] " cvs-commit at gcc dot gnu.org
2023-01-11 12:08 ` cvs-commit at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-01-06 9:37 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108308
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
Resolution|--- |DUPLICATE
Keywords|needs-bisection |
Status|UNCONFIRMED |RESOLVED
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r13-4977-gd0558f420b2a5692fd38ac76ffa97ae6c1726ed9
and got fixed with r13-5038-g9e6ac747ac5cff9e3f58421cdd9f03538e48ed07
So dup of PR108292.
*** This bug has been marked as a duplicate of bug 108292 ***
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug target/108308] [13 Regression] wrong code at -Os and -O2 with "-fno-tree-ccp" on x86_64-linux-gnu
2023-01-05 23:28 [Bug tree-optimization/108308] New: wrong code at -Os and -O2 with "-fno-tree-ccp" on x86_64-linux-gnu zhendong.su at inf dot ethz.ch
2023-01-06 6:29 ` [Bug tree-optimization/108308] [13 Regression] " pinskia at gcc dot gnu.org
2023-01-06 9:37 ` jakub at gcc dot gnu.org
@ 2023-01-06 9:54 ` cvs-commit at gcc dot gnu.org
2023-01-11 12:08 ` cvs-commit at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-01-06 9:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108308
--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:b990e80e39b41ec028d018eac7d2d040a537b681
commit r13-5043-gb990e80e39b41ec028d018eac7d2d040a537b681
Author: Jakub Jelinek <jakub@redhat.com>
Date: Fri Jan 6 10:52:34 2023 +0100
testsuite: Add testcases from PR108292 and PR108308
These PRs were for now fixed by reversion of the r13-4977
patch, but so that the problems don't reappear during stage 1,
I'm adding testcase coverage from those PRs.
2023-01-06 Jakub Jelinek <jakub@redhat.com>
PR target/108292
PR target/108308
* gcc.c-torture/execute/pr108292.c: New test.
* gcc.target/i386/pr108292.c: New test.
* gcc.dg/pr108308.c: New test.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug target/108308] [13 Regression] wrong code at -Os and -O2 with "-fno-tree-ccp" on x86_64-linux-gnu
2023-01-05 23:28 [Bug tree-optimization/108308] New: wrong code at -Os and -O2 with "-fno-tree-ccp" on x86_64-linux-gnu zhendong.su at inf dot ethz.ch
` (2 preceding siblings ...)
2023-01-06 9:54 ` [Bug target/108308] " cvs-commit at gcc dot gnu.org
@ 2023-01-11 12:08 ` cvs-commit at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-01-11 12:08 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108308
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:b39c1bea5bae9aee1df25cab1064f983b9ec6941
commit r13-5105-gb39c1bea5bae9aee1df25cab1064f983b9ec6941
Author: Jakub Jelinek <jakub@redhat.com>
Date: Wed Jan 11 13:06:14 2023 +0100
testsuite: Enable pr108308.c test on all int32 targets [PR108308]
This test seems to rely on 32-bit int (and uses a wider constant
which shouldn't fit into int), I've initially enabled it on ilp32+lp64
target, but apparently it works on llp64 too, so I've changed it to
int32.
2023-01-11 Jakub Jelinek <jakub@redhat.com>
PR target/108308
* gcc.dg/pr108308.c: Use int32 target rather than { ilp32 || lp64
}.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-01-11 12:08 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-05 23:28 [Bug tree-optimization/108308] New: wrong code at -Os and -O2 with "-fno-tree-ccp" on x86_64-linux-gnu zhendong.su at inf dot ethz.ch
2023-01-06 6:29 ` [Bug tree-optimization/108308] [13 Regression] " pinskia at gcc dot gnu.org
2023-01-06 9:37 ` jakub at gcc dot gnu.org
2023-01-06 9:54 ` [Bug target/108308] " cvs-commit at gcc dot gnu.org
2023-01-11 12:08 ` cvs-commit 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).