From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 5CC133858D33 for ; Tue, 21 Nov 2023 10:46:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5CC133858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5CC133858D33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700563572; cv=none; b=hDb9EV0Za2K0qZ6rZA8bX7n2HL9rUYy/JyOhwcEB0ag6u4ObBqt9FO/sW4JlDTLf7ERvyJU+WBj9QnyptsIwjBsQ6tpD51aWQ0ze2LiT0o9Wz3q/nJtTo/haw6rj0Ywt9OGoeQ7Yu3kR/IxVhWXHdOkFpvr/hzpugcag8Tc1uqU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700563572; c=relaxed/simple; bh=tC1RRtmXNv08ub7DA9pjpPPNP6ek1H1zAbB/FPbUnII=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=Ly/CZkWHyE6y/cqgYLaaFW9jVyePxCQWergkvM3JS0qz3ZUUAy9+RcChrWfy9AM1VEfP4nd4MTMf9FsPYDsIc2u7WjJg4uu9jWvJ9pu8oHud5tZyl0Vh9voHrhV4IBHEcHWwJB5LNOrR/yFI9JcXam/RQa7kxfoXWejqy6TI8TQ= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700563570; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=U80izaO0OH54G6PF4Rz0tPBga/0RcpttQ/a/cQ9U9i4=; b=MUAJOfF2dEUWtr7jaNjwzSUvQVyi3GXIZZyQ0ljAKaPRGwveVRrnjwIuj0r3VrmBwgTPf8 U0Uy+6e4dJcfvRdiMozkzs5lrI9XCa9Fvs0uV/SavaFkiUrMDvmcpBw9HplUoIUuykjaon 6OWU8Q4eJTAQUsuVkLynXRoV4zymQIo= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-115-JM0JS275NKmgyMBJ9sEnUw-1; Tue, 21 Nov 2023 05:46:07 -0500 X-MC-Unique: JM0JS275NKmgyMBJ9sEnUw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 55E20185A780; Tue, 21 Nov 2023 10:46:07 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.194.53]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 186F520268D0; Tue, 21 Nov 2023 10:46:06 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 3ALAk48g4110471 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 21 Nov 2023 11:46:04 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 3ALAk37E4110470; Tue, 21 Nov 2023 11:46:03 +0100 Date: Tue, 21 Nov 2023 11:46:03 +0100 From: Jakub Jelinek To: Sebastian Huber Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH v2] gcov: Fix integer types in gen_counter_update() Message-ID: Reply-To: Jakub Jelinek References: <20231121102958.53303-1-sebastian.huber@embedded-brains.de> <85faba52-baca-44e8-bec5-b76debc95701@embedded-brains.de> MIME-Version: 1.0 In-Reply-To: <85faba52-baca-44e8-bec5-b76debc95701@embedded-brains.de> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Tue, Nov 21, 2023 at 11:42:06AM +0100, Sebastian Huber wrote: > > > On 21.11.23 11:34, Jakub Jelinek wrote: > > > --- a/gcc/tree-profile.cc > > > +++ b/gcc/tree-profile.cc > > > @@ -281,10 +281,13 @@ gen_assign_counter_update (gimple_stmt_iterator *gsi, gcall *call, tree func, > > > if (result) > > > { > > > tree result_type = TREE_TYPE (TREE_TYPE (func)); > > > - tree tmp = make_temp_ssa_name (result_type, NULL, name); > > > - gimple_set_lhs (call, tmp); > > > + tree tmp1 = make_temp_ssa_name (result_type, NULL, name); > > > + gimple_set_lhs (call, tmp1); > > > gsi_insert_after (gsi, call, GSI_NEW_STMT); > > > - gassign *assign = gimple_build_assign (result, tmp); > > > + tree tmp2 = make_ssa_name (TREE_TYPE (result)); > > > + gassign *assign = gimple_build_assign (tmp2, NOP_EXPR, tmp1); > > > + gsi_insert_after (gsi, assign, GSI_NEW_STMT); > > > + assign = gimple_build_assign (result, gimple_assign_lhs (assign)); > > When you use a temporary tmp2 for the lhs of the conversion, you can just > > use it here, > > assign = gimple_build_assign (result, tmp2); > > > > Ok for trunk with that change. > > Just a question, could I also use > > tree tmp2 = make_temp_ssa_name (TREE_TYPE (result), NULL, name); > > ? > > This make_temp_ssa_name() is used throughout the file and the new > make_ssa_name() would be the first use in this file. Yes. The only difference is that it won't be _234 = (type) something; but PROF_time_profile_234 = (type) something; in the dumps, but sure, consistency is useful. Jakub