Commit 3cb2b15b by Uros Bizjak

re PR target/52883 (ICE in simplify_const_unary_operation, at simplify-rtx.c:1464)

	PR target/52883
	* config/i386/predicates.md (x86_64_zext_general_operand): Prevent
	VOIDmode immediate operands.
	* config/i386/constraints.md (Wz): New constraint.
	* config/i386/i386.md (*zero_extendsidi2_rex64): Use Wz instead of Z.

testsuite/ChangeLog:

	PR target/52883
	* gcc.target/i386/pr52883.c: New testcase.

From-SVN: r186243
parent 99a1b084
2012-04-09 Uros Bizjak <ubizjak@gmail.com>
PR target/52883
* config/i386/predicates.md (x86_64_zext_general_operand): Prevent
VOIDmode immediate operands.
* config/i386/constraints.md (Wz): New constraint.
* config/i386/i386.md (*zero_extendsidi2_rex64): Use Wz instead of Z.
2012-04-09 Eric Botcazou <ebotcazou@adacore.com> 2012-04-09 Eric Botcazou <ebotcazou@adacore.com>
PR target/52717 PR target/52717
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
;; <http://www.gnu.org/licenses/>. ;; <http://www.gnu.org/licenses/>.
;;; Unused letters: ;;; Unused letters:
;;; B H T W ;;; B H T
;;; h k v ;;; h k v
;; Integer register constraints. ;; Integer register constraints.
...@@ -199,6 +199,16 @@ ...@@ -199,6 +199,16 @@
instructions)." instructions)."
(match_operand 0 "x86_64_immediate_operand")) (match_operand 0 "x86_64_immediate_operand"))
;; We use W prefix to denote any number of
;; constant-or-symbol-reference constraints
(define_constraint "Wz"
"32-bit unsigned integer constant, or a symbolic reference known
to fit that range (for zero-extending conversion operations that
require non-VOIDmode immediate operands)."
(and (match_operand 0 "x86_64_zext_immediate_operand")
(match_test "GET_MODE (op) != VOIDmode")))
(define_constraint "Z" (define_constraint "Z"
"32-bit unsigned integer constant, or a symbolic reference known "32-bit unsigned integer constant, or a symbolic reference known
to fit that range (for immediate operands in zero-extending x86-64 to fit that range (for immediate operands in zero-extending x86-64
......
...@@ -3396,7 +3396,7 @@ ...@@ -3396,7 +3396,7 @@
"=r ,o,?*Ym,?*y,?*Yi,!*x") "=r ,o,?*Ym,?*y,?*Yi,!*x")
(zero_extend:DI (zero_extend:DI
(match_operand:SI 1 "x86_64_zext_general_operand" (match_operand:SI 1 "x86_64_zext_general_operand"
"rmZ,0,r ,m ,r ,m*x")))] "rmWz,0,r ,m ,r ,m*x")))]
"TARGET_64BIT" "TARGET_64BIT"
"@ "@
mov{l}\t{%1, %k0|%k0, %1} mov{l}\t{%1, %k0|%k0, %1}
......
...@@ -341,11 +341,13 @@ ...@@ -341,11 +341,13 @@
(match_operand 0 "general_operand"))) (match_operand 0 "general_operand")))
;; Return true if OP is general operand representable on x86_64 ;; Return true if OP is general operand representable on x86_64
;; as zero extended constant. ;; as zero extended constant. This predicate is used in zero-extending
;; conversion operations that require non-VOIDmode immediate operands.
(define_predicate "x86_64_zext_general_operand" (define_predicate "x86_64_zext_general_operand"
(if_then_else (match_test "TARGET_64BIT") (if_then_else (match_test "TARGET_64BIT")
(ior (match_operand 0 "nonimmediate_operand") (ior (match_operand 0 "nonimmediate_operand")
(match_operand 0 "x86_64_zext_immediate_operand")) (and (match_operand 0 "x86_64_zext_immediate_operand")
(match_test "GET_MODE (op) != VOIDmode")))
(match_operand 0 "general_operand"))) (match_operand 0 "general_operand")))
;; Return true if OP is general operand representable on x86_64 ;; Return true if OP is general operand representable on x86_64
......
2012-04-09 Uros Bizjak <ubizjak@gmail.com>
PR target/52883
* gcc.target/i386/pr52883.c: New testcase.
2012-04-09 Eric Botcazou <ebotcazou@adacore.com> 2012-04-09 Eric Botcazou <ebotcazou@adacore.com>
* lib/target-supports.exp (check_effective_target_sparc_v9): New. * lib/target-supports.exp (check_effective_target_sparc_v9): New.
......
/* { dg-do compile } */
/* { dg-options "-O" } */
int a, b, d, e, f, i, j, k, l, m;
unsigned c;
int g[] = { }, h[0];
int
fn1 () {
return 0;
}
void
fn2 () {
c = 0;
e = 0;
for (;; e = 0)
if (f > j) {
k = fn1 ();
l = (d || k) * b;
m = l * a;
h[0] = m <= i;
} else
i = g[c];
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment