[Bug tree-optimization/71947] [6/7 Regression] x ^ y not folded to 0 if x == y by DOM

2016-10-10 Thread law at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71947

--- Comment #12 from Jeffrey A. Law  ---
Author: law
Date: Mon Oct 10 20:40:59 2016
New Revision: 240947

URL: https://gcc.gnu.org/viewcvs?rev=240947=gcc=rev
Log:
PR tree-optimization/71947
* tree-ssa-dom.c (cprop_into_stmt): Avoid replacing A with B, then
B with A within a single statement.

PR tree-optimization/71947
* gcc.dg/tree-ssa/pr71947-1.c: New test.
* gcc.dg/tree-ssa/pr71947-2.c: New test.
* gcc.dg/tree-ssa/pr71947-3.c: New test.
* gcc.dg/tree-ssa/pr71947-4.c: New test.
* gcc.dg/tree-ssa/pr71947-5.c: New test.
* gcc.dg/tree-ssa/pr71947-6.c: New test.

Added:
trunk/gcc/testsuite/gcc.dg/tree-ssa/pr71947-1.c
trunk/gcc/testsuite/gcc.dg/tree-ssa/pr71947-2.c
trunk/gcc/testsuite/gcc.dg/tree-ssa/pr71947-3.c
trunk/gcc/testsuite/gcc.dg/tree-ssa/pr71947-4.c
trunk/gcc/testsuite/gcc.dg/tree-ssa/pr71947-5.c
trunk/gcc/testsuite/gcc.dg/tree-ssa/pr71947-6.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-ssa-dom.c

[Bug tree-optimization/71947] [6/7 Regression] x ^ y not folded to 0 if x == y by DOM

2016-10-10 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71947

--- Comment #11 from Jeffrey A. Law  ---
So I don't like the pain of trying to fold at each propagation step. 
Specifically, the structure of the gimple statement can change, which
invalidates the operand cache.  And the canonicalization of operands based on
their SSA_NAME_VERSIONs means it's possible to get cycles.  While I've got
something that appears to work, I'm not at all happy with it.

So I started looking at a different approach.  Just keep a record of copy
propagated objects and if we've already propagated A for B, don't copy
propagate B for A in the same statement.  We can do this with a bitmap, but
that's a lot of overhead, even when lazily initialized.  I suspect this matters
so rarely in practice that a single entry "this was the last thing copy
propagated" is sufficient.

[Bug tree-optimization/71947] [6/7 Regression] x ^ y not folded to 0 if x == y by DOM

2016-10-05 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71947

Jeffrey A. Law  changed:

   What|Removed |Added

 CC||npiggin at gmail dot com

--- Comment #10 from Jeffrey A. Law  ---
*** Bug 77647 has been marked as a duplicate of this bug. ***

[Bug tree-optimization/71947] [6/7 Regression] x ^ y not folded to 0 if x == y by DOM

2016-10-05 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71947

Jeffrey A. Law  changed:

   What|Removed |Added

 CC||law at redhat dot com
   Assignee|unassigned at gcc dot gnu.org  |law at redhat dot com

--- Comment #9 from Jeffrey A. Law  ---
This ought to be fixable in DOM.  Probably not worth backporting to gcc-6
though.

[Bug tree-optimization/71947] [6/7 Regression] x ^ y not folded to 0 if x == y by DOM

2016-08-22 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71947

--- Comment #8 from Richard Biener  ---
GCC 6.2 is being released, adjusting target milestone.

[Bug tree-optimization/71947] [6/7 Regression] x ^ y not folded to 0 if x == y by DOM

2016-08-22 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71947

--- Comment #7 from Richard Biener  ---
GCC 6.2 is being released, adjusting target milestone.

[Bug tree-optimization/71947] [6/7 Regression] x ^ y not folded to 0 if x == y by DOM

2016-08-22 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71947

--- Comment #6 from Richard Biener  ---
GCC 6.2 is being released, adjusting target milestone.

[Bug tree-optimization/71947] [6/7 Regression] x ^ y not folded to 0 if x == y by DOM

2016-08-22 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71947

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|6.2 |6.3

--- Comment #5 from Richard Biener  ---
GCC 6.2 is being released, adjusting target milestone.

[Bug tree-optimization/71947] [6/7 Regression] x ^ y not folded to 0 if x == y by DOM

2016-08-05 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71947

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug tree-optimization/71947] [6/7 Regression] x ^ y not folded to 0 if x == y by DOM

2016-07-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71947

--- Comment #4 from Richard Biener  ---
Now the testcase is optimized at -O2 by VRP but still not at -O1.

[Bug tree-optimization/71947] [6/7 Regression] x ^ y not folded to 0 if x == y by DOM

2016-07-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71947

--- Comment #3 from Richard Biener  ---
Author: rguenth
Date: Thu Jul 21 13:00:32 2016
New Revision: 238591

URL: https://gcc.gnu.org/viewcvs?rev=238591=gcc=rev
Log:
2016-07-21  Richard Biener  

PR tree-optimization/71947
* tree-vrp.c (extract_range_from_assert): Singleton symbolic
ranges have useful limit_vr information.

* gcc.dg/tree-ssa/vrp102.c: New testcase.

Added:
trunk/gcc/testsuite/gcc.dg/tree-ssa/vrp102.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-vrp.c

[Bug tree-optimization/71947] [6/7 Regression] x ^ y not folded to 0 if x == y by DOM

2016-07-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71947

Richard Biener  changed:

   What|Removed |Added

Summary|[6/7 Regression] x ^ y not  |[6/7 Regression] x ^ y not
   |folded to 0 if x == y   |folded to 0 if x == y by
   ||DOM

--- Comment #2 from Richard Biener  ---
I have a fix that makes this folded at -O2 by VRP.  At -O1 we only have DOM
which
was optimizing this in GCC 5.