re PR tree-optimization/34113 (ICE in get_addr_dereference_operands, at tree-ssa-operands.c:1746)

2007-11-16  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/34113
	* tree-ssa-forwprop.c (tree_ssa_forward_propagate_single_use_vars):
	Use correct conversion direction for checking type compatibility.

	* gcc.c-torture/compile/pr34113.c: New testcase.

From-SVN: r130223
This commit is contained in:
Richard Guenther 2007-11-16 13:14:03 +00:00 committed by Richard Biener
parent 7f879c9615
commit 99552e406c
4 changed files with 24 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2007-11-16 Richard Guenther <rguenther@suse.de>
PR tree-optimization/34113
* tree-ssa-forwprop.c (tree_ssa_forward_propagate_single_use_vars):
Use correct conversion direction for checking type compatibility.
2007-11-16 Richard Guenther <rguenther@suse.de>
PR tree-optimization/34099

View File

@ -1,3 +1,8 @@
2007-11-16 Richard Guenther <rguenther@suse.de>
PR tree-optimization/34113
* gcc.c-torture/compile/pr34113.c: New testcase.
2007-11-16 Richard Guenther <rguenther@suse.de>
PR tree-optimization/34099

View File

@ -0,0 +1,11 @@
struct sockaddr_in { int sin_addr; };
static void ConvertAddr (struct sockaddr_in *saddr, void **addr)
{
*addr = (void *) &saddr->sin_addr;
}
unsigned char EnableLocalHost (struct sockaddr_in *ifa_addr)
{
unsigned char * addr;
ConvertAddr(ifa_addr, (void **)&addr);
return addr[0];
}

View File

@ -959,8 +959,8 @@ tree_ssa_forward_propagate_single_use_vars (void)
|| TREE_CODE (rhs) == CONVERT_EXPR)
&& TREE_CODE (TREE_OPERAND (rhs, 0)) == ADDR_EXPR
&& POINTER_TYPE_P (TREE_TYPE (rhs))
&& useless_type_conversion_p (TREE_TYPE (TREE_TYPE (rhs)),
TREE_TYPE (TREE_TYPE (TREE_OPERAND (rhs, 0))))))
&& useless_type_conversion_p (TREE_TYPE (TREE_TYPE (TREE_OPERAND (rhs, 0))),
TREE_TYPE (TREE_TYPE (rhs)))))
{
if (forward_propagate_addr_expr (lhs, rhs))
{