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/cfgexpand.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/cfgexpand.c')
-rw-r--r-- | gcc/cfgexpand.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index e60df87..7b8df04 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -2316,7 +2316,11 @@ expand_debug_expr (tree exp) else op0 = copy_rtx (op0); - if (GET_MODE (op0) == BLKmode) + if (GET_MODE (op0) == BLKmode + /* If op0 is not BLKmode, but BLKmode is, adjust_mode + below would ICE. While it is likely a FE bug, + try to be robust here. See PR43166. */ + || mode == BLKmode) { gcc_assert (MEM_P (op0)); op0 = adjust_address_nv (op0, mode, 0); |