Commit 746e119f by Martin Jambor Committed by Martin Jambor

re PR tree-optimization/43066 (ICE: SIGFPE with empty struct and va_arg)

2010-02-18  Martin Jambor  <mjambor@suse.cz>

	PR tree-optimization/43066
	* tree-sra.c (build_ref_for_offset_1): Return false on encountering an
	array with zero-sized element type.

	* testsuite/gcc.c-torture/compile/pr43066.c: New test.

From-SVN: r156863
parent 82cf0c8c
2010-02-18 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/43066
* tree-sra.c (build_ref_for_offset_1): Return false on encountering an
array with zero-sized element type.
2010-02-18 Jakub Jelinek <jakub@redhat.com> 2010-02-18 Jakub Jelinek <jakub@redhat.com>
* dwarf2out.c (add_var_loc_to_decl): Change last argument to * dwarf2out.c (add_var_loc_to_decl): Change last argument to
......
2010-02-18 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/43066
* gcc.c-torture/compile/pr43066.c: New test.
2010-02-18 Uros Bizjak <ubizjak@gmail.com> 2010-02-18 Uros Bizjak <ubizjak@gmail.com>
* g++.dg/ext/attrib35.C: Fix target selector string. * g++.dg/ext/attrib35.C: Fix target selector string.
......
struct S {
struct { } empty[1];
int i;
};
int foo(int i, ...)
{
struct S s;
__builtin_va_list va;
__builtin_va_start(va, i);
s = __builtin_va_arg(va, struct S);
__builtin_va_end(va);
return s.i;
}
...@@ -1432,7 +1432,7 @@ build_ref_for_offset_1 (tree *res, tree type, HOST_WIDE_INT offset, ...@@ -1432,7 +1432,7 @@ build_ref_for_offset_1 (tree *res, tree type, HOST_WIDE_INT offset,
el_size = tree_low_cst (tr_size, 1); el_size = tree_low_cst (tr_size, 1);
minidx = TYPE_MIN_VALUE (TYPE_DOMAIN (type)); minidx = TYPE_MIN_VALUE (TYPE_DOMAIN (type));
if (TREE_CODE (minidx) != INTEGER_CST) if (TREE_CODE (minidx) != INTEGER_CST || el_size == 0)
return false; return false;
if (res) if (res)
{ {
......
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