diff options
author | Jakub Jelinek <jakub@redhat.com> | 2010-02-25 11:50:24 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2010-02-25 11:50:24 +0100 |
commit | 0679656478759e3bfd02f6f0a4b22fd792b736d7 (patch) | |
tree | 8c563f765e4c4c2d824bc55f8a32342fd34a9066 /gcc/fortran/trans-common.c | |
parent | 7d5d39bb9dbdf4374f8240128048302338faaca7 (diff) | |
download | gcc-0679656478759e3bfd02f6f0a4b22fd792b736d7.zip gcc-0679656478759e3bfd02f6f0a4b22fd792b736d7.tar.gz gcc-0679656478759e3bfd02f6f0a4b22fd792b736d7.tar.bz2 |
re PR debug/43166 (ICE in simplify_subreg on fortran code)
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.
From-SVN: r157063
Diffstat (limited to 'gcc/fortran/trans-common.c')
-rw-r--r-- | gcc/fortran/trans-common.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c index 62a2e01..844ac1d 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); } } |