public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Sebastian Huber <sebastian.huber@embedded-brains.de>
To: Jakub Jelinek <jakub@redhat.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH v2] gcov: Fix integer types in gen_counter_update()
Date: Tue, 21 Nov 2023 11:42:06 +0100	[thread overview]
Message-ID: <85faba52-baca-44e8-bec5-b76debc95701@embedded-brains.de> (raw)
In-Reply-To: <ZVyHpdUqNETckStF@tucnak>



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.

-- 
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/

  reply	other threads:[~2023-11-21 10:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-21 10:29 Sebastian Huber
2023-11-21 10:34 ` Jakub Jelinek
2023-11-21 10:42   ` Sebastian Huber [this message]
2023-11-21 10:46     ` Jakub Jelinek
2023-11-21 11:21       ` Sebastian Huber
2023-11-22 14:22         ` Christophe Lyon
2023-11-22 14:24           ` Sebastian Huber
2023-11-23  8:11             ` Jiang, Haochen
2023-11-23  8:20               ` Sebastian Huber
2023-11-23 17:29                 ` Sebastian Huber
2023-11-24 14:36                   ` Sebastian Huber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=85faba52-baca-44e8-bec5-b76debc95701@embedded-brains.de \
    --to=sebastian.huber@embedded-brains.de \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).