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: [tuples] [patch] Fix in_phi in verify_expr


On Tue, Apr 1, 2008 at 3:46 PM, Diego Novillo <dnovillo@google.com> wrote:
> On Tue, Apr 1, 2008 at 10:39, Rafael Espindola <espindola@google.com> wrote:
>
>  >  I think we can. Something like the attached patch is what you have in mind?
>
>  Not quite.  The test for gimple_val is already there (right above the
>  code you just added).  The only test you need to bring from
>  verify_expr is the check for the free list in the case of an SSA_NAME:
>
>  ...
>  else if (TREE_CODE (t) == SSA_NAME
>            && SSA_NAME_IN_FREE_LIST (t))
>   {
>      error ("....
>  ...

Actually you do not need to walk the tree for t at all.  In fact, PHI arguments
need to be either SSA_NAMEs or is_gimple_min_invariant ()s.  So

              /* Addressable variables do have SSA_NAMEs but they
                 are not considered gimple values.  */
              else if (TREE_CODE (t) != SSA_NAME
                       && TREE_CODE (t) != FUNCTION_DECL
                       && !is_gimple_val (t))
                {

just becomes

              /* Addressable variables do have SSA_NAMEs but they
                 are not considered gimple values.  */
              else if (TREE_CODE (t) != SSA_NAME
                       && TREE_CODE (t) != FUNCTION_DECL
                       && !is_gimple_min_invariant (t))
                {

(no idea where this FUNCTION_DECL is for - we should only see addresses
of functions here?)

Adding the SSA_NAME freelist test there is no need to further walk t at all
(apart from for verify_node_sharing).

Richard.


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