Message ID | alpine.DEB.2.02.1310312350470.7246@stedding.saclay.inria.fr |
---|---|
State | New |
Headers | show |
On 10/31/2013 07:03 PM, Marc Glisse wrote:
> * pt.c (value_dependent_expression_p): Handle null argument.
What is calling this with a null argument? The recursive call near the
end of the function checks for null there.
Jason
On Fri, 1 Nov 2013, Jason Merrill wrote: > On 10/31/2013 07:03 PM, Marc Glisse wrote: >> * pt.c (value_dependent_expression_p): Handle null argument. > > What is calling this with a null argument? The recursive call near the end > of the function checks for null there. See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58834 for details. It is build_x_vec_perm_expr that calls it with a null argument (when we call __builtin_shuffle with 2 arguments, it adds a NULL argument in second position). I can make it not call value_dependent_expression_p with a null argument, but it seems more general to let value_dependent_expression_p handle 0 like a number of other functions already do.
On 11/01/2013 11:13 AM, Marc Glisse wrote: > position). I can make it not call value_dependent_expression_p with a > null argument, but it seems more general to let > value_dependent_expression_p handle 0 like a number of other functions > already do. OK. But the change is to type_..., not value_..., so please correct the ChangeLog entry. Jason
On Fri, 1 Nov 2013, Jason Merrill wrote: > On 11/01/2013 11:13 AM, Marc Glisse wrote: >> position). I can make it not call value_dependent_expression_p with a >> null argument, but it seems more general to let >> value_dependent_expression_p handle 0 like a number of other functions >> already do. > > OK. But the change is to type_..., not value_..., so please correct the > ChangeLog entry. Oops, I didn't check closely enough the output of diff -p. Thanks.
Index: gcc/cp/pt.c =================================================================== --- gcc/cp/pt.c (revision 204279) +++ gcc/cp/pt.c (working copy) @@ -20499,21 +20499,21 @@ value_dependent_expression_p (tree expre considered dependent. Other parts of the compiler arrange for an expression with type-dependent subexpressions to have no type, so this function doesn't have to be fully recursive. */ bool type_dependent_expression_p (tree expression) { if (!processing_template_decl) return false; - if (expression == error_mark_node) + if (expression == NULL_TREE || expression == error_mark_node) return false; /* An unresolved name is always dependent. */ if (identifier_p (expression) || TREE_CODE (expression) == USING_DECL) return true; /* Some expression forms are never type-dependent. */ if (TREE_CODE (expression) == PSEUDO_DTOR_EXPR || TREE_CODE (expression) == SIZEOF_EXPR || TREE_CODE (expression) == ALIGNOF_EXPR Index: gcc/testsuite/g++.dg/ext/pr58834.C =================================================================== --- gcc/testsuite/g++.dg/ext/pr58834.C (revision 0) +++ gcc/testsuite/g++.dg/ext/pr58834.C (working copy) @@ -0,0 +1,5 @@ +template<typename> void foo() +{ + int i __attribute__((vector_size(2*sizeof(int)))); + (void) __builtin_shuffle(i, i); +}