aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilan P. Stanić <mps@arvanta.net>2020-01-30 23:18:12 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2020-03-20 19:19:00 +0100
commit67d25886a93e8d871f2e626244d99f796aed612b (patch)
tree449e5f4ac5f019077514c0bdc8886b609e581571
parentcdfa1fe32bbe4178daf5aaaae98b77007dabfb00 (diff)
downloadalpine_aports-67d25886a93e8d871f2e626244d99f796aed612b.tar.bz2
alpine_aports-67d25886a93e8d871f2e626244d99f796aed612b.tar.xz
alpine_aports-67d25886a93e8d871f2e626244d99f796aed612b.zip
main/gcc: fix wrong code when returning padded struct
bug report https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93402
-rw-r--r--main/gcc/0017-pr93402.patch45
-rw-r--r--main/gcc/APKBUILD6
2 files changed, 49 insertions, 2 deletions
diff --git a/main/gcc/0017-pr93402.patch b/main/gcc/0017-pr93402.patch
new file mode 100644
index 0000000000..c985fb6825
--- /dev/null
+++ b/main/gcc/0017-pr93402.patch
@@ -0,0 +1,45 @@
12020-01-23 Jakub Jelinek <jakub@redhat.com>
2
3 PR rtl-optimization/93402
4 * postreload.c (reload_combine_recognize_pattern): Don't try to adjust
5 USE insns.
6
7 * gcc.c-torture/execute/pr93402.c: New test.
8
9--- a/gcc/postreload.c.jj 2020-01-12 11:54:36.000000000 +0100
10+++ b/gcc/postreload.c 2020-01-23 17:23:25.359929516 +0100
11@@ -1078,6 +1078,10 @@ reload_combine_recognize_pattern (rtx_in
12 struct reg_use *use = reg_state[regno].reg_use + i;
13 if (GET_MODE (*use->usep) != mode)
14 return false;
15+ /* Don't try to adjust (use (REGX)). */
16+ if (GET_CODE (PATTERN (use->insn)) == USE
17+ && &XEXP (PATTERN (use->insn), 0) == use->usep)
18+ return false;
19 }
20
21 /* Look for (set (REGX) (CONST_INT))
22--- a/gcc/testsuite/gcc.c-torture/execute/pr93402.c.jj 2020-01-23 17:25:46.496803852 +0100
23+++ b/gcc/testsuite/gcc.c-torture/execute/pr93402.c 2020-01-23 17:25:05.221425501 +0100
24@@ -0,0 +1,21 @@
25+/* PR rtl-optimization/93402 */
26+
27+struct S { unsigned int a; unsigned long long b; };
28+
29+__attribute__((noipa)) struct S
30+foo (unsigned long long x)
31+{
32+ struct S ret;
33+ ret.a = 0;
34+ ret.b = x * 11111111111ULL + 111111111111ULL;
35+ return ret;
36+}
37+
38+int
39+main ()
40+{
41+ struct S a = foo (1);
42+ if (a.a != 0 || a.b != 122222222222ULL)
43+ __builtin_abort ();
44+ return 0;
45+}
diff --git a/main/gcc/APKBUILD b/main/gcc/APKBUILD
index 73fc54d991..21ca5dc58c 100644
--- a/main/gcc/APKBUILD
+++ b/main/gcc/APKBUILD
@@ -6,7 +6,7 @@ pkgver=9.2.0
6[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target="" 6[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
7 7
8pkgname="$pkgname$_target" 8pkgname="$pkgname$_target"
9pkgrel=3 9pkgrel=4
10pkgdesc="The GNU Compiler Collection" 10pkgdesc="The GNU Compiler Collection"
11url="http://gcc.gnu.org" 11url="http://gcc.gnu.org"
12arch="all" 12arch="all"
@@ -173,6 +173,7 @@ source="https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkg
173 gcc-pure64-mips.patch 173 gcc-pure64-mips.patch
174 0016-invalid_tls_model.patch 174 0016-invalid_tls_model.patch
175 gcc10-pr91920.patch 175 gcc10-pr91920.patch
176 0017-pr93402.patch
176 " 177 "
177 178
178# gcc-4.8-build-args.patch 179# gcc-4.8-build-args.patch
@@ -587,4 +588,5 @@ a1f7750bc7b8b7d916a5dee34fcc736bd4fb249c96538b547d495794e6cfd49356aa3974506a1507
587f4ef08454e28c8732db69115e4998ec153399e8d229dd27f923dbdcf57b68128a65640d026cc7f45b58ba8764ab1eb575d4eb6d6dfc550a87a183f8b94e76181 320-libffi-gnulinux.patch 588f4ef08454e28c8732db69115e4998ec153399e8d229dd27f923dbdcf57b68128a65640d026cc7f45b58ba8764ab1eb575d4eb6d6dfc550a87a183f8b94e76181 320-libffi-gnulinux.patch
58886be3338cc9c33089608bc4c5e3b7918c4e500a345c338f361b18c342119a6ed69af5495d72950de7106d760f003528b46ad14795e805f8a3331e206dcb234e3 gcc-pure64-mips.patch 58986be3338cc9c33089608bc4c5e3b7918c4e500a345c338f361b18c342119a6ed69af5495d72950de7106d760f003528b46ad14795e805f8a3331e206dcb234e3 gcc-pure64-mips.patch
58917e0faeef742d32d57a070d983480367dd28cd28d47a8966ce327afdff3a38ea76803a833c90aff7d3a93aa66dae76c9be47b2408500913b40571af25b85aca7 0016-invalid_tls_model.patch 59017e0faeef742d32d57a070d983480367dd28cd28d47a8966ce327afdff3a38ea76803a833c90aff7d3a93aa66dae76c9be47b2408500913b40571af25b85aca7 0016-invalid_tls_model.patch
590e9fef7677f9541848cd1df0bf3c330f06f1369bdf1d228238b7f1d03d8f2c4be07fd62be503b7bf72b6b1e2d4e404ddd957157b56b8050e3657820ade77491aa gcc10-pr91920.patch" 591e9fef7677f9541848cd1df0bf3c330f06f1369bdf1d228238b7f1d03d8f2c4be07fd62be503b7bf72b6b1e2d4e404ddd957157b56b8050e3657820ade77491aa gcc10-pr91920.patch
5920e20a5717c20ddc1d9f00276453b0abb4868adff0496604ad7d5b766a1028181c09c2061c5648bcfd4cb29dca7048cc866d2f27c013d82c2440164f17eac685d 0017-pr93402.patch"