public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Patch to fix PR93561
@ 2020-02-06 22:16 Vladimir Makarov
  2020-02-07 21:46 ` Segher Boessenkool
  0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Makarov @ 2020-02-06 22:16 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 141 bytes --]

The following patch fixes

   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93561

The patch was successfully bootstrapped on x86-64.


[-- Attachment #2: pr93561.patch --]
[-- Type: text/x-patch, Size: 1116 bytes --]

commit d26f37a16e3ed3d75a93ffb1da10c44c36a8a36d (HEAD -> master)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1754aa76399..aec58a06529 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2020-02-06  <zhongyunde@huawei.com>
+  	    Vladimir Makarov  <vmakarov@redhat.com>
+
+	PR rtl-optimization/93561
+	* lra-assigns.c (spill_for): Check that tested hard regno is not out of
+	hard register range.
+
 2020-02-06  Richard Sandiford  <richard.sandiford@arm.com>
 
 	* config/aarch64/aarch64.md (aarch64_movk<mode>): Add a type
diff --git a/gcc/lra-assigns.c b/gcc/lra-assigns.c
index 031ce402c32..40e323c2a64 100644
--- a/gcc/lra-assigns.c
+++ b/gcc/lra-assigns.c
@@ -964,6 +964,8 @@ spill_for (int regno, bitmap spilled_pseudo_bitmap, bool first_p)
       bitmap_clear (&spill_pseudos_bitmap);
       for (j = hard_regno_nregs (hard_regno, mode) - 1; j >= 0; j--)
 	{
+          if (hard_regno + j >= FIRST_PSEUDO_REGISTER)
+	    break;
 	  if (try_hard_reg_pseudos_check[hard_regno + j] != curr_pseudo_check)
 	    continue;
 	  lra_assert (!bitmap_empty_p (&try_hard_reg_pseudos[hard_regno + j]));

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Patch to fix PR93561
  2020-02-06 22:16 Patch to fix PR93561 Vladimir Makarov
@ 2020-02-07 21:46 ` Segher Boessenkool
  0 siblings, 0 replies; 2+ messages in thread
From: Segher Boessenkool @ 2020-02-07 21:46 UTC (permalink / raw)
  To: Vladimir Makarov; +Cc: gcc-patches

Hi!

On Thu, Feb 06, 2020 at 05:16:14PM -0500, Vladimir Makarov wrote:
> --- a/gcc/lra-assigns.c
> +++ b/gcc/lra-assigns.c
> @@ -964,6 +964,8 @@ spill_for (int regno, bitmap spilled_pseudo_bitmap, bool first_p)
>        bitmap_clear (&spill_pseudos_bitmap);
>        for (j = hard_regno_nregs (hard_regno, mode) - 1; j >= 0; j--)
>  	{
> +          if (hard_regno + j >= FIRST_PSEUDO_REGISTER)
> +	    break;

if (!HARD_REGISTER_NUM_P (hard_regno + j))
?


Segher

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-02-07 21:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-06 22:16 Patch to fix PR93561 Vladimir Makarov
2020-02-07 21:46 ` Segher Boessenkool

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).