Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame] | 1 | From 87bc784a7ca3a43182f7272241597a50d7491342 Mon Sep 17 00:00:00 2001 |
| 2 | From: segher <segher@138bc75d-0d04-0410-961f-82ee72b054a4> |
| 3 | Date: Fri, 30 Aug 2019 13:51:26 +0000 |
| 4 | Subject: [PATCH] Backport from trunk 2019-08-22 Segher Boessenkool |
| 5 | <segher@kernel.crashing.org> |
| 6 | |
| 7 | PR target/91481 |
| 8 | * config/rs6000/rs6000.md (unspec): Delete UNSPEC_DARN, UNSPEC_DARN_32, |
| 9 | and UNSPEC_DARN_RAW. |
| 10 | (unspecv): New enumerator values UNSPECV_DARN, UNSPECV_DARN_32, and |
| 11 | UNSPECV_DARN_RAW. |
| 12 | (darn_32): Use an unspec_volatile, and UNSPECV_DARN_32. |
| 13 | (darn_raw): Use an unspec_volatile, and UNSPECV_DARN_RAW. |
| 14 | (darn): Use an unspec_volatile, and UNSPECV_DARN. |
| 15 | |
| 16 | |
| 17 | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-9-branch@275175 138bc75d-0d04-0410-961f-82ee72b054a4 |
| 18 | |
| 19 | Upstream-Status: Backport |
| 20 | CVE: CVE-2019-15847 p2 |
| 21 | Affects <= 9.2.0 |
| 22 | Dropped Changelog changes |
| 23 | Signed-off-by: Armin Kuster <akuster@mvista.com> |
| 24 | |
| 25 | --- |
| 26 | gcc/config/rs6000/rs6000.md | 12 ++++++------ |
| 27 | 2 files changed, 20 insertions(+), 6 deletions(-) |
| 28 | |
| 29 | Index: gcc-9.2.0/gcc/config/rs6000/rs6000.md |
| 30 | =================================================================== |
| 31 | --- gcc-9.2.0.orig/gcc/config/rs6000/rs6000.md |
| 32 | +++ gcc-9.2.0/gcc/config/rs6000/rs6000.md |
| 33 | @@ -137,9 +137,6 @@ |
| 34 | UNSPEC_LSQ |
| 35 | UNSPEC_FUSION_GPR |
| 36 | UNSPEC_STACK_CHECK |
| 37 | - UNSPEC_DARN |
| 38 | - UNSPEC_DARN_32 |
| 39 | - UNSPEC_DARN_RAW |
| 40 | UNSPEC_CMPRB |
| 41 | UNSPEC_CMPRB2 |
| 42 | UNSPEC_CMPEQB |
| 43 | @@ -170,6 +167,9 @@ |
| 44 | UNSPECV_EH_RR ; eh_reg_restore |
| 45 | UNSPECV_ISYNC ; isync instruction |
| 46 | UNSPECV_MFTB ; move from time base |
| 47 | + UNSPECV_DARN ; darn 1 (deliver a random number) |
| 48 | + UNSPECV_DARN_32 ; darn 2 |
| 49 | + UNSPECV_DARN_RAW ; darn 0 |
| 50 | UNSPECV_NLGR ; non-local goto receiver |
| 51 | UNSPECV_MFFS ; Move from FPSCR |
| 52 | UNSPECV_MFFSL ; Move from FPSCR light instruction version |
| 53 | @@ -14333,21 +14333,21 @@ |
| 54 | |
| 55 | (define_insn "darn_32" |
| 56 | [(set (match_operand:SI 0 "register_operand" "=r") |
| 57 | - (unspec:SI [(const_int 0)] UNSPEC_DARN_32))] |
| 58 | + (unspec_volatile:SI [(const_int 0)] UNSPECV_DARN_32))] |
| 59 | "TARGET_P9_MISC" |
| 60 | "darn %0,0" |
| 61 | [(set_attr "type" "integer")]) |
| 62 | |
| 63 | (define_insn "darn_raw" |
| 64 | [(set (match_operand:DI 0 "register_operand" "=r") |
| 65 | - (unspec:DI [(const_int 0)] UNSPEC_DARN_RAW))] |
| 66 | + (unspec_volatile:DI [(const_int 0)] UNSPECV_DARN_RAW))] |
| 67 | "TARGET_P9_MISC && TARGET_64BIT" |
| 68 | "darn %0,2" |
| 69 | [(set_attr "type" "integer")]) |
| 70 | |
| 71 | (define_insn "darn" |
| 72 | [(set (match_operand:DI 0 "register_operand" "=r") |
| 73 | - (unspec:DI [(const_int 0)] UNSPEC_DARN))] |
| 74 | + (unspec_volatile:DI [(const_int 0)] UNSPECV_DARN))] |
| 75 | "TARGET_P9_MISC && TARGET_64BIT" |
| 76 | "darn %0,1" |
| 77 | [(set_attr "type" "integer")]) |