Commit 8706773f by Richard Biener Committed by Richard Biener

re PR fortran/70931 (ICE with -g in native_encode_initializer, bei dwarf2out.c:17768)

2016-05-06  Richard Biener  <rguenther@suse.de>

	PR middle-end/70931
	* dwarf2out.c (native_encode_initializer): Skip zero-sized fields.

	* gfortran.dg/pr70931.f90: New testcase.

From-SVN: r235944
parent a4f51018
2016-05-06 Richard Biener <rguenther@suse.de>
PR middle-end/70931
* dwarf2out.c (native_encode_initializer): Skip zero-sized fields.
2016-05-06 Richard Biener <rguenther@suse.de>
PR middle-end/70941
* fold-const.c (split_tree): Always convert to the original type
before negating.
......
......@@ -17806,7 +17806,7 @@ native_encode_initializer (tree init, unsigned char *array, int size)
fieldsize = tree_to_shwi (DECL_SIZE_UNIT (field));
pos = int_byte_position (field);
gcc_assert (pos + fieldsize <= size);
if (val
if (val && fieldsize != 0
&& !native_encode_initializer (val, array + pos, fieldsize))
return false;
}
......
2016-05-06 Richard Biener <rguenther@suse.de>
PR middle-end/70931
* gfortran.dg/pr70931.f90: New testcase.
2016-05-06 Richard Biener <rguenther@suse.de>
PR middle-end/70941
* gcc.dg/torture/pr70941.c: New testcase.
......
! { dg-do compile }
! { dg-options "-g" }
program p
type t
integer :: a
integer :: b(0)
end type
type(t), parameter :: z = t(1, [2])
print *, z
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment