summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-devtools/gcc/gcc-11.5.inc1
-rw-r--r--meta/recipes-devtools/gcc/gcc/0032-gcc-aarch64-fix-strict-align-cpymem-setmem.patch45
2 files changed, 46 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-11.5.inc b/meta/recipes-devtools/gcc/gcc-11.5.inc
index f17ec9da5c..1e8371b2bd 100644
--- a/meta/recipes-devtools/gcc/gcc-11.5.inc
+++ b/meta/recipes-devtools/gcc/gcc-11.5.inc
@@ -60,6 +60,7 @@ SRC_URI = "\
60 file://0029-Fix-install-path-of-linux64.h.patch \ 60 file://0029-Fix-install-path-of-linux64.h.patch \
61 file://0030-rust-recursion-limit.patch \ 61 file://0030-rust-recursion-limit.patch \
62 file://0031-gcc-sanitizers-fix.patch \ 62 file://0031-gcc-sanitizers-fix.patch \
63 file://0032-gcc-aarch64-fix-strict-align-cpymem-setmem.patch \
63 file://0001-CVE-2021-42574.patch \ 64 file://0001-CVE-2021-42574.patch \
64 file://0002-CVE-2021-42574.patch \ 65 file://0002-CVE-2021-42574.patch \
65 file://0003-CVE-2021-42574.patch \ 66 file://0003-CVE-2021-42574.patch \
diff --git a/meta/recipes-devtools/gcc/gcc/0032-gcc-aarch64-fix-strict-align-cpymem-setmem.patch b/meta/recipes-devtools/gcc/gcc/0032-gcc-aarch64-fix-strict-align-cpymem-setmem.patch
new file mode 100644
index 0000000000..4c2d827799
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc/0032-gcc-aarch64-fix-strict-align-cpymem-setmem.patch
@@ -0,0 +1,45 @@
1gcc: AArch64 - Fix strict-align cpymem/setmem
2
3The cpymemdi/setmemdi implementation doesn't fully support strict alignment.
4Block the expansion if the alignment is less than 16 with STRICT_ALIGNMENT.
5Clean up the condition when to use MOPS.
6
7Upstream-Status: Backport [https://gcc.gnu.org/cgit/gcc/commit/?id=b9d16d8361a9e3a82a2f21e759e760d235d43322]
8
9Signed-off-by: Wilco Dijkstra <wilco.dijkstra@arm.com>
10Signed-off-by: Sundeep KOKKONDA <sundeep.kokkonda@windriver.com>
11---
12--- a/gcc/config/aarch64/aarch64.c 2025-05-08 20:40:10.969865898 -0700
13+++ b/gcc/config/aarch64/aarch64.c 2025-05-13 23:11:07.006796627 -0700
14@@ -23621,14 +23621,15 @@
15 int mode_bits;
16 rtx dst = operands[0];
17 rtx src = operands[1];
18+ unsigned align = UINTVAL (operands[3]);
19 rtx base;
20 machine_mode cur_mode = BLKmode;
21
22 /* Only expand fixed-size copies. */
23- if (!CONST_INT_P (operands[2]))
24+ if (!CONST_INT_P (operands[2]) || (STRICT_ALIGNMENT && align < 16))
25 return false;
26
27- unsigned HOST_WIDE_INT size = INTVAL (operands[2]);
28+ unsigned HOST_WIDE_INT size = UINTVAL (operands[2]);
29
30 /* Inline up to 256 bytes when optimizing for speed. */
31 unsigned HOST_WIDE_INT max_copy_size = 256;
32@@ -23750,11 +23751,12 @@
33 unsigned HOST_WIDE_INT len;
34 rtx dst = operands[0];
35 rtx val = operands[2], src;
36+ unsigned align = UINTVAL (operands[3]);
37 rtx base;
38 machine_mode cur_mode = BLKmode, next_mode;
39
40 /* We can't do anything smart if the amount to copy is not constant. */
41- if (!CONST_INT_P (operands[1]))
42+ if (!CONST_INT_P (operands[1]) || (STRICT_ALIGNMENT && align < 16))
43 return false;
44
45 bool speed_p = !optimize_function_for_size_p (cfun);