blob: ba7130ca7dcdf70992dacd4a3f6b6c3d2716adb7 [file] [log] [blame]
Brad Bishopa34c0302019-09-23 22:34:48 -04001From dc4c8dd9dbe70740ec7a684b0f35620249fb036a Mon Sep 17 00:00:00 2001
2From: segher <segher@138bc75d-0d04-0410-961f-82ee72b054a4>
3Date: Fri, 30 Aug 2019 13:53:11 +0000
4Subject: [PATCH] Backport from trunk 2019-08-23 Segher Boessenkool
5 <segher@kernel.crashing.org>
6
7gcc/testsuite/
8 PR target/91481
9 * gcc.target/powerpc/darn-3.c: New testcase.
10
11
12git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-9-branch@275176 138bc75d-0d04-0410-961f-82ee72b054a4
13
14Upstream-Status: Backport
15CVE: CVE-2019-15847 p3
16Affects <= 9.2.0
17Dropped Changelog changes
18Signed-off-by: Armin Kuster <akuster@mvista.com>
19
20---
21 gcc/testsuite/ChangeLog | 6 ++++++
22 gcc/testsuite/gcc.target/powerpc/darn-3.c | 16 ++++++++++++++++
23 2 files changed, 22 insertions(+)
24 create mode 100644 gcc/testsuite/gcc.target/powerpc/darn-3.c
25
26Index: gcc-9.2.0/gcc/testsuite/gcc.target/powerpc/darn-3.c
27===================================================================
28--- /dev/null
29+++ gcc-9.2.0/gcc/testsuite/gcc.target/powerpc/darn-3.c
30@@ -0,0 +1,16 @@
31+/* { dg-do compile { target { powerpc*-*-* } } } */
32+/* { dg-skip-if "" { powerpc*-*-aix* } } */
33+/* { dg-options "-O2 -mdejagnu-cpu=power9" } */
34+
35+static int darn32(void) { return __builtin_darn_32(); }
36+
37+int four(void)
38+{
39+ int sum = 0;
40+ int i;
41+ for (i = 0; i < 4; i++)
42+ sum += darn32();
43+ return sum;
44+}
45+
46+/* { dg-final { scan-assembler-times {(?n)\mdarn .*,0\M} 4 } } */
47Index: gcc-9.2.0/gcc/testsuite/ChangeLog
48===================================================================
49--- gcc-9.2.0.orig/gcc/testsuite/ChangeLog
50+++ gcc-9.2.0/gcc/testsuite/ChangeLog
51@@ -1,3 +1,11 @@
52+2019-08-30 Segher Boessenkool <segher@kernel.crashing.org>
53+
54+ Backport from trunk
55+ 2019-08-23 Segher Boessenkool <segher@kernel.crashing.org>
56+
57+ PR target/91481
58+ * gcc.target/powerpc/darn-3.c: New testcase.
59+
60 2019-08-12 Release Manager
61
62 * GCC 9.2.0 released.