From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2140) id 6E1AA3858C2C; Thu, 24 Mar 2022 02:57:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6E1AA3858C2C Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Alexandre Oliva To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/aoliva/heads/testme)] hardened conditionals: drop copied identifiers X-Act-Checkin: gcc X-Git-Author: Alexandre Oliva X-Git-Refname: refs/users/aoliva/heads/testme X-Git-Oldrev: 361f4fcac4d9e948d22bb7ad87a0251aef5b03e0 X-Git-Newrev: f4a30f6d78095d77a8d8b39bde03b08ab8824132 Message-Id: <20220324025753.6E1AA3858C2C@sourceware.org> Date: Thu, 24 Mar 2022 02:57:53 +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: Thu, 24 Mar 2022 02:57:53 -0000 https://gcc.gnu.org/g:f4a30f6d78095d77a8d8b39bde03b08ab8824132 commit f4a30f6d78095d77a8d8b39bde03b08ab8824132 Author: Alexandre Oliva Date: Wed Mar 23 23:47:04 2022 -0300 hardened conditionals: drop copied identifiers The copies of identifiers, indended to associate hardening SSA temporaries to the original variables they refer to, end up causing -fcompare-debug to fail, because DECL_UIDs are not identical, and the nouid flag used in compare-debug dumps doesn't affect the uids in naked identifiers, so the divergence becomes apparent. This patch drops the naked identifiers. Though somewhat desirable, they're not necessary. for gcc/ChangeLog PR debug/104564 * gimple-harden-conditionals.cc (detach_value): Keep temps anonymous. Diff: --- gcc/gimple-harden-conditionals.cc | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/gcc/gimple-harden-conditionals.cc b/gcc/gimple-harden-conditionals.cc index be01f3ea8c4..c7e5e077a74 100644 --- a/gcc/gimple-harden-conditionals.cc +++ b/gcc/gimple-harden-conditionals.cc @@ -126,14 +126,11 @@ detach_value (location_t loc, gimple_stmt_iterator *gsip, tree val) return val; } - /* Create a SSA "copy" of VAL. This could be an anonymous - temporary, but it's nice to have it named after the corresponding - variable. Alas, when VAL is a DECL_BY_REFERENCE RESULT_DECL, - setting (a copy of) it would be flagged by checking, so we don't - use copy_ssa_name: we create an anonymous SSA name, and then give - it the same identifier (rather than decl) as VAL. */ + /* Create a SSA "copy" of VAL. It would be nice to have it named + after the corresponding variable, but sharing the same decl is + problematic when VAL is a DECL_BY_REFERENCE RESULT_DECL, and + copying just the identifier hits -fcompare-debug failures. */ tree ret = make_ssa_name (TREE_TYPE (val)); - SET_SSA_NAME_VAR_OR_IDENTIFIER (ret, SSA_NAME_IDENTIFIER (val)); /* Some modes won't fit in general regs, so we fall back to memory for them. ??? It would be ideal to try to identify an alternate,