[Bug tree-optimization/78725] [7 Regression] wrong code at -O3 on x86_64-linux-gnu (in both 32-bit and 64-bit modes)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78725 Richard Biener changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|--- |FIXED --- Comment #7 from Richard Biener --- Fixed.
[Bug tree-optimization/78725] [7 Regression] wrong code at -O3 on x86_64-linux-gnu (in both 32-bit and 64-bit modes)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78725 --- Comment #6 from Michael Matz --- Author: matz Date: Tue Dec 13 14:14:41 2016 New Revision: 243606 URL: https://gcc.gnu.org/viewcvs?rev=243606=gcc=rev Log: Fix pr78725 PR tree-optimization/78725 * tree-ssa-loop-split.c (split_at_bb_p): Check for overflow and at correct use point. testsuite/ PR tree-optimization/78725 * gcc.dg/pr78725.c: New test. * gcc.dg/pr78725-2.c: New test. Added: trunk/gcc/testsuite/gcc.dg/pr78725-2.c trunk/gcc/testsuite/gcc.dg/pr78725.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-ssa-loop-split.c
[Bug tree-optimization/78725] [7 Regression] wrong code at -O3 on x86_64-linux-gnu (in both 32-bit and 64-bit modes)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78725 --- Comment #5 from Michael Matz --- (In reply to Michael Matz from comment #4) > Thanks for the second testcase as well. It's not quite the same > miscompilation > (the induction vars don't overflow), but a related one (the value of d > considered in the conditional statement is the final one after the d-loop > finishes, not the value at the use itself). Fixed with v2 of the patch, > at https://gcc.gnu.org/ml/gcc-patches/2016-12/msg01035.html . (Btw: nice testcases, I assume they are generated somehow by a code generator that knows a bit about semantics?)
[Bug tree-optimization/78725] [7 Regression] wrong code at -O3 on x86_64-linux-gnu (in both 32-bit and 64-bit modes)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78725 --- Comment #4 from Michael Matz --- Thanks for the second testcase as well. It's not quite the same miscompilation (the induction vars don't overflow), but a related one (the value of d considered in the conditional statement is the final one after the d-loop finishes, not the value at the use itself). Fixed with v2 of the patch, at https://gcc.gnu.org/ml/gcc-patches/2016-12/msg01035.html .
[Bug tree-optimization/78725] [7 Regression] wrong code at -O3 on x86_64-linux-gnu (in both 32-bit and 64-bit modes)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78725 --- Comment #3 from Zhendong Su --- Below is another test that might trigger the same miscompilation: $ gcc-trunk -O2 -fsplit-loops small.c; ./a.out Aborted (core dumped) $ $ gcc-trunk -O3 -fno-split-loops small.c; ./a.out $ $ gcc-trunk -O3 small.c; ./a.out Aborted (core dumped) $ $ cat small.c int a, b, c; int main () { int d; for (; c < 1; c++) for (d = 0; d < 3; d++) for (b = 0; b < 1; b++) if (c >= d) a = 1; if (a != 1) __builtin_abort (); return 0; } $ $ gcc-trunk -v Using built-in specs. COLLECT_GCC=gcc-trunk COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto --prefix=/usr/local/gcc-trunk --disable-bootstrap Thread model: posix gcc version 7.0.0 20161211 (experimental) [trunk revision 243523] (GCC) $
[Bug tree-optimization/78725] [7 Regression] wrong code at -O3 on x86_64-linux-gnu (in both 32-bit and 64-bit modes)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78725 Marek Polacek changed: What|Removed |Added Status|NEW |ASSIGNED
[Bug tree-optimization/78725] [7 Regression] wrong code at -O3 on x86_64-linux-gnu (in both 32-bit and 64-bit modes)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78725 Michael Matz changed: What|Removed |Added Assignee|unassigned at gcc dot gnu.org |matz at gcc dot gnu.org --- Comment #2 from Michael Matz --- Mine.
[Bug tree-optimization/78725] [7 Regression] wrong code at -O3 on x86_64-linux-gnu (in both 32-bit and 64-bit modes)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78725 Richard Biener changed: What|Removed |Added Priority|P3 |P1 Version|unknown |7.0
[Bug tree-optimization/78725] [7 Regression] wrong code at -O3 on x86_64-linux-gnu (in both 32-bit and 64-bit modes)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78725 Marek Polacek changed: What|Removed |Added Keywords||wrong-code Target Milestone|--- |7.0 Summary|wrong code at -O3 on|[7 Regression] wrong code |x86_64-linux-gnu (in both |at -O3 on x86_64-linux-gnu |32-bit and 64-bit modes)|(in both 32-bit and 64-bit ||modes)