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