aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-common.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2010-02-25 10:50:24 +0000
committerJakub Jelinek <jakub@redhat.com>2010-02-25 10:50:24 +0000
commit63564c4f8117ba8093937769d72b167f673d8f13 (patch)
tree8c563f765e4c4c2d824bc55f8a32342fd34a9066 /gcc/fortran/trans-common.c
parentd0d59cddda35b59828f0899c6554778b6fe6c201 (diff)
PR debug/43166
* cfgexpand.c (expand_debug_expr) <case VAR_DECL>: If mode is BLKmode, assert op0 is a MEM and just adjust its mode. * trans-common.c (build_common_decl): Also update DECL_MODE, and DECL_SIZE when encountering a larger common block and call layout_decl. * gfortran.dg/debug/pr43166.f: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@157063 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/trans-common.c')
-rw-r--r--gcc/fortran/trans-common.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c
index 62a2e018210..844ac1d2674 100644
--- a/gcc/fortran/trans-common.c
+++ b/gcc/fortran/trans-common.c
@@ -1,5 +1,5 @@
/* Common block and equivalence list handling
- Copyright (C) 2000, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+ Copyright (C) 2000, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
Contributed by Canqun Yang <canqun@nudt.edu.cn>
@@ -399,8 +399,11 @@ build_common_decl (gfc_common_head *com, tree union_type, bool is_init)
if (strcmp (com->name, BLANK_COMMON_NAME))
gfc_warning ("Named COMMON block '%s' at %L shall be of the "
"same size", com->name, &com->where);
+ DECL_SIZE (decl) = TYPE_SIZE (union_type);
DECL_SIZE_UNIT (decl) = size;
+ DECL_MODE (decl) = TYPE_MODE (union_type);
TREE_TYPE (decl) = union_type;
+ layout_decl (decl, 0);
}
}