Hi, This patch fixes PR89487 by following comments in PR. It simply avoid checking runtime alias by versioning in loop distribution if address of register variable may need to be taken.
One thing I am not sure is if we should avoid generating data reference in the
first place:
Creating dr for pc
analyze_innermost: success.
base_address: &pc
offset from base address: 0
constant offset from base address: 0
step: 0
base alignment: 8
base misalignment: 0
offset alignment: 128
step alignment: 128
base_object: pc
Here 'pc' is the register variable.
Bootstrap and test on x86_64, any comment?
Thanks,
bin
2019-02-28 Bin Cheng <[email protected]>
PR tree-optimization/89487
* tree-loop-distribution.c (has_nonaddressable_dataref_p): New.
(create_rdg_vertices): Compute has_nonaddressable_dataref_p.
(distribute_loop): Don't do runtime alias check if there is non-
addressable data reference.
* tree-ssa-loop-ivopts.c (may_be_nonaddressable_p): Check if VAR_DECL
is a register variable.
2018-02-28 Bin Cheng <[email protected]>
PR tree-optimization/89487
* gcc/testsuite/gcc.dg/tree-ssa/pr89487.c: New test.
pr89487-20190301.txt
Description: Binary data
