From 0d9a5f8adcbb8ce4cd89a15b98daf77205c5eac5 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Sat, 31 Jan 2015 16:30:30 +0100 Subject: [PATCH] re PR target/64882 (ICE on valid code at -O3 with -g enabled in simplify_subreg, at simplify-rtx.c:5681) 2015-01-31 Uros Bizjak PR target/64882 * config/i386/predicates.md (address_no_seg_operand): Reject non-CONST_INT_P operands in invalid mode. 2015-01-31 Uros Bizjak * config/i386/i386.md (*prefetch_prefetchw1): Remove mode of address_operand 0. Rename from *prefetch_prefetchwt1_. * config/i386/predicates.md (address_no_seg_operand): Call address_operand with VOIDmode. (vsib_address_operand): Ditto. (address_mpx_no_base_operand): Ditto. (address_mpx_no_index_operand): Ditto. testsuite/ChangeLog: 2015-01-31 Uros Bizjak PR target/64882 * gcc.dg/torture/pr64882.c: New test. From-SVN: r220306 --- gcc/ChangeLog | 16 +++++++++++++ gcc/config/i386/i386.md | 4 ++-- gcc/config/i386/predicates.md | 13 ++++++---- gcc/testsuite/ChangeLog | 5 ++++ gcc/testsuite/gcc.dg/torture/pr64882.c | 33 ++++++++++++++++++++++++++ 5 files changed, 65 insertions(+), 6 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/torture/pr64882.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0e1e8bb2d8b..19cb15cf6b8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,19 @@ +2015-01-31 Uros Bizjak + + PR target/64882 + * config/i386/predicates.md (address_no_seg_operand): Reject + non-CONST_INT_P operands in invalid mode. + +2015-01-31 Uros Bizjak + + * config/i386/i386.md (*prefetch_prefetchw1): Remove mode of + address_operand 0. Rename from *prefetch_prefetchwt1_. + * config/i386/predicates.md (address_no_seg_operand): Call + address_operand with VOIDmode. + (vsib_address_operand): Ditto. + (address_mpx_no_base_operand): Ditto. + (address_mpx_no_index_operand): Ditto. + 2015-01-30 Vladimir Makarov PR target/64688 diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 5cefa81da96..2d3d07585c3 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -18117,8 +18117,8 @@ (symbol_ref "memory_address_length (operands[0], false)")) (set_attr "memory" "none")]) -(define_insn "*prefetch_prefetchwt1_" - [(prefetch (match_operand:P 0 "address_operand" "p") +(define_insn "*prefetch_prefetchwt1" + [(prefetch (match_operand 0 "address_operand" "p") (const_int 1) (const_int 2))] "TARGET_PREFETCHWT1" diff --git a/gcc/config/i386/predicates.md b/gcc/config/i386/predicates.md index 40dfa519861..0f314ccb0e3 100644 --- a/gcc/config/i386/predicates.md +++ b/gcc/config/i386/predicates.md @@ -966,11 +966,16 @@ ;; a segment override. Defined as a special predicate to allow ;; mode-less const_int operands pass to address_operand. (define_special_predicate "address_no_seg_operand" - (match_operand 0 "address_operand") + (match_test "address_operand (op, VOIDmode)") { struct ix86_address parts; int ok; + if (!CONST_INT_P (op) + && mode != VOIDmode + && GET_MODE (op) != mode) + return false; + ok = ix86_decompose_address (op, &parts); gcc_assert (ok); return parts.seg == SEG_DEFAULT; @@ -979,7 +984,7 @@ ;; Return true if op if a valid base register, displacement or ;; sum of base register and displacement for VSIB addressing. (define_predicate "vsib_address_operand" - (match_operand 0 "address_operand") + (match_test "address_operand (op, VOIDmode)") { struct ix86_address parts; int ok; @@ -1020,7 +1025,7 @@ ;; Return true if op is valid MPX address operand without base (define_predicate "address_mpx_no_base_operand" - (match_operand 0 "address_operand") + (match_test "address_operand (op, VOIDmode)") { struct ix86_address parts; int ok; @@ -1052,7 +1057,7 @@ ;; Return true if op is valid MPX address operand without index (define_predicate "address_mpx_no_index_operand" - (match_operand 0 "address_operand") + (match_test "address_operand (op, VOIDmode)") { struct ix86_address parts; int ok; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 256934126f4..54dc5438043 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-01-31 Uros Bizjak + + PR target/64882 + * gcc.dg/torture/pr64882.c: New test. + 2015-01-31 David Edelsohn PR target/64159 diff --git a/gcc/testsuite/gcc.dg/torture/pr64882.c b/gcc/testsuite/gcc.dg/torture/pr64882.c new file mode 100644 index 00000000000..462edace1b9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr64882.c @@ -0,0 +1,33 @@ +/* PR target/64882 */ +/* { dg-do compile } */ + +int a, d, e; +long long b; +static long long *c = &b; + +void +fn1 (short p) +{ +} + +long long +fn2 (long long p1, long long p2) +{ + return (p1 && p1 > 26854775807LL - p2) || p1 < -p2 ? p1 : p1 + p2; +} + +void +fn3 () +{ + long long f; + int g = 3; + int *h = &a; + for (e = 0; e < 2; e++) + { + int *i = &g; + if (!fn2 (*c, 7 < d % (*i)--)) + f = fn2 ((*h <= 0) | b, 5278350700LL); + *h = f; + fn1 (*h); + } +} -- 2.30.2