This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PR tree-optimization/45605
> > *** varpool.c (revision 164523)
> > --- varpool.c (working copy)
> > *************** const_value_known_p (tree decl)
> > *** 368,374 ****
> > struct varpool_node *vnode;
> >
> > if (TREE_CODE (decl) == PARM_DECL
> > ! || TREE_CODE (decl) == RESULT_DECL)
> > return false;
> >
> > if (TREE_CODE (decl) == CONST_DECL
> > --- 368,375 ----
> > struct varpool_node *vnode;
> >
> > if (TREE_CODE (decl) == PARM_DECL
> > ! || TREE_CODE (decl) == RESULT_DECL
> > ! || TREE_CODE (decl) == DEBUG_EXPR_DECL)
> > return false;
>
> What about other DECL_Ps, like FUNCTION_DECL, LABEL_DECL,
> etc., are you sure they never hit this function?
Hmm, i was thinking of FUNCTION_DECL and concluded that they should not appear
in memory references, but I guess for some sick testcases with some of view
converts they can.
I will change the test to test for VAR_DECL and CONST_DECL only. Originally I
wanted to have some sanity checking that we are not calling function in wrong
context, but I guess it is safer to just test for decls where DECL_INITIAL is
defined and has intended behaviour.
I updated it in the patch I am testing and intend to commit it once
testing converges.
>
> Jakub