This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Handle GIMPLE NOPs in is_maybe_undefined (PR, tree-optimization/79529).


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]