From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2049) id 52BA03836030; Fri, 6 May 2022 14:45:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 52BA03836030 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Matthew Malcomson To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/vendors/ARM/heads/morello)] Pretty-print IFN_REPLACE_ADDRESS_VALUE X-Act-Checkin: gcc X-Git-Author: Richard Sandiford X-Git-Refname: refs/vendors/ARM/heads/morello X-Git-Oldrev: f33457b9832988e34fb7e5bb6f5b1261aeb3637a X-Git-Newrev: cd602fea43877dbe5a68f79f457174f818f4c447 Message-Id: <20220506144511.52BA03836030@sourceware.org> Date: Fri, 6 May 2022 14:45:11 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2022 14:45:11 -0000 https://gcc.gnu.org/g:cd602fea43877dbe5a68f79f457174f818f4c447 commit cd602fea43877dbe5a68f79f457174f818f4c447 Author: Richard Sandiford Date: Wed Apr 27 20:11:40 2022 +0100 Pretty-print IFN_REPLACE_ADDRESS_VALUE This patch tries to pretty-print IFN_REPLACE_ADDRESS_VALUE calls as casts, which is what they represent from the user's point of view. Previously we would crash when trying to print the (null) CALL_EXPR_FN. Diff: --- gcc/c-family/c-pretty-print.c | 6 ++++++ gcc/testsuite/gcc.target/aarch64/morello/cond-expr-1.c | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/gcc/c-family/c-pretty-print.c b/gcc/c-family/c-pretty-print.c index 8fc96a486bd..c225e1e3be7 100644 --- a/gcc/c-family/c-pretty-print.c +++ b/gcc/c-family/c-pretty-print.c @@ -1512,6 +1512,12 @@ c_pretty_printer::postfix_expression (tree e) case CALL_EXPR: { + if (CALL_EXPR_IFN (e) == IFN_REPLACE_ADDRESS_VALUE) + { + pp_c_type_cast (this, TREE_TYPE (e)); + pp_c_cast_expression (this, CALL_EXPR_ARG (e, 1)); + break; + } call_expr_arg_iterator iter; tree arg; postfix_expression (CALL_EXPR_FN (e)); diff --git a/gcc/testsuite/gcc.target/aarch64/morello/cond-expr-1.c b/gcc/testsuite/gcc.target/aarch64/morello/cond-expr-1.c new file mode 100644 index 00000000000..c4ba9cefbdc --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/morello/cond-expr-1.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-fno-diagnostics-show-caret" } */ + +void foo4(char *__capability p, char *q) +{ + (p < q ? p : q)(); /* { dg-error "is not a function" } */ + (p > q ? p : q)(); /* { dg-error "is not a function" } */ +}