Handle a_2= &b properly in range calculations.
authorAndrew MacLeod <amacleod@redhat.com>
Thu, 22 Oct 2020 00:11:16 +0000 (20:11 -0400)
committerAndrew MacLeod <amacleod@redhat.com>
Thu, 22 Oct 2020 00:15:28 +0000 (20:15 -0400)
commit966fdb2e12c0347aa3f9efaf5f4e1cd8237fa024
tree75e85ac0b6215c99666bc3368d246c2318e5ba09
parent0f41b5e02fa47db2080b77e4e1f7cd3305457c05
Handle a_2= &b properly in range calculations.

when processing assignments, we were using the type of b instead of type
of &b when computing a range.  This was usually filtered out by FRE.
turning it off exposed it.

gcc/
PR tree-optimization/97520
* gimple-range.cc (range_of_non_trivial_assignment): Handle x = &a
by returning a non-zero range.
gcc/testsuite/
* gcc.dg/pr97520.c: New.
gcc/gimple-range.cc
gcc/testsuite/gcc.dg/pr97520.c [new file with mode: 0644]