public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: gcc-patches@gcc.gnu.org, Andreas Krebbel <krebbel@linux.vnet.ibm.com>
Subject: Re: [PATCH] S390: Hotpatching fixes.
Date: Thu, 26 Mar 2015 20:56:00 -0000	[thread overview]
Message-ID: <20150326205630.GH1746@tucnak.redhat.com> (raw)
In-Reply-To: <20150309121938.GA11867@linux.vnet.ibm.com>

Hi!

On Mon, Mar 09, 2015 at 01:19:38PM +0100, Dominik Vogt wrote:
> @@ -11368,6 +11349,7 @@ static void
>  s390_reorg (void)
>  {
>    bool pool_overflow = false;
> +  int hw_before, hw_after;
>  
>    /* Make sure all splits have been performed; splits after
>       machine_dependent_reorg might confuse insn length counts.  */
> @@ -11503,6 +11485,40 @@ s390_reorg (void)
>        if (insn_added_p)
>  	shorten_branches (get_insns ());
>      }
> +
> +  s390_function_num_hotpatch_hw (current_function_decl, &hw_before, &hw_after);
> +  if (hw_after > 0)

Two minor issues, both for nested functions:

1) the s390_function_num_hotpatch_hw assigns to ints whose addresses are
passed as arguments, even when it later decides to return false and in this
spot you ignore the return value.  Which means that hw_after could be
non-zero, even when you should be ignoring it.
So, either you should check above the return value too, or
change s390_function_num_hotpatch_hw so that it stores 0 for the nested
functions before returning false.

2) as s390_function_num_hotpatch_hw is now called twice for the same
function, for nested functions you'll get the warning reported twice too.
Perhaps add some additional argument whether you want the warning or not
and use it in one of the callers and not in the other one?
Plus supposedly add testsuite coverage for that.

	Jakub

  reply	other threads:[~2015-03-26 20:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-05 12:40 Dominik Vogt
2015-03-09 11:22 ` Dominik Vogt
2015-03-09 11:30   ` Jakub Jelinek
2015-03-09 12:19   ` Dominik Vogt
2015-03-26 20:56     ` Jakub Jelinek [this message]
2015-03-27  9:30       ` Andreas Krebbel
2015-03-27  9:37         ` Jakub Jelinek

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=20150326205630.GH1746@tucnak.redhat.com \
    --to=jakub@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=krebbel@linux.vnet.ibm.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).