From 63d045e14e1a5f89e97af66dba6166f434c18fcc Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Thu, 22 Sep 2011 19:35:00 +0200 Subject: [PATCH] re PR target/50482 (internal compiler error at recog.c:2137) PR target/50482 * config/i386/i386.c (ix86_expand_sse_movcc): When generating blendv, force op_true to register if it doesn't satisfy nonimmediate_operand predicate. testsuite/ChangeLog: PR target/50482 * gcc.target/i386/pr50482.c: New test. From-SVN: r179094 --- gcc/ChangeLog | 10 ++++++++-- gcc/config/i386/i386.c | 3 +++ gcc/testsuite/ChangeLog | 7 ++++++- gcc/testsuite/gcc.target/i386/pr50482.c | 11 +++++++++++ 4 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr50482.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ed624bb35f5..a0c8b075ec3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2011-09-22 Uros Bizjak + + PR target/50482 + * config/i386/i386.c (ix86_expand_sse_movcc): When generating + blendv, force op_true to register if it doesn't satisfy + nonimmediate_operand predicate. + 2011-09-22 Richard Sandiford PR middle-end/50113 @@ -18,8 +25,7 @@ * ipa-inline.c (ipa_inline): Likewise; do not call ipa_create_all_structures_for_iinln. (ipa_inline): Always free jump functions. - * ipa-inline-analysis.c (evaluate_conditions_for_edge): Remove - hack. + * ipa-inline-analysis.c (evaluate_conditions_for_edge): Remove hack. (remap_edge_predicates): Fix pasto. (inline_merge_summary): Remove nlined edge predicate; remove hack. (inline_analyze_function): Always initialize jump functions. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index f952d2e758b..954b879c0fc 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -18911,6 +18911,9 @@ ix86_expand_sse_movcc (rtx dest, rtx cmp, rtx op_true, rtx op_false) { rtx (*gen) (rtx, rtx, rtx, rtx) = NULL; + if (!nonimmediate_operand (op_true, mode)) + op_true = force_reg (mode, op_true); + op_false = force_reg (mode, op_false); switch (mode) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 696f257ec13..b9d638ff879 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-09-22 Uros Bizjak + + PR target/50482 + * gcc.target/i386/pr50482.c: New test. + 2011-09-22 Joseph Myers * gcc.target/i386/pad-2.c, gcc.target/i386/pad-3.c, @@ -40,7 +45,7 @@ 2011-09-21 Uros Bizjak * g++.dg/other/i386-3.C: Remove duplicated dg-options. - * g++.dg/other/i386-4.C: Remove dg-requre-effective-target directive. + * g++.dg/other/i386-4.C: Remove dg-require-effective-target directive. * g++.dg/other/i386-8.C: Ditto. * g++.dg/other/pr34435.C: Ditto. * g++.dg/other/pr39496.C: Ditto. diff --git a/gcc/testsuite/gcc.target/i386/pr50482.c b/gcc/testsuite/gcc.target/i386/pr50482.c new file mode 100644 index 00000000000..64c2686bd86 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr50482.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -msse4" } */ + +void +test (int code, unsigned int * image, int * colors) +{ + int i; + + for (i = 0; i < code; ++i) + image[i] = (colors[i] < 0 ? ~(unsigned int) 0 : colors[i]); +}