diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-06-20 14:57:10 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-06-20 14:57:10 +0000 |
commit | 3ea695dbf5beba76ca390b78b36fc9a027ea709b (patch) | |
tree | 86489f33ca274a6acfa793a6e56fa8df7a6f6f96 /gcc/fortran/trans.c | |
parent | 82dda0a449dd66b4a16d8d252db0d0f16435550d (diff) | |
download | gcc-3ea695dbf5beba76ca390b78b36fc9a027ea709b.tar.gz |
2007-06-20 Andrew Pinski <andrew_pinski@playstation.sony.com>
Richard Guenther <rguenther@suse.de>
PR fortran/32140
* trans.c (gfc_build_addr_expr): Use the correct types.
* gfortran.fortran-torture/execute/pr32140.f90: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@125886 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/trans.c')
-rw-r--r-- | gcc/fortran/trans.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c index 97336b68f61..81cd12e21cd 100644 --- a/gcc/fortran/trans.c +++ b/gcc/fortran/trans.c @@ -266,7 +266,15 @@ gfc_build_addr_expr (tree type, tree t) && TREE_CODE (base_type) == ARRAY_TYPE && TYPE_MAIN_VARIANT (TREE_TYPE (type)) == TYPE_MAIN_VARIANT (TREE_TYPE (base_type))) - natural_type = type; + { + tree min_val = size_zero_node; + tree type_domain = TYPE_DOMAIN (base_type); + if (type_domain && TYPE_MIN_VALUE (type_domain)) + min_val = TYPE_MIN_VALUE (type_domain); + t = build4 (ARRAY_REF, TREE_TYPE (type), t, min_val, + NULL_TREE, NULL_TREE); + natural_type = type; + } else natural_type = build_pointer_type (base_type); |