tree-optimization/93538 - add missing comparison folding case
authorRichard Biener <rguenther@suse.de>
Tue, 4 Feb 2020 14:17:01 +0000 (15:17 +0100)
committerRichard Biener <rguenther@suse.de>
Tue, 4 Feb 2020 14:18:25 +0000 (15:18 +0100)
commit5124c34fcc62f0f880ae947542678e28aa2ce703
treeed149fabf769e532c99a6fe6f1eecad4cafc740f
parent9bc5bea1f3f0ce3927fd86ce728641d087f3d3b5
tree-optimization/93538 - add missing comparison folding case

This adds back a folding that worked in GCC 4.5 times by amending
the pattern that handles other cases of address vs. SSA name
comparisons.

2020-02-04  Richard Biener  <rguenther@suse.de>

PR tree-optimization/93538
* match.pd (addr EQ/NE ptr): Amend to handle &ptr->x EQ/NE ptr.

* gcc.dg/tree-ssa/forwprop-38.c: New testcase.
gcc/ChangeLog
gcc/match.pd
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/forwprop-38.c [new file with mode: 0644]