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.
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);
+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
/* 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>
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);
}
}
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.
--- /dev/null
+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