This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Handle GIMPLE NOPs in is_maybe_undefined (PR, tree-optimization/79529).
- From: Aldy Hernandez <aldyh at redhat dot com>
- To: Martin Liška <mliska at suse dot cz>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: aldyh at gcc dot gnu dot org
- Date: Wed, 15 Feb 2017 11:06:27 -0500
- Subject: Re: Handle GIMPLE NOPs in is_maybe_undefined (PR, tree-optimization/79529).
- Authentication-results: sourceware.org; auth=none
- References: <8730427c-6a01-31d7-f367-72bd6259e030@suse.cz>
On 02/15/2017 09:49 AM, Martin Liška wrote:
Hi.
As mentioned in the PR, gimple nops are wrongly handled in is_maybe_undefined function.
Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.
gimple *def = SSA_NAME_DEF_STMT (t);
+ if (!def || gimple_nop_p (def))
+ return true;
+
Out of curiosity, what is T?
Because we early bail out if ssa_undefined_value_p() right before
calling SSA_NAME_DEF_STMT, and ssa_undefined_value_p() will already bail
if gimple_nop_p.
So T must be one of:
/* Parameters get their initial value from the function entry. */
else if (TREE_CODE (var) == PARM_DECL)
return false;
/* When returning by reference the return address is actually a hidden
parameter. */
else if (TREE_CODE (var) == RESULT_DECL && DECL_BY_REFERENCE (var))
return false;
/* Hard register variables get their initial value from the ether. */
else if (VAR_P (var) && DECL_HARD_REGISTER (var))
return false;
which I wonder if we should special case in is_maybe_undefined.
Aldy