libsoup3: update to 3.6.0; fix GTK2/3 app startup
[oi-userland.git] / components / developer / gcc-12 / patches / 0007-strict-cc2-check-that-disabling-function-cloning-pre.patch
blobbea441f796e97522d2c4ed5814e9e00977c19d51
1 From c8eaf406088b2b56d3d0ec95b3fc22dd008ab3ff Mon Sep 17 00:00:00 2001
2 From: Richard Lowe <richlowe@richlowe.net>
3 Date: Tue, 4 Mar 2014 02:58:33 +0000
4 Subject: strict-cc2: check that disabling function cloning
5 prevents constant propagation eliding or changing arguments
7 ---
8 .../gcc.dg/fno-clone-preserves-unused-args.c | 28 +++++++++++++++++++
9 1 file changed, 28 insertions(+)
10 create mode 100644 gcc/testsuite/gcc.dg/fno-clone-preserves-unused-args.c
12 diff --git a/gcc/testsuite/gcc.dg/fno-clone-preserves-unused-args.c b/gcc/testsuite/gcc.dg/fno-clone-preserves-unused-args.c
13 new file mode 100644
14 index 00000000000..0955381c848
15 --- /dev/null
16 +++ b/gcc/testsuite/gcc.dg/fno-clone-preserves-unused-args.c
17 @@ -0,0 +1,28 @@
18 +/* { dg-do compile { target { ilp32 } } } */
19 +/* { dg-options "-O2 -funit-at-a-time -fipa-sra -fno-clone-functions" } */
20 +/* { dg-final { scan-assembler "pushl.*\\\$1" } } */
21 +/* { dg-final { scan-assembler "pushl.*\\\$2" } } */
22 +/* { dg-final { scan-assembler "pushl.*\\\$3" } } */
23 +/* { dg-final { scan-assembler "pushl.*\\\$4" } } */
24 +/* { dg-final { scan-assembler "pushl.*\\\$5" } } */
26 +#include <stdio.h>
28 +/*
29 + * Verify that preventing function cloning prevents constant prop/scalar
30 + * reduction removing parameters
31 + */
32 +static void
33 +t(int, int, int, int, int) __attribute__ ((noinline));
35 +int foo()
37 + t(1, 2, 3, 4, 5);
40 +/* Only use 3 params, bait constprop/sra into deleting the other two */
41 +static void
42 +t(int a, int b, int c, int d, int e)
44 + printf("%d %d\n", a, b, c);