From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1110546-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 8FD78138334
	for <garchives@archives.gentoo.org>; Thu, 12 Sep 2019 21:55:04 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id CF0A9E0CA8;
	Thu, 12 Sep 2019 21:55:03 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 98A2AE0CA8
	for <gentoo-commits@lists.gentoo.org>; Thu, 12 Sep 2019 21:55:03 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 6295B34AD9B
	for <gentoo-commits@lists.gentoo.org>; Thu, 12 Sep 2019 21:55:02 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 854A5615
	for <gentoo-commits@lists.gentoo.org>; Thu, 12 Sep 2019 21:55:00 +0000 (UTC)
From: "Sergei Trofimovich" <slyfox@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Sergei Trofimovich" <slyfox@gentoo.org>
Message-ID: <1568325212.9bd463dc1be0f9cf00924b50767db97088237b1d.slyfox@gentoo>
Subject: [gentoo-commits] proj/gcc-patches:master commit in: 9.2.0/gentoo/
X-VCS-Repository: proj/gcc-patches
X-VCS-Files: 9.2.0/gentoo/27_all_sparc-PIC-constant-PR91472.patch 9.2.0/gentoo/README.history
X-VCS-Directories: 9.2.0/gentoo/
X-VCS-Committer: slyfox
X-VCS-Committer-Name: Sergei Trofimovich
X-VCS-Revision: 9bd463dc1be0f9cf00924b50767db97088237b1d
X-VCS-Branch: master
Date: Thu, 12 Sep 2019 21:55:00 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 984889ff-2a77-49fa-af98-88c356b619e9
X-Archives-Hash: 90872ad494163a30edda5e0a95d16ce6

commit:     9bd463dc1be0f9cf00924b50767db97088237b1d
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 12 21:53:32 2019 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Thu Sep 12 21:53:32 2019 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=9bd463dc

9.2.0: backport 27_all_sparc-PIC-constant-PR91472.patch

Fix gmp test suite failures.

Bug: https://gcc.gnu.org/PR91472
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 .../gentoo/27_all_sparc-PIC-constant-PR91472.patch | 83 ++++++++++++++++++++++
 9.2.0/gentoo/README.history                        |  3 +
 2 files changed, 86 insertions(+)

diff --git a/9.2.0/gentoo/27_all_sparc-PIC-constant-PR91472.patch b/9.2.0/gentoo/27_all_sparc-PIC-constant-PR91472.patch
new file mode 100644
index 0000000..aeacdde
--- /dev/null
+++ b/9.2.0/gentoo/27_all_sparc-PIC-constant-PR91472.patch
@@ -0,0 +1,83 @@
+https://gcc.gnu.org/PR91472
+Fix gmp test suite failrues.
+
+From 0a09a00c87081e0a8d1d382b33bb0b1ec03875e7 Mon Sep 17 00:00:00 2001
+From: ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Sun, 1 Sep 2019 12:55:22 +0000
+Subject: [PATCH] 	PR target/91472 	* config/sparc/sparc.c
+ (sparc_cannot_force_const_mem): Return true 	during LRA/reload in PIC mode
+ if the PIC register hasn't been used yet. 	(sparc_pic_register_p): Test
+ reload_in_progress for consistency's sake.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@275270 138bc75d-0d04-0410-961f-82ee72b054a4
+---
+ gcc/config/sparc/sparc.c                      |  9 ++++-
+ .../gcc.c-torture/execute/20190901-1.c        | 36 +++++++++++++++++++
+
+--- a/gcc/config/sparc/sparc.c
++++ b/gcc/config/sparc/sparc.c
+@@ -4201,6 +4201,13 @@ eligible_for_sibcall_delay (rtx_insn *trial)
+ static bool
+ sparc_cannot_force_const_mem (machine_mode mode, rtx x)
+ {
++  /* After IRA has run in PIC mode, it is too late to put anything into the
++     constant pool if the PIC register hasn't already been initialized.  */
++  if ((lra_in_progress || reload_in_progress)
++      && flag_pic
++      && !crtl->uses_pic_offset_table)
++    return true;
++
+   switch (GET_CODE (x))
+     {
+     case CONST_INT:
+@@ -4450,7 +4457,7 @@ sparc_pic_register_p (rtx x)
+     return true;
+ 
+   if (!HARD_REGISTER_P (pic_offset_table_rtx)
+-      && (HARD_REGISTER_P (x) || lra_in_progress)
++      && (HARD_REGISTER_P (x) || lra_in_progress || reload_in_progress)
+       && ORIGINAL_REGNO (x) == REGNO (pic_offset_table_rtx))
+     return true;
+ 
+--- /dev/null
++++ b/gcc/testsuite/gcc.c-torture/execute/20190901-1.c
+@@ -0,0 +1,36 @@
++/* PR target/91472 */
++/* Reported by John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> */
++
++typedef unsigned int gmp_uint_least32_t;
++
++union ieee_double_extract
++{
++  struct
++    {
++      gmp_uint_least32_t sig:1;
++      gmp_uint_least32_t exp:11;
++      gmp_uint_least32_t manh:20;
++      gmp_uint_least32_t manl:32;
++    } s;
++  double d;
++};
++
++double __attribute__((noipa))
++tests_infinity_d (void)
++{
++  union ieee_double_extract x;
++  x.s.exp = 2047;
++  x.s.manl = 0;
++  x.s.manh = 0;
++  x.s.sig = 0;
++  return x.d;
++}
++
++int
++main (void)
++{
++  double x = tests_infinity_d ();
++  if (x == 0.0)
++    __builtin_abort ();
++  return 0;
++}
+-- 
+2.23.0
+

diff --git a/9.2.0/gentoo/README.history b/9.2.0/gentoo/README.history
index ae5ec16..c34d76c 100644
--- a/9.2.0/gentoo/README.history
+++ b/9.2.0/gentoo/README.history
@@ -1,3 +1,6 @@
+2		TODO
+	+ 27_all_sparc-PIC-constant-PR91472.patch
+
 1		12 Aug 2019
 	+ 01_all_default-fortify-source.patch
 	+ 02_all_default-warn-format-security.patch