From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1851) id 1693F3854803; Mon, 31 May 2021 09:28:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1693F3854803 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Martin Liska To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-1129] LTO: stream properly FUNCTION_DECL_DECL_TYPE. X-Act-Checkin: gcc X-Git-Author: Martin Liska X-Git-Refname: refs/heads/master X-Git-Oldrev: ef8176e0fac935c095cc39f4ecdfd43cdb8cb3f3 X-Git-Newrev: 21d7bba242f1a7349adc6a57aa4c874f7bb159f8 Message-Id: <20210531092851.1693F3854803@sourceware.org> Date: Mon, 31 May 2021 09:28:51 +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, 31 May 2021 09:28:51 -0000 https://gcc.gnu.org/g:21d7bba242f1a7349adc6a57aa4c874f7bb159f8 commit r12-1129-g21d7bba242f1a7349adc6a57aa4c874f7bb159f8 Author: Martin Liska Date: Mon May 24 11:18:21 2021 +0200 LTO: stream properly FUNCTION_DECL_DECL_TYPE. gcc/lto/ChangeLog: * lto-common.c (compare_tree_sccs_1): Compare FUNCTION_DECL_DECL_TYPE. gcc/ChangeLog: * tree-streamer-in.c (unpack_ts_function_decl_value_fields): Unpack FUNCTION_DECL_DECL_TYPE. * tree-streamer-out.c (pack_ts_function_decl_value_fields): Stream FUNCTION_DECL_DECL_TYPE instead of DECL_IS_OPERATOR_NEW_P. * tree.h (set_function_decl_type): Use FUNCTION_DECL_DECL_TYPE macro. (DECL_IS_OPERATOR_NEW_P): Likewise. (DECL_IS_OPERATOR_DELETE_P): Likewise. (DECL_LAMBDA_FUNCTION_P): Likewise. Diff: --- gcc/lto/lto-common.c | 2 +- gcc/tree-streamer-in.c | 2 +- gcc/tree-streamer-out.c | 2 +- gcc/tree.h | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gcc/lto/lto-common.c b/gcc/lto/lto-common.c index 02d16f49c11..bfe52a2e942 100644 --- a/gcc/lto/lto-common.c +++ b/gcc/lto/lto-common.c @@ -1235,7 +1235,7 @@ compare_tree_sccs_1 (tree t1, tree t2, tree **map) compare_values (DECL_IS_NOVOPS); compare_values (DECL_IS_RETURNS_TWICE); compare_values (DECL_IS_MALLOC); - compare_values (DECL_IS_OPERATOR_NEW_P); + compare_values (FUNCTION_DECL_DECL_TYPE); compare_values (DECL_DECLARED_INLINE_P); compare_values (DECL_STATIC_CHAIN); compare_values (DECL_NO_INLINE_WARNING_P); diff --git a/gcc/tree-streamer-in.c b/gcc/tree-streamer-in.c index 984b1e269cf..e0522bf2ac1 100644 --- a/gcc/tree-streamer-in.c +++ b/gcc/tree-streamer-in.c @@ -333,7 +333,7 @@ unpack_ts_function_decl_value_fields (struct bitpack_d *bp, tree expr) DECL_IS_NOVOPS (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_IS_RETURNS_TWICE (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_IS_MALLOC (expr) = (unsigned) bp_unpack_value (bp, 1); - DECL_SET_IS_OPERATOR_NEW (expr, (unsigned) bp_unpack_value (bp, 1)); + FUNCTION_DECL_DECL_TYPE (expr) = (function_decl_type) bp_unpack_value (bp, 2); DECL_SET_IS_OPERATOR_DELETE (expr, (unsigned) bp_unpack_value (bp, 1)); DECL_DECLARED_INLINE_P (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_STATIC_CHAIN (expr) = (unsigned) bp_unpack_value (bp, 1); diff --git a/gcc/tree-streamer-out.c b/gcc/tree-streamer-out.c index 1a43534d117..855d1cd59b9 100644 --- a/gcc/tree-streamer-out.c +++ b/gcc/tree-streamer-out.c @@ -298,7 +298,7 @@ pack_ts_function_decl_value_fields (struct bitpack_d *bp, tree expr) bp_pack_value (bp, DECL_IS_NOVOPS (expr), 1); bp_pack_value (bp, DECL_IS_RETURNS_TWICE (expr), 1); bp_pack_value (bp, DECL_IS_MALLOC (expr), 1); - bp_pack_value (bp, DECL_IS_OPERATOR_NEW_P (expr), 1); + bp_pack_value (bp, FUNCTION_DECL_DECL_TYPE (expr), 2); bp_pack_value (bp, DECL_IS_OPERATOR_DELETE_P (expr), 1); bp_pack_value (bp, DECL_DECLARED_INLINE_P (expr), 1); bp_pack_value (bp, DECL_STATIC_CHAIN (expr), 1); diff --git a/gcc/tree.h b/gcc/tree.h index 5935d0e9f7c..260a3ae6c83 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -3111,7 +3111,7 @@ set_function_decl_type (tree decl, function_decl_type t, bool set) { gcc_assert (FUNCTION_DECL_DECL_TYPE (decl) == NONE || FUNCTION_DECL_DECL_TYPE (decl) == t); - decl->function_decl.decl_type = t; + FUNCTION_DECL_DECL_TYPE (decl) = t; } else if (FUNCTION_DECL_DECL_TYPE (decl) == t) FUNCTION_DECL_DECL_TYPE (decl) = NONE; @@ -3126,7 +3126,7 @@ set_function_decl_type (tree decl, function_decl_type t, bool set) C++ operator new, meaning that it returns a pointer for which we should not use type based aliasing. */ #define DECL_IS_OPERATOR_NEW_P(NODE) \ - (FUNCTION_DECL_CHECK (NODE)->function_decl.decl_type == OPERATOR_NEW) + (FUNCTION_DECL_DECL_TYPE (FUNCTION_DECL_CHECK (NODE)) == OPERATOR_NEW) #define DECL_IS_REPLACEABLE_OPERATOR_NEW_P(NODE) \ (DECL_IS_OPERATOR_NEW_P (NODE) && DECL_IS_REPLACEABLE_OPERATOR (NODE)) @@ -3137,7 +3137,7 @@ set_function_decl_type (tree decl, function_decl_type t, bool set) /* Nonzero in a FUNCTION_DECL means this function should be treated as C++ operator delete. */ #define DECL_IS_OPERATOR_DELETE_P(NODE) \ - (FUNCTION_DECL_CHECK (NODE)->function_decl.decl_type == OPERATOR_DELETE) + (FUNCTION_DECL_DECL_TYPE (FUNCTION_DECL_CHECK (NODE)) == OPERATOR_DELETE) #define DECL_SET_IS_OPERATOR_DELETE(NODE, VAL) \ set_function_decl_type (FUNCTION_DECL_CHECK (NODE), OPERATOR_DELETE, VAL) @@ -3288,7 +3288,7 @@ extern vec **decl_debug_args_insert (tree); /* In FUNCTION_DECL, this is set if this function is a lambda function. */ #define DECL_LAMBDA_FUNCTION_P(NODE) \ - (FUNCTION_DECL_CHECK (NODE)->function_decl.decl_type == LAMBDA_FUNCTION) + (FUNCTION_DECL_DECL_TYPE (FUNCTION_DECL_CHECK (NODE)) == LAMBDA_FUNCTION) #define DECL_SET_LAMBDA_FUNCTION(NODE, VAL) \ set_function_decl_type (FUNCTION_DECL_CHECK (NODE), LAMBDA_FUNCTION, VAL)