tree expr = c_parser_expr_no_commas (parser, NULL).value;
expr = c_fully_fold (expr, false, NULL);
- if (!TREE_TYPE (expr)
- || !TREE_CONSTANT (expr)
- || !INTEGRAL_TYPE_P (TREE_TYPE (expr)))
- error_at (loc, "vectorlength must be an integer constant");
+ /* If expr is an error_mark_node then the above function would have
+ emitted an error. No reason to do it twice. */
+ if (expr == error_mark_node)
+ ;
+ else if (!TREE_TYPE (expr)
+ || !TREE_CONSTANT (expr)
+ || !INTEGRAL_TYPE_P (TREE_TYPE (expr)))
+
+ error_at (loc, "vectorlength must be an integer constant");
- else if (exact_log2 (TREE_INT_CST_LOW (expr)) == -1)
+ else if (wi::exact_log2 (expr) == -1)
error_at (loc, "vectorlength must be a power of 2");
else
{