diff options
author | Richard Biener <rguenther@suse.de> | 2016-05-11 10:24:11 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2016-05-11 10:24:11 +0000 |
commit | ebc1b29edb3428dd18e76cba8626625bfb184f1d (patch) | |
tree | c56af27e777a33142ec5005ae7600ac16297fad4 /gcc/alias.c | |
parent | 98ccd1d7ab1d9a0c99cce0d1c05ddcda3659dd26 (diff) | |
download | gcc-ebc1b29edb3428dd18e76cba8626625bfb184f1d.zip gcc-ebc1b29edb3428dd18e76cba8626625bfb184f1d.tar.gz gcc-ebc1b29edb3428dd18e76cba8626625bfb184f1d.tar.bz2 |
re PR middle-end/71002 (-fstrict-aliasing breaks Boost's short string optimization implementation)
2016-05-11 Richard Biener <rguenther@suse.de>
PR middle-end/71002
* alias.c (reference_alias_ptr_type): Preserve alias-set zero
if the langhook insists on it.
* fold-const.c (make_bit_field_ref): Add arg for the original
reference and preserve its alias-set.
(decode_field_reference): Take exp by reference and adjust it
to the original memory reference.
(optimize_bit_field_compare): Adjust callers.
(fold_truth_andor_1): Likewise.
* gimplify.c (gimplify_expr): Adjust in-SSA form test.
* g++.dg/torture/pr71002.C: New testcase.
From-SVN: r236117
Diffstat (limited to 'gcc/alias.c')
-rw-r--r-- | gcc/alias.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/alias.c b/gcc/alias.c index 451f8f3..1e4c4d1 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -769,6 +769,10 @@ reference_alias_ptr_type_1 (tree *t) tree reference_alias_ptr_type (tree t) { + /* If the frontend assigns this alias-set zero, preserve that. */ + if (lang_hooks.get_alias_set (t) == 0) + return ptr_type_node; + tree ptype = reference_alias_ptr_type_1 (&t); /* If there is a given pointer type for aliasing purposes, return it. */ if (ptype != NULL_TREE) |