aboutsummaryrefslogtreecommitdiff
path: root/packages/gcc/14.2.0/0016-Revert-one-of-the-force_subreg-changes.patch
diff options
context:
space:
mode:
authorBtbN <btbn@btbn.de>2024-08-10 16:48:55 +0200
committerChris Packham <judge.packham@gmail.com>2024-08-22 13:02:32 +1200
commit5595edc370d8146ca3bbb3052dde48aceaff4970 (patch)
treea40d018ea025224935e82b67e9ee90b10bcf4313 /packages/gcc/14.2.0/0016-Revert-one-of-the-force_subreg-changes.patch
parented12fa68402f58e171a6f79500f73f4781fdc9e5 (diff)
downloadcrosstool-ng-5595edc370d8146ca3bbb3052dde48aceaff4970.tar.gz
crosstool-ng-5595edc370d8146ca3bbb3052dde48aceaff4970.tar.bz2
crosstool-ng-5595edc370d8146ca3bbb3052dde48aceaff4970.zip
gcc-14.2: Fix ICE on aarch64
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115464 for issue description and list of patches to backport. Signed-off-by: BtbN <btbn@btbn.de>
Diffstat (limited to 'packages/gcc/14.2.0/0016-Revert-one-of-the-force_subreg-changes.patch')
-rw-r--r--packages/gcc/14.2.0/0016-Revert-one-of-the-force_subreg-changes.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/packages/gcc/14.2.0/0016-Revert-one-of-the-force_subreg-changes.patch b/packages/gcc/14.2.0/0016-Revert-one-of-the-force_subreg-changes.patch
new file mode 100644
index 00000000..629cfbda
--- /dev/null
+++ b/packages/gcc/14.2.0/0016-Revert-one-of-the-force_subreg-changes.patch
@@ -0,0 +1,46 @@
+From 5468439a1f987b7d801c6c76d6c989e57af8916a Mon Sep 17 00:00:00 2001
+From: Richard Sandiford <richard.sandiford@arm.com>
+Date: Tue, 25 Jun 2024 09:41:21 +0100
+Subject: [PATCH 16/16] Revert one of the force_subreg changes
+
+One of the changes in g:d4047da6a070175aae7121c739d1cad6b08ff4b2
+caused a regression in ft32-elf; see:
+
+ https://gcc.gnu.org/pipermail/gcc-patches/2024-June/655418.html
+
+for details. This change was different from the others in that the
+original call was to simplify_subreg rather than simplify_lowpart_subreg.
+The old code would therefore go on to do the force_reg for more cases
+than the new code would.
+
+gcc/
+ * expmed.cc (store_bit_field_using_insv): Revert earlier change
+ to use force_subreg instead of simplify_gen_subreg.
+
+(cherry picked from commit b694bf417cdd7d0a4d78e9927bab6bc202b7df6c)
+---
+ gcc/expmed.cc | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/gcc/expmed.cc b/gcc/expmed.cc
+index bd190722de6..85ec2614a3f 100644
+--- a/gcc/expmed.cc
++++ b/gcc/expmed.cc
+@@ -695,7 +695,13 @@ store_bit_field_using_insv (const extraction_insn *insv, rtx op0,
+ if we must narrow it, be sure we do it correctly. */
+
+ if (GET_MODE_SIZE (value_mode) < GET_MODE_SIZE (op_mode))
+- tmp = force_subreg (op_mode, value1, value_mode, 0);
++ {
++ tmp = simplify_subreg (op_mode, value1, value_mode, 0);
++ if (! tmp)
++ tmp = simplify_gen_subreg (op_mode,
++ force_reg (value_mode, value1),
++ value_mode, 0);
++ }
+ else
+ {
+ tmp = gen_lowpart_if_possible (op_mode, value1);
+--
+2.44.2
+