gimplify.c (gimplify_expr): Do not crash when folding (void *)(int)&a + 4.

* gimplify.c (gimplify_expr): Do not crash when folding
	(void *)(int)&a + 4.

From-SVN: r124497
This commit is contained in:
Jan Hubicka 2007-05-07 12:36:09 +02:00 committed by Jan Hubicka
parent 5d148c0881
commit 2cb7995f07
2 changed files with 7 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2007-05-07 Jan Hubicka <jh@suse.cz>
* gimplify.c (gimplify_expr): Do not crash when folding
(void *)(int)&a + 4.
2007-05-07 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR driver/31694

View File

@ -5887,6 +5887,8 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
if (POINTER_TYPE_P (TREE_TYPE (*expr_p))
&& TREE_CODE (TREE_OPERAND (*expr_p, 0)) == NOP_EXPR
&& TREE_CODE (TREE_OPERAND (*expr_p, 1)) == INTEGER_CST
&& POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (TREE_OPERAND (*expr_p,
0),0)))
&& (tmp = maybe_fold_offset_to_reference
(TREE_OPERAND (TREE_OPERAND (*expr_p, 0), 0),
TREE_OPERAND (*expr_p, 1),