summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2016-04-21 22:01:34 +0000
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2016-04-21 22:01:34 +0000
commitfd3211e13bbbb6882f477aa75a36eb0ccdec485f (patch)
treed37bcb94f9f4f567d51e69e1e77e0ed3c7883b6e
parent55f9c6ede3b9218a1ccf19b61568413266b4ca6e (diff)
downloadgcc-fd3211e13bbbb6882f477aa75a36eb0ccdec485f.tar.gz
X86: Fix a typo in call_insn_operand
r231923 has ;; Test for a valid operand for a call instruction. ;; Allow constant call address operands in Pmode only. (define_special_predicate "call_insn_operand" (ior (match_test "constant_call_address_operand (op, mode == VOIDmode ? mode : Pmode)") (match_operand 0 "call_register_no_elim_operand") - (and (not (match_test "TARGET_X32")) - (match_operand 0 "memory_operand")))) + (ior (and (not (match_test "TARGET_X32")) + (match_operand 0 "sibcall_memory_operand")) ^^^^^^^^^^^^^^^^^^^^^^^ A typo. + (and (match_test "TARGET_X32 && Pmode == DImode") + (match_operand 0 "GOT_memory_operand"))))) "sibcall_memory_operand" should be "memory_operand". gcc/ PR target/70750 * config/i386/predicates.md (call_insn_operand): Replace sibcall_memory_operand with memory_operand. gcc/testsuite/ PR target/70750 * gcc.target/i386/pr70750-1.c: New test. * gcc.target/i386/pr70750-2.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235353 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/i386/predicates.md2
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gcc.target/i386/pr70750-1.c11
-rw-r--r--gcc/testsuite/gcc.target/i386/pr70750-2.c11
5 files changed, 35 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 78ac409493e..06ff30c1ac0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2016-04-21 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/70750
+ * config/i386/predicates.md (call_insn_operand): Replace
+ sibcall_memory_operand with memory_operand.
+
2016-04-21 Patrick Palka <ppalka@gcc.gnu.org>
* tree-vrp.c (register_edge_assert_for_2): Remove redundant
diff --git a/gcc/config/i386/predicates.md b/gcc/config/i386/predicates.md
index 14e80d9b48f..93dda7bb0e7 100644
--- a/gcc/config/i386/predicates.md
+++ b/gcc/config/i386/predicates.md
@@ -637,7 +637,7 @@
(op, mode == VOIDmode ? mode : Pmode)")
(match_operand 0 "call_register_no_elim_operand")
(ior (and (not (match_test "TARGET_X32"))
- (match_operand 0 "sibcall_memory_operand"))
+ (match_operand 0 "memory_operand"))
(and (match_test "TARGET_X32 && Pmode == DImode")
(match_operand 0 "GOT_memory_operand")))))
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 0227f70243b..38b18c9073f 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2016-04-21 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/70750
+ * gcc.target/i386/pr70750-1.c: New test.
+ * gcc.target/i386/pr70750-2.c: Likewise.
+
2016-04-21 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/70540
diff --git a/gcc/testsuite/gcc.target/i386/pr70750-1.c b/gcc/testsuite/gcc.target/i386/pr70750-1.c
new file mode 100644
index 00000000000..9fcab17dc9c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr70750-1.c
@@ -0,0 +1,11 @@
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O2" } */
+
+int
+f (int (**p) (void))
+{
+ return p[1]();
+}
+
+/* { dg-final { scan-assembler "jmp\[ \t\].*\\(%rdi\\)" { target { lp64 } } } } */
+/* { dg-final { scan-assembler "jmp\[ \t\]\\*%rax" { target { x32 } } } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr70750-2.c b/gcc/testsuite/gcc.target/i386/pr70750-2.c
new file mode 100644
index 00000000000..afbef37fc90
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr70750-2.c
@@ -0,0 +1,11 @@
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O2" } */
+
+int
+f (int (**p) (void))
+{
+ return -p[1]();
+}
+
+/* { dg-final { scan-assembler "call\[ \t\].*\\(%rdi\\)" { target { lp64 } } } } */
+/* { dg-final { scan-assembler "call\[ \t\]\\*%rax" { target { x32 } } } } */