Gentoo Archives: gentoo-commits

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/gcc-patches:master commit in: 9.2.0/gentoo/
Date: Thu, 12 Sep 2019 21:55:04
Message-Id: 1568325212.9bd463dc1be0f9cf00924b50767db97088237b1d.slyfox@gentoo
1 commit: 9bd463dc1be0f9cf00924b50767db97088237b1d
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Thu Sep 12 21:53:32 2019 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Thu Sep 12 21:53:32 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=9bd463dc
7
8 9.2.0: backport 27_all_sparc-PIC-constant-PR91472.patch
9
10 Fix gmp test suite failures.
11
12 Bug: https://gcc.gnu.org/PR91472
13 Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
14
15 .../gentoo/27_all_sparc-PIC-constant-PR91472.patch | 83 ++++++++++++++++++++++
16 9.2.0/gentoo/README.history | 3 +
17 2 files changed, 86 insertions(+)
18
19 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
20 new file mode 100644
21 index 0000000..aeacdde
22 --- /dev/null
23 +++ b/9.2.0/gentoo/27_all_sparc-PIC-constant-PR91472.patch
24 @@ -0,0 +1,83 @@
25 +https://gcc.gnu.org/PR91472
26 +Fix gmp test suite failrues.
27 +
28 +From 0a09a00c87081e0a8d1d382b33bb0b1ec03875e7 Mon Sep 17 00:00:00 2001
29 +From: ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
30 +Date: Sun, 1 Sep 2019 12:55:22 +0000
31 +Subject: [PATCH] PR target/91472 * config/sparc/sparc.c
32 + (sparc_cannot_force_const_mem): Return true during LRA/reload in PIC mode
33 + if the PIC register hasn't been used yet. (sparc_pic_register_p): Test
34 + reload_in_progress for consistency's sake.
35 +
36 +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@275270 138bc75d-0d04-0410-961f-82ee72b054a4
37 +---
38 + gcc/config/sparc/sparc.c | 9 ++++-
39 + .../gcc.c-torture/execute/20190901-1.c | 36 +++++++++++++++++++
40 +
41 +--- a/gcc/config/sparc/sparc.c
42 ++++ b/gcc/config/sparc/sparc.c
43 +@@ -4201,6 +4201,13 @@ eligible_for_sibcall_delay (rtx_insn *trial)
44 + static bool
45 + sparc_cannot_force_const_mem (machine_mode mode, rtx x)
46 + {
47 ++ /* After IRA has run in PIC mode, it is too late to put anything into the
48 ++ constant pool if the PIC register hasn't already been initialized. */
49 ++ if ((lra_in_progress || reload_in_progress)
50 ++ && flag_pic
51 ++ && !crtl->uses_pic_offset_table)
52 ++ return true;
53 ++
54 + switch (GET_CODE (x))
55 + {
56 + case CONST_INT:
57 +@@ -4450,7 +4457,7 @@ sparc_pic_register_p (rtx x)
58 + return true;
59 +
60 + if (!HARD_REGISTER_P (pic_offset_table_rtx)
61 +- && (HARD_REGISTER_P (x) || lra_in_progress)
62 ++ && (HARD_REGISTER_P (x) || lra_in_progress || reload_in_progress)
63 + && ORIGINAL_REGNO (x) == REGNO (pic_offset_table_rtx))
64 + return true;
65 +
66 +--- /dev/null
67 ++++ b/gcc/testsuite/gcc.c-torture/execute/20190901-1.c
68 +@@ -0,0 +1,36 @@
69 ++/* PR target/91472 */
70 ++/* Reported by John Paul Adrian Glaubitz <glaubitz@××××××××××××××××.de> */
71 ++
72 ++typedef unsigned int gmp_uint_least32_t;
73 ++
74 ++union ieee_double_extract
75 ++{
76 ++ struct
77 ++ {
78 ++ gmp_uint_least32_t sig:1;
79 ++ gmp_uint_least32_t exp:11;
80 ++ gmp_uint_least32_t manh:20;
81 ++ gmp_uint_least32_t manl:32;
82 ++ } s;
83 ++ double d;
84 ++};
85 ++
86 ++double __attribute__((noipa))
87 ++tests_infinity_d (void)
88 ++{
89 ++ union ieee_double_extract x;
90 ++ x.s.exp = 2047;
91 ++ x.s.manl = 0;
92 ++ x.s.manh = 0;
93 ++ x.s.sig = 0;
94 ++ return x.d;
95 ++}
96 ++
97 ++int
98 ++main (void)
99 ++{
100 ++ double x = tests_infinity_d ();
101 ++ if (x == 0.0)
102 ++ __builtin_abort ();
103 ++ return 0;
104 ++}
105 +--
106 +2.23.0
107 +
108
109 diff --git a/9.2.0/gentoo/README.history b/9.2.0/gentoo/README.history
110 index ae5ec16..c34d76c 100644
111 --- a/9.2.0/gentoo/README.history
112 +++ b/9.2.0/gentoo/README.history
113 @@ -1,3 +1,6 @@
114 +2 TODO
115 + + 27_all_sparc-PIC-constant-PR91472.patch
116 +
117 1 12 Aug 2019
118 + 01_all_default-fortify-source.patch
119 + 02_all_default-warn-format-security.patch