From 2f5a12b7d1bbf75902e26035311cbd85d899ea94 Mon Sep 17 00:00:00 2001 From: jakub Date: Thu, 15 Apr 2010 08:53:41 +0000 Subject: [PATCH] * trans-decl.c (gfc_build_qualified_array): Clear DECL_IGNORED_P on VAR_DECL LBOUND and/or UBOUND, even for -O1. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158366 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/ChangeLog | 7 ++++++- gcc/fortran/trans-decl.c | 19 +++++++++---------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index b1b34ee59b7..fdf4e992f9d 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,6 +1,11 @@ +2010-04-15 Jakub Jelinek + + * trans-decl.c (gfc_build_qualified_array): Clear DECL_IGNORED_P + on VAR_DECL LBOUND and/or UBOUND, even for -O1. + 2010-04-14 Steven G. Kargl - * fortran/intrinsic.texi: Add the missing specific name of intrinsic + * intrinsic.texi: Add the missing specific name of intrinsic procedure where the specific name is identical to the generic name. Fix inconsistent or mismatch in the argument names in intrinsic procedure descriptions. Add the SCALAR allocatable description to diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index 658aadb4087..9e79a9adfab 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -775,16 +775,15 @@ gfc_build_qualified_array (tree decl, gfc_symbol * sym) GFC_TYPE_ARRAY_LBOUND (type, dim), GFC_TYPE_ARRAY_UBOUND (type, dim)); gtype = build_array_type (gtype, rtype); - /* Ensure the bound variables aren't optimized out at -O0. */ - if (!optimize) - { - if (GFC_TYPE_ARRAY_LBOUND (type, dim) - && TREE_CODE (GFC_TYPE_ARRAY_LBOUND (type, dim)) == VAR_DECL) - DECL_IGNORED_P (GFC_TYPE_ARRAY_LBOUND (type, dim)) = 0; - if (GFC_TYPE_ARRAY_UBOUND (type, dim) - && TREE_CODE (GFC_TYPE_ARRAY_UBOUND (type, dim)) == VAR_DECL) - DECL_IGNORED_P (GFC_TYPE_ARRAY_UBOUND (type, dim)) = 0; - } + /* Ensure the bound variables aren't optimized out at -O0. + For -O1 and above they often will be optimized out, but + can be tracked by VTA. */ + if (GFC_TYPE_ARRAY_LBOUND (type, dim) + && TREE_CODE (GFC_TYPE_ARRAY_LBOUND (type, dim)) == VAR_DECL) + DECL_IGNORED_P (GFC_TYPE_ARRAY_LBOUND (type, dim)) = 0; + if (GFC_TYPE_ARRAY_UBOUND (type, dim) + && TREE_CODE (GFC_TYPE_ARRAY_UBOUND (type, dim)) == VAR_DECL) + DECL_IGNORED_P (GFC_TYPE_ARRAY_UBOUND (type, dim)) = 0; } TYPE_NAME (type) = type_decl = build_decl (input_location, TYPE_DECL, NULL, gtype); -- 2.11.0