[Bug tree-optimization/58223] [4.8/4.9 Regression] wrong code at -O3 on x86_64-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58223 --- Comment #6 from Richard Biener rguenth at gcc dot gnu.org --- Author: rguenth Date: Fri Aug 30 07:48:53 2013 New Revision: 202096 URL: http://gcc.gnu.org/viewcvs?rev=202096root=gccview=rev Log: 2013-08-30 Richard Biener rguent...@suse.de PR tree-optimization/58223 * tree-loop-distribution.c (has_anti_dependence): Rename to ... (has_anti_or_output_dependence): ... this and adjust to also look for output dependences. (mark_nodes_having_upstream_mem_writes): Adjust. (rdg_flag_uses): Likewise. * gcc.dg/torture/pr58223.c: New testcase. * gcc.dg/tree-ssa/ldist-16.c: Flip expected behavior. Added: trunk/gcc/testsuite/gcc.dg/torture/pr58223.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gcc.dg/tree-ssa/ldist-16.c trunk/gcc/tree-loop-distribution.c
[Bug tree-optimization/58223] [4.8/4.9 Regression] wrong code at -O3 on x86_64-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58223 Richard Biener rguenth at gcc dot gnu.org changed: What|Removed |Added Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org --- Comment #5 from Richard Biener rguenth at gcc dot gnu.org --- Mine. We indeed shouldn't have split this into two partitions.
[Bug tree-optimization/58223] [4.8/4.9 Regression] wrong code at -O3 on x86_64-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58223 Marc Glisse glisse at gcc dot gnu.org changed: What|Removed |Added Keywords||wrong-code Status|UNCONFIRMED |NEW Last reconfirmed||2013-08-23 Summary|wrong code at -O3 on|[4.8/4.9 Regression] wrong |x86_64-linux-gnu|code at -O3 on ||x86_64-linux-gnu Ever confirmed|0 |1 --- Comment #1 from Marc Glisse glisse at gcc dot gnu.org --- ldist pass replaces the a[b]=0 statements with a call to memset after the loop, apparently missing the aliasing with a[0]=1.
[Bug tree-optimization/58223] [4.8/4.9 Regression] wrong code at -O3 on x86_64-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58223 Marek Polacek mpolacek at gcc dot gnu.org changed: What|Removed |Added CC||mpolacek at gcc dot gnu.org --- Comment #2 from Marek Polacek mpolacek at gcc dot gnu.org --- Yep, thus -fno-tree-loop-distribute-patterns is a workaround.
[Bug tree-optimization/58223] [4.8/4.9 Regression] wrong code at -O3 on x86_64-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58223 Marek Polacek mpolacek at gcc dot gnu.org changed: What|Removed |Added Known to work||4.7.3 Target Milestone|--- |4.8.3 Known to fail||4.8.1, 4.9.0
[Bug tree-optimization/58223] [4.8/4.9 Regression] wrong code at -O3 on x86_64-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58223 Jakub Jelinek jakub at gcc dot gnu.org changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #3 from Jakub Jelinek jakub at gcc dot gnu.org --- Started with r188186 . Richard, can you please have a look?
[Bug tree-optimization/58223] [4.8/4.9 Regression] wrong code at -O3 on x86_64-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58223 --- Comment #4 from Marek Polacek mpolacek at gcc dot gnu.org --- Ok, so what happens here is that rdg_build_partitions builds two partitions, that essentially means we split the loop in the original test case into two loops: for (b = 0; b 2; b++) a[0] = 1; for (b = 0; b 2; b++) a[b] = 0; Now, we go over all partitions and classify_partition them, in both loops we have only one store and no load, thus we're in if (single_store !single_load) { ... } condition. For the first loop we bail out, since const_with_all_bytes_same is true for 1 and TYPE_MODE for that 1 is not the same as TYPE_MODE for unsigned char (had the a array been of the char type, it would be the same TYPE_MODE). But for second loop we happily set the PKIND_MEMSET, thus replace it later with memset. I don't know much about partitioning, but it seems that we shouldn't split the loop in the first place.