[Bug tree-optimization/65388] Wrong comparison in same_succ_def::equal() tree-ssa-tail-merge.c:590
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65388 --- Comment #8 from Marek Polacek mpolacek at gcc dot gnu.org --- Author: mpolacek Date: Thu Mar 12 08:34:00 2015 New Revision: 221376 URL: https://gcc.gnu.org/viewcvs?rev=221376root=gccview=rev Log: PR tree-optimization/65388 Modified: branches/gcc-4_8-branch/gcc/ChangeLog branches/gcc-4_8-branch/gcc/tree-ssa-tail-merge.c --- Comment #9 from Marek Polacek mpolacek at gcc dot gnu.org --- Author: mpolacek Date: Thu Mar 12 08:31:36 2015 New Revision: 221375 URL: https://gcc.gnu.org/viewcvs?rev=221375root=gccview=rev Log: PR tree-optimization/65388 * tree-ssa-tail-merge.c (same_succ_def::equal): Fix typo in comparison. Modified: branches/gcc-4_9-branch/gcc/ChangeLog branches/gcc-4_9-branch/gcc/tree-ssa-tail-merge.c
[Bug tree-optimization/65388] Wrong comparison in same_succ_def::equal() tree-ssa-tail-merge.c:590
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65388 Marek Polacek mpolacek at gcc dot gnu.org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|--- |FIXED --- Comment #7 from Marek Polacek mpolacek at gcc dot gnu.org --- Fixed.
[Bug tree-optimization/65388] Wrong comparison in same_succ_def::equal() tree-ssa-tail-merge.c:590
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65388 --- Comment #8 from Marek Polacek mpolacek at gcc dot gnu.org --- Author: mpolacek Date: Thu Mar 12 08:34:00 2015 New Revision: 221376 URL: https://gcc.gnu.org/viewcvs?rev=221376root=gccview=rev Log: PR tree-optimization/65388 Modified: branches/gcc-4_8-branch/gcc/ChangeLog branches/gcc-4_8-branch/gcc/tree-ssa-tail-merge.c --- Comment #9 from Marek Polacek mpolacek at gcc dot gnu.org --- Author: mpolacek Date: Thu Mar 12 08:31:36 2015 New Revision: 221375 URL: https://gcc.gnu.org/viewcvs?rev=221375root=gccview=rev Log: PR tree-optimization/65388 * tree-ssa-tail-merge.c (same_succ_def::equal): Fix typo in comparison. Modified: branches/gcc-4_9-branch/gcc/ChangeLog branches/gcc-4_9-branch/gcc/tree-ssa-tail-merge.c
[Bug tree-optimization/65388] Wrong comparison in same_succ_def::equal() tree-ssa-tail-merge.c:590
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65388 --- Comment #6 from Marek Polacek mpolacek at gcc dot gnu.org --- Author: mpolacek Date: Wed Mar 11 20:36:56 2015 New Revision: 221359 URL: https://gcc.gnu.org/viewcvs?rev=221359root=gccview=rev Log: PR tree-optimization/65388 * tree-ssa-tail-merge.c (same_succ_def::equal): Fix typo in comparison. Modified: trunk/gcc/ChangeLog trunk/gcc/tree-ssa-tail-merge.c
[Bug tree-optimization/65388] Wrong comparison in same_succ_def::equal() tree-ssa-tail-merge.c:590
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65388 --- Comment #2 from Marek Polacek mpolacek at gcc dot gnu.org --- (In reply to Marek Polacek from comment #1) That looks indeed. I meant weird.
[Bug tree-optimization/65388] Wrong comparison in same_succ_def::equal() tree-ssa-tail-merge.c:590
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65388 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 --- Do we warn in this case (something like condition is always false)? clang has -Wtautological-compare warning that warns say for int b; if (b != b) but doesn't already for int a[10], i; if (a[i] != a[i]). gcc has -Wtype-limits, which partially overlaps the -Wtautological-compare, so if we introduce it, we should probably just add there the cases not already covered by -Wtype-limits.
[Bug tree-optimization/65388] Wrong comparison in same_succ_def::equal() tree-ssa-tail-merge.c:590
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65388 --- Comment #4 from Jakub Jelinek jakub at gcc dot gnu.org --- Ah, we have PR54979 for that already... Marek, would you be interested to look at this in stage1?
[Bug tree-optimization/65388] Wrong comparison in same_succ_def::equal() tree-ssa-tail-merge.c:590
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65388 Marek Polacek mpolacek at gcc dot gnu.org changed: What|Removed |Added CC||mpolacek at gcc dot gnu.org --- Comment #1 from Marek Polacek mpolacek at gcc dot gnu.org --- That looks indeed. The code is in mainline as well and I bet 4.8 has it too. Patch: --- a/gcc/tree-ssa-tail-merge.c +++ b/gcc/tree-ssa-tail-merge.c @@ -587,7 +587,7 @@ same_succ_def::equal (const value_type *e1, const compare_type *e2) if (!inverse_flags (e1, e2)) { for (i = 0; i e1-succ_flags.length (); ++i) - if (e1-succ_flags[i] != e1-succ_flags[i]) + if (e1-succ_flags[i] != e2-succ_flags[i]) return 0; }
[Bug tree-optimization/65388] Wrong comparison in same_succ_def::equal() tree-ssa-tail-merge.c:590
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65388 Marek Polacek mpolacek at gcc dot gnu.org changed: What|Removed |Added Status|UNCONFIRMED |ASSIGNED Last reconfirmed||2015-03-11 Assignee|unassigned at gcc dot gnu.org |mpolacek at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #5 from Marek Polacek mpolacek at gcc dot gnu.org --- (In reply to Jakub Jelinek from comment #4) Ah, we have PR54979 for that already... Marek, would you be interested to look at this in stage1? Yes, I am; we should be able to warn in such egregious cases. Similar issues: PR64249, PR63357. Taking this one...