[Bug middle-end/36201] [4.4 Regression] NVR in the front-end causes missed optimization later on (<retval> thought to alias arguments)
pinskia at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Wed Dec 31 21:12:00 GMT 2008
------- Comment #5 from pinskia at gcc dot gnu dot org 2008-12-31 21:11 -------
Actually this testcase is regression because of the removal of SFTs. in
4.1-4.3, the loop did not exist.
In fact I filed this bug right after SFTs were removed.
The reason why it is considered addressable is because of:
/* Return true if T is a GIMPLE variable whose address is not needed. */
bool
is_gimple_non_addressable (tree t)
{
if (TREE_CODE (t) == SSA_NAME)
t = SSA_NAME_VAR (t);
return (is_gimple_variable (t) && ! needs_to_live_in_memory (t));
}
needs_to_live_in_memory is true because of
return (TREE_ADDRESSABLE (t)
|| is_global_var (t)
|| (TREE_CODE (t) == RESULT_DECL
&& aggregate_value_p (t, current_function_decl)));
And aggregate_value_p is true because of:
if (TREE_CODE (exp) == CALL_EXPR && fndecl && DECL_RESULT (fndecl)
&& DECL_BY_REFERENCE (DECL_RESULT (fndecl)))
return 1;
DECL_BY_REFERENCE is true because this is a nonPOD.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|enhancement |normal
Known to fail| |4.4.0
Known to work| |4.3.0 4.1.2
Summary|NVR in the front-end causes |[4.4 Regression] NVR in the
|missed optimization later on|front-end causes missed
|(<retval> thought to alias |optimization later on
|arguments) |(<retval> thought to alias
| |arguments)
Target Milestone|--- |4.4.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36201
More information about the Gcc-bugs
mailing list