diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/gimple-fold.c | 15 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/pr103691.f90 | 9 |
2 files changed, 10 insertions, 14 deletions
diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c index 80e7d89..77c551a 100644 --- a/gcc/gimple-fold.c +++ b/gcc/gimple-fold.c @@ -6283,8 +6283,7 @@ fold_stmt_1 (gimple_stmt_iterator *gsi, bool inplace, tree (*valueize) (tree)) if (gimple_debug_bind_p (stmt)) { tree val = gimple_debug_bind_get_value (stmt); - if (val - && REFERENCE_CLASS_P (val)) + if (val && REFERENCE_CLASS_P (val)) { tree tem = maybe_fold_reference (val); if (tem) @@ -6293,18 +6292,6 @@ fold_stmt_1 (gimple_stmt_iterator *gsi, bool inplace, tree (*valueize) (tree)) changed = true; } } - else if (val - && TREE_CODE (val) == ADDR_EXPR) - { - tree ref = TREE_OPERAND (val, 0); - tree tem = maybe_fold_reference (ref); - if (tem) - { - tem = build_fold_addr_expr_with_type (tem, TREE_TYPE (val)); - gimple_debug_bind_set_value (stmt, tem); - changed = true; - } - } } break; diff --git a/gcc/testsuite/gfortran.dg/pr103691.f90 b/gcc/testsuite/gfortran.dg/pr103691.f90 new file mode 100644 index 0000000..f1f551e --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr103691.f90 @@ -0,0 +1,9 @@ +! PR fortran/103691 +! { dg-do compile } +! { dg-options "-O2 -g" } + +program pr103691 + real, parameter :: a(0) = 2.0 + real, allocatable :: b(:) + allocate (b, mold=a) +end |