The following handles internal function calls similar to how the
C++ frontend does, avoiding ICEing on those.
2022-02-14 Richard Biener <rguenther@suse.de>
PR c/104505
gcc/c-family/
* c-pretty-print.cc (c_pretty_printer::postfix_expression): Handle
internal function calls.
gcc/testsuite/
* c-c++-common/pr104505.c: New testcase.
#include "selftest.h"
#include "langhooks.h"
#include "options.h"
+#include "internal-fn.h"
/* The pretty-printer code is primarily designed to closely follow
(GNU) C and C++ grammars. That is to be contrasted with spaghetti
{
call_expr_arg_iterator iter;
tree arg;
- postfix_expression (CALL_EXPR_FN (e));
+ if (CALL_EXPR_FN (e) != NULL_TREE)
+ postfix_expression (CALL_EXPR_FN (e));
+ else
+ pp_string (this, internal_fn_name (CALL_EXPR_IFN (e)));
pp_c_left_paren (this);
FOR_EACH_CALL_EXPR_ARG (arg, iter, e)
{
--- /dev/null
+/* { dg-do compile } */
+
+typedef char __attribute__((__vector_size__ (8))) U;
+typedef short __attribute__((__vector_size__ (16))) V;
+
+U u;
+
+void
+foo (V v)
+{
+ u = __builtin_shufflevector (u, u, __builtin_convertvector (v, U)); /* { dg-error "invalid element index" } */
+}