From 75fad0a98919da8212be4efc479d098499f4f1c3 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Fri, 5 Jul 2019 12:48:42 +0000 Subject: re PR tree-optimization/91091 ([missed optimization] Missing optimization in unaliased pointers) 2019-07-05 Richard Biener PR tree-optimization/91091 * tree-ssa-sccvn.c (vn_reference_lookup_3): Overlap of accesses can happen with -fno-strict-aliasing. * gcc.dg/tree-ssa/pr91091-1.c: New testcase. * gcc.dg/tree-ssa/ssa-fre-61.c: Adjust. From-SVN: r273134 --- gcc/tree-ssa-sccvn.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gcc/tree-ssa-sccvn.c') diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c index 22dd801..2cc76d8 100644 --- a/gcc/tree-ssa-sccvn.c +++ b/gcc/tree-ssa-sccvn.c @@ -1996,7 +1996,8 @@ vn_reference_lookup_3 (ao_ref *ref, tree vuse, void *data_, activation of a union member via a store makes the values of untouched bytes unspecified. */ && (known_eq (ref->size, BITS_PER_UNIT) - || (get_alias_set (lhs) != 0 + || (flag_strict_aliasing + && get_alias_set (lhs) != 0 && ao_ref_alias_set (ref) != 0))) { tree *saved_last_vuse_ptr = data->last_vuse_ptr; -- cgit v1.1