Commit c54e3854 by Richard Guenther Committed by Richard Biener

re PR tree-optimization/34885 (ICE in copy_reference_ops_from_ref, at tree-ssa-sccvn.c:574)

2008-01-21  Richard Guenther  <rguenther@suse.de>

	PR c/34885
	* tree-inline.c (setup_one_parameter): Deal with mismatched
	types using a VIEW_CONVERT_EXPR.

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

From-SVN: r131694
parent 41b72e59
2008-01-21 Richard Guenther <rguenther@suse.de>
PR c/34885
* tree-inline.c (setup_one_parameter): Deal with mismatched
types using a VIEW_CONVERT_EXPR.
2008-01-21 Alon Dayan <alond@il.ibm.com>
Olga Golovanevsky <olga@il.ibm.com>
......
2008-01-21 Richard Guenther <rguenther@suse.de>
PR c/34885
* gcc.c-torture/compile/pr34885.c: New testcase.
2008-01-21 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/specs/alignment1.ads: New test.
typedef union {
__const struct sockaddr *__restrict __sockaddr__;
} __CONST_SOCKADDR_ARG __attribute__ ((__transparent_union__));
extern int _pure_socketcall (const struct sockaddr *);
extern int sendto (__CONST_SOCKADDR_ARG __addr);
int send(void)
{
return sendto((void *)0);
}
int sendto(const struct sockaddr *to)
{
return _pure_socketcall(to);
}
......@@ -1444,7 +1444,16 @@ setup_one_parameter (copy_body_data *id, tree p, tree value, tree fn,
if (value
&& value != error_mark_node
&& !useless_type_conversion_p (TREE_TYPE (p), TREE_TYPE (value)))
rhs = fold_build1 (NOP_EXPR, TREE_TYPE (p), value);
{
if (fold_convertible_p (TREE_TYPE (p), value))
rhs = fold_build1 (NOP_EXPR, TREE_TYPE (p), value);
else
/* ??? For valid (GIMPLE) programs we should not end up here.
Still if something has gone wrong and we end up with truly
mismatched types here, fall back to using a VIEW_CONVERT_EXPR
to not leak invalid GIMPLE to the following passes. */
rhs = fold_build1 (VIEW_CONVERT_EXPR, TREE_TYPE (p), value);
}
/* If the parameter is never assigned to, has no SSA_NAMEs created,
we may not need to create a new variable here at all. Instead, we may
......
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