Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/gpl3/gcc/dist/gcc/config/vax Add new predicate vola...
details: https://anonhg.NetBSD.org/src/rev/665d6ec11de3
branches: trunk
changeset: 360842:665d6ec11de3
user: maya <maya%NetBSD.org@localhost>
date: Mon Apr 02 17:45:23 2018 +0000
description:
Add new predicate volatile_mem_operand and use it for jbbssi<mode>
Fixes PR port-vax/53039: GCC/VAX hits ICE building libstdc++
GCC wants to change the label and then doesn't recognise the
new insn, it believes it doesn't satisfy the memory_operand
predicate.
It appears the memory_operand predicate doesn't accept volatile
memory accesses during the RTL generation phase.
The predicate is from rs6000 code.
from krister
diffstat:
external/gpl3/gcc/dist/gcc/config/vax/builtins.md | 12 ++++++------
external/gpl3/gcc/dist/gcc/config/vax/predicates.md | 13 +++++++++++++
2 files changed, 19 insertions(+), 6 deletions(-)
diffs (71 lines):
diff -r 88b7f54dc43b -r 665d6ec11de3 external/gpl3/gcc/dist/gcc/config/vax/builtins.md
--- a/external/gpl3/gcc/dist/gcc/config/vax/builtins.md Mon Apr 02 11:02:52 2018 +0000
+++ b/external/gpl3/gcc/dist/gcc/config/vax/builtins.md Mon Apr 02 17:45:23 2018 +0000
@@ -77,13 +77,13 @@
[(parallel
[(set (pc)
(if_then_else
- (ne (zero_extract:SI (match_operand:QI 0 "memory_operand" "g")
+ (ne (zero_extract:SI (match_operand:QI 0 "volatile_mem_operand" "g")
(const_int 1)
(match_operand:SI 1 "general_operand" "nrm"))
(const_int 0))
(label_ref (match_operand 2 "" ""))
(pc)))
- (set (zero_extract:SI (match_operand:QI 3 "memory_operand" "+0")
+ (set (zero_extract:SI (match_operand:QI 3 "volatile_mem_operand" "+0")
(const_int 1)
(match_dup 1))
(const_int 1))])]
@@ -94,13 +94,13 @@
[(parallel
[(set (pc)
(if_then_else
- (ne (zero_extract:SI (match_operand:HI 0 "memory_operand" "Q")
+ (ne (zero_extract:SI (match_operand:HI 0 "volatile_mem_operand" "Q")
(const_int 1)
(match_operand:SI 1 "general_operand" "nrm"))
(const_int 0))
(label_ref (match_operand 2 "" ""))
(pc)))
- (set (zero_extract:SI (match_operand:HI 3 "memory_operand" "+0")
+ (set (zero_extract:SI (match_operand:HI 3 "volatile_mem_operand" "+0")
(const_int 1)
(match_dup 1))
(const_int 1))])]
@@ -111,13 +111,13 @@
[(parallel
[(set (pc)
(if_then_else
- (ne (zero_extract:SI (match_operand:SI 0 "memory_operand" "Q")
+ (ne (zero_extract:SI (match_operand:SI 0 "volatile_mem_operand" "Q")
(const_int 1)
(match_operand:SI 1 "general_operand" "nrm"))
(const_int 0))
(label_ref (match_operand 2 "" ""))
(pc)))
- (set (zero_extract:SI (match_operand:SI 3 "memory_operand" "+0")
+ (set (zero_extract:SI (match_operand:SI 3 "volatile_mem_operand" "+0")
(const_int 1)
(match_dup 1))
(const_int 1))])]
diff -r 88b7f54dc43b -r 665d6ec11de3 external/gpl3/gcc/dist/gcc/config/vax/predicates.md
--- a/external/gpl3/gcc/dist/gcc/config/vax/predicates.md Mon Apr 02 11:02:52 2018 +0000
+++ b/external/gpl3/gcc/dist/gcc/config/vax/predicates.md Mon Apr 02 17:45:23 2018 +0000
@@ -109,3 +109,16 @@
(and (match_code "const_int,const_double,subreg,reg,mem")
(and (match_operand:DI 0 "general_operand" "")
(not (match_operand:DI 0 "illegal_addsub_di_memory_operand")))))
+
+;; Return 1 if the operand is in volatile memory. Note that during the
+;; RTL generation phase, memory_operand does not return TRUE for volatile
+;; memory references. So this function allows us to recognize volatile
+;; references where it's safe.
+(define_predicate "volatile_mem_operand"
+ (and (and (match_code "mem")
+ (match_test "MEM_VOLATILE_P (op)"))
+ (if_then_else (match_test "reload_completed")
+ (match_operand 0 "memory_operand")
+ (if_then_else (match_test "reload_in_progress")
+ (match_test "strict_memory_address_p (mode, XEXP (op, 0))")
+ (match_test "memory_address_p (mode, XEXP (op, 0))")))))
Home |
Main Index |
Thread Index |
Old Index