From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2049) id 5D530385E010; Mon, 14 Mar 2022 10:35:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5D530385E010 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)] morello: Don't treat TYPE_P nodes as capability values X-Act-Checkin: gcc X-Git-Author: Alex Coplan X-Git-Refname: refs/vendors/ARM/heads/morello X-Git-Oldrev: 2d8563f71110a9dfe2d177180178e98e2b5598c7 X-Git-Newrev: 473121a7071e99c7953002b8e0103688bd1ba3a3 Message-Id: <20220314103517.5D530385E010@sourceware.org> Date: Mon, 14 Mar 2022 10:35:17 +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: Mon, 14 Mar 2022 10:35:17 -0000 https://gcc.gnu.org/g:473121a7071e99c7953002b8e0103688bd1ba3a3 commit 473121a7071e99c7953002b8e0103688bd1ba3a3 Author: Alex Coplan Date: Fri Feb 11 14:23:46 2022 +0000 morello: Don't treat TYPE_P nodes as capability values Return false in tree_is_capability_value for TYPE_P tree nodes: these are not capability *values*. The C++ frontend often ends up with types where we expect a value when doing template substitution, we don't want to treat these as capability values. gcc/ChangeLog: * tree.h (tree_is_capability_value): Return false if argument is TYPE_P. Diff: --- gcc/tree.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/tree.h b/gcc/tree.h index c2fbd1eccdf..674eb1acf64 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -6366,7 +6366,10 @@ fndecl_built_in_p (const_tree node, built_in_function name) static inline bool tree_is_capability_value (const_tree t) { - return t && t != error_mark_node && capability_type_p (TREE_TYPE (t)); + return t + && t != error_mark_node + && !TYPE_P (t) + && capability_type_p (TREE_TYPE (t)); } inline wide_int