Commit 30078c0a by Marek Polacek Committed by Marek Polacek

re PR c/58346 (ICE with SIGFPE at -O1 and above on x86_64-linux-gnu (affecting…

re PR c/58346 (ICE with SIGFPE at -O1 and above on x86_64-linux-gnu (affecting trunk, 4.8, 4.7, and 4.6))

	PR c/58346
	* gimple-fold.c (fold_array_ctor_reference): Don't fold if element
	size is zero.
testsuite/
	* gcc.dg/pr58346.c: New test.

From-SVN: r206715
parent 14379e66
2014-01-17 Marek Polacek <polacek@redhat.com>
PR c/58346
* gimple-fold.c (fold_array_ctor_reference): Don't fold if element
size is zero.
2014-01-17 Richard Biener <rguenther@suse.de>
PR tree-optimization/46590
......
......@@ -2940,7 +2940,8 @@ fold_array_ctor_reference (tree type, tree ctor,
be larger than size of array element. */
if (!TYPE_SIZE_UNIT (type)
|| TREE_CODE (TYPE_SIZE_UNIT (type)) != INTEGER_CST
|| elt_size.slt (tree_to_double_int (TYPE_SIZE_UNIT (type))))
|| elt_size.slt (tree_to_double_int (TYPE_SIZE_UNIT (type)))
|| elt_size.is_zero ())
return NULL_TREE;
/* Compute the array index we look for. */
......
2014-01-17 Marek Polacek <polacek@redhat.com>
PR c/58346
* gcc.dg/pr58346.c: New test.
2014-01-17 Jakub Jelinek <jakub@redhat.com>
PR testsuite/58776
......
/* PR tree-optimization/58346 */
/* { dg-do compile } */
/* { dg-options "-O" } */
struct U {};
static struct U b[1] = { };
extern void bar (struct U);
void
foo (void)
{
bar (b[0]);
}
void
baz (void)
{
foo ();
}
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