python/hypothesis: update to 6.122.3
[oi-userland.git] / components / developer / gcc-14 / patches / 0006-strict-cc2-check-that-disabling-function-cloning-pre.patch
blobde726e33714139b71543a55fcc8fa413b903c31d
1 From 0bda748154140ad074430310be676a8878949658 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 000000000000..0955381c8480
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);