aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/cfgexpand.c6
-rw-r--r--gcc/fortran/ChangeLog7
-rw-r--r--gcc/fortran/trans-common.c5
-rw-r--r--gcc/testsuite/ChangeLog3
-rw-r--r--gcc/testsuite/gfortran.dg/debug/pr43166.f14
6 files changed, 37 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a8c96f2..c66acfa 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,9 @@
2010-02-25 Jakub Jelinek <jakub@redhat.com>
+ 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.
+
PR debug/43165
* cfgexpand.c (expand_debug_expr): Don't call simplify_gen_subreg
if bitpos isn't multiple of mode's bitsize.
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);
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index af4bf20..08a6b68 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,10 @@
+2010-02-25 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/43166
+ * trans-common.c (build_common_decl): Also update DECL_MODE,
+ and DECL_SIZE when encountering a larger common block and call
+ layout_decl.
+
2010-02-24 Tobias Burnus <burnus@net-b.de>
PR fortran/43042
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);
}
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 14685fd..c3fbe66 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,8 @@
2010-02-25 Jakub Jelinek <jakub@redhat.com>
+ PR debug/43166
+ * gfortran.dg/debug/pr43166.f: New test.
+
PR debug/43165
* gcc.dg/torture/pr43165.c: New test.
diff --git a/gcc/testsuite/gfortran.dg/debug/pr43166.f b/gcc/testsuite/gfortran.dg/debug/pr43166.f
new file mode 100644
index 0000000..a314615
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/debug/pr43166.f
@@ -0,0 +1,14 @@
+C PR debug/43166
+C { dg-do compile }
+C { dg-options "-O" }
+ SUBROUTINE FOO ()
+ INTEGER V1
+ COMMON // V1
+ END
+ SUBROUTINE BAR ()
+ INTEGER V0,V1,V2,V3
+ COMMON // V1(4),V2(85,4),V3
+ DO V3=1,V1(1)
+ V0=V2(V3,1)
+ END DO
+ END