From 2a762fe1652ff05808a82c5169e44412516de7da Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Fri, 28 Oct 2016 13:07:59 +0000 Subject: [PATCH] re PR middle-end/78128 (fortran/resolve.c:resolve_operator miscompiled at -O2) 2016-10-28 Richard Biener PR middle-end/78128 PR middle-end/71002 * fold-const.c (make_bit_field_ref): Only adjust alias set when the original alias set was zero. From-SVN: r241645 --- gcc/ChangeLog | 7 +++++++ gcc/fold-const.c | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 37637fb7c21..223396ce498 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2016-10-28 Richard Biener + + PR middle-end/78128 + PR middle-end/71002 + * fold-const.c (make_bit_field_ref): Only adjust alias set + when the original alias set was zero. + 2016-10-28 Andreas Krebbel * config/s390/s390.c (s390_adjust_loop_scan_osc): New function. diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 89ed89dc25c..eaa7c07188c 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -3809,11 +3809,11 @@ make_bit_field_ref (location_t loc, tree inner, tree orig_inner, tree type, { tree result, bftype; - if (get_alias_set (inner) != get_alias_set (orig_inner)) + alias_set_type iset = get_alias_set (orig_inner); + if (iset == 0 && get_alias_set (inner) != iset) inner = fold_build2 (MEM_REF, TREE_TYPE (inner), build_fold_addr_expr (inner), - build_int_cst - (reference_alias_ptr_type (orig_inner), 0)); + build_int_cst (ptr_type_node, 0)); if (bitpos == 0 && !reversep) { -- 2.30.2