Commit e3061843 by Richard Biener

tree-cfg.c (verify_gimple_return): Handle DECL_BY_REFERENCE RESULT_DECLs properly.

2010-07-05  Richard Guenther  <rguenther@suse.de>

	* tree-cfg.c (verify_gimple_return): Handle DECL_BY_REFERENCE
	RESULT_DECLs properly.

From-SVN: r161821
parent 5bb12090
2010-07-05 Richard Guenther <rguenther@suse.de>
* tree-cfg.c (verify_gimple_return): Handle DECL_BY_REFERENCE
RESULT_DECLs properly.
2010-07-04 H.J. Lu <hongjiu.lu@intel.com>
PR rtl-optimization/44695
......@@ -15,8 +20,8 @@
2010-07-04 Jan Hubicka <jh@suse.cz>
* cgraphunit.c (init_cgraph): Only initialize dump file if it is not already
initialized.
* cgraphunit.c (init_cgraph): Only initialize dump file if it is not
already initialized.
2010-07-04 Richard Sandiford <rdsandiford@googlemail.com>
......
......@@ -3826,12 +3826,14 @@ verify_gimple_return (gimple stmt)
return true;
}
if (!useless_type_conversion_p (restype, TREE_TYPE (op))
/* ??? With C++ we can have the situation that the result
decl is a reference type while the return type is an aggregate. */
&& !(TREE_CODE (op) == RESULT_DECL
&& TREE_CODE (TREE_TYPE (op)) == REFERENCE_TYPE
&& useless_type_conversion_p (restype, TREE_TYPE (TREE_TYPE (op)))))
if ((TREE_CODE (op) == RESULT_DECL
&& DECL_BY_REFERENCE (op))
|| (TREE_CODE (op) == SSA_NAME
&& TREE_CODE (SSA_NAME_VAR (op)) == RESULT_DECL
&& DECL_BY_REFERENCE (SSA_NAME_VAR (op))))
op = TREE_TYPE (op);
if (!useless_type_conversion_p (restype, TREE_TYPE (op)))
{
error ("invalid conversion in return statement");
debug_generic_stmt (restype);
......
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