Commit 4519d745 by Richard Guenther Committed by Richard Biener

re PR middle-end/53790 (ICE on dereferencing a extern union in asm statement)

2012-06-28  Richard Guenther  <rguenther@suse.de>

	PR middle-end/53790
	* expr.c (expand_expr_real_1): Verify if the type is complete
	before inspecting its size.

	* gcc.dg/torture/pr53790.c: New testcase.

From-SVN: r189045
parent 7db2226d
2012-06-28 Richard Guenther <rguenther@suse.de>
PR middle-end/53790
* expr.c (expand_expr_real_1): Verify if the type is complete
before inspecting its size.
2012-06-28 Andreas Schwab <schwab@linux-m68k.org>
* doc/include/gpl.texi: Remove.
......
......@@ -9832,6 +9832,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
orig_op0 = op0
= expand_expr (tem,
(TREE_CODE (TREE_TYPE (tem)) == UNION_TYPE
&& COMPLETE_TYPE_P (TREE_TYPE (tem))
&& (TREE_CODE (TYPE_SIZE (TREE_TYPE (tem)))
!= INTEGER_CST)
&& modifier != EXPAND_STACK_PARM
......
2012-06-28 Richard Guenther <rguenther@suse.de>
PR middle-end/53790
* gcc.dg/torture/pr53790.c: New testcase.
2012-06-28 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/53645
......
/* { dg-do compile } */
typedef struct s {
int value;
} s_t;
static inline int
read(s_t const *var)
{
return var->value;
}
int main()
{
extern union u extern_var;
return read((s_t *)&extern_var);
}
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