re PR target/44481 (__builtin_parity() causes ICE in trunc_int_for_mode())

PR target/44481
	* config/i386/i386.md (UNSPEC_PARITY): New unspec.
	(paritydi2_cmp): Use UNSPEC_PARITY unspec insted of parity RTX.
	(partiysi2_cmp): Ditto.
	(*partiyhi2_cmp): Ditto.
	(*parityqi2_cmp): Remove.

testsuite/ChangeLog:

	PR target/44481
	* gcc.target/i386/pr44481.c: New test.

From-SVN: r160654
This commit is contained in:
Uros Bizjak 2010-06-12 09:43:40 +02:00 committed by Uros Bizjak
parent 744f9485fc
commit 2a995bf4aa
4 changed files with 45 additions and 21 deletions

View File

@ -1,3 +1,12 @@
2010-06-12 Uros Bizjak <ubizjak@gmail.com>
PR target/44481
* config/i386/i386.md (UNSPEC_PARITY): New unspec.
(paritydi2_cmp): Use UNSPEC_PARITY unspec insted of parity RTX.
(partiysi2_cmp): Ditto.
(*partiyhi2_cmp): Ditto.
(*parityqi2_cmp): Remove.
2010-06-08 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.md (*movsi_1) <TYPE_LEA>: Use %a modifier

View File

@ -77,14 +77,15 @@
(UNSPEC_TLSDESC 23)
; Other random patterns
(UNSPEC_EH_RETURN 29)
(UNSPEC_SCAS 30)
(UNSPEC_FNSTSW 31)
(UNSPEC_SAHF 32)
(UNSPEC_FSTCW 33)
(UNSPEC_ADD_CARRY 34)
(UNSPEC_FLDCW 35)
(UNSPEC_REP 36)
(UNSPEC_EH_RETURN 37)
(UNSPEC_PARITY 33)
(UNSPEC_FSTCW 34)
(UNSPEC_ADD_CARRY 35)
(UNSPEC_FLDCW 36)
(UNSPEC_REP 37)
(UNSPEC_LD_MPIC 38) ; load_macho_picbase
(UNSPEC_TRUNC_NOOP 39)
@ -15773,7 +15774,8 @@
(define_insn_and_split "paritydi2_cmp"
[(set (reg:CC FLAGS_REG)
(parity:CC (match_operand:DI 3 "register_operand" "0")))
(unspec:CC [(match_operand:DI 3 "register_operand" "0")]
UNSPEC_PARITY))
(clobber (match_scratch:DI 0 "=r"))
(clobber (match_scratch:SI 1 "=&r"))
(clobber (match_scratch:HI 2 "=Q"))]
@ -15786,7 +15788,7 @@
(clobber (reg:CC FLAGS_REG))])
(parallel
[(set (reg:CC FLAGS_REG)
(parity:CC (match_dup 1)))
(unspec:CC [(match_dup 1)] UNSPEC_PARITY))
(clobber (match_dup 1))
(clobber (match_dup 2))])]
{
@ -15822,7 +15824,8 @@
(define_insn_and_split "paritysi2_cmp"
[(set (reg:CC FLAGS_REG)
(parity:CC (match_operand:SI 2 "register_operand" "0")))
(unspec:CC [(match_operand:SI 2 "register_operand" "0")]
UNSPEC_PARITY))
(clobber (match_scratch:SI 0 "=r"))
(clobber (match_scratch:HI 1 "=&Q"))]
"! TARGET_POPCNT"
@ -15834,7 +15837,7 @@
(clobber (reg:CC FLAGS_REG))])
(parallel
[(set (reg:CC FLAGS_REG)
(parity:CC (match_dup 1)))
(unspec:CC [(match_dup 1)] UNSPEC_PARITY))
(clobber (match_dup 1))])]
{
operands[3] = gen_lowpart (HImode, operands[2]);
@ -15845,20 +15848,13 @@
(define_insn "*parityhi2_cmp"
[(set (reg:CC FLAGS_REG)
(parity:CC (match_operand:HI 1 "register_operand" "0")))
(unspec:CC [(match_operand:HI 1 "register_operand" "0")]
UNSPEC_PARITY))
(clobber (match_scratch:HI 0 "=Q"))]
"! TARGET_POPCNT"
"xor{b}\t{%h0, %b0|%b0, %h0}"
[(set_attr "length" "2")
(set_attr "mode" "HI")])
(define_insn "*parityqi2_cmp"
[(set (reg:CC FLAGS_REG)
(parity:CC (match_operand:QI 0 "register_operand" "q")))]
"! TARGET_POPCNT"
"test{b}\t%0, %0"
[(set_attr "length" "2")
(set_attr "mode" "QI")])
;; Thread-local storage patterns for ELF.
;;

View File

@ -1,3 +1,8 @@
2010-06-12 Uros Bizjak <ubizjak@gmail.com>
PR target/44481
* gcc.target/i386/pr44481.c: New test.
2010-06-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Backport from mainline:
@ -854,7 +859,7 @@
PR fortran/43228
* gfortran.dg/namelist_61.f90: New test.
2010-03-11 Janis Johnson <janis187@us.ibm.com>
* lib/target-supports-dg.exp (check-flags): Provide defaults for
@ -890,7 +895,7 @@
Backport:
2009-10-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* lib/target-supports.exp (add_options_for_bind_pic_locally): New.
2009-10-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* g++.dg/ipa/iinline-1.C: Use dg-add-options bind_pic_locally.
* g++.dg/other/first-global.C: Likewise.
@ -904,7 +909,7 @@
* gcc.dg/ipa/ipa-5.c: Likewise.
* gcc.dg/ipa/ipa-7.c: Likewise.
* gcc.dg/ipa/ipacost-2.c: Likewise.
2010-02-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gcc.dg/tree-ssa/inline-4.c: Bind pic locally.

View File

@ -0,0 +1,14 @@
/* { dg-do compile } */
/* { dg-options "-O2" } */
static inline unsigned
parity (unsigned x)
{
return (unsigned) __builtin_parity (x);
}
unsigned
f (unsigned rpoly)
{
return parity (rpoly & 1) ^ parity (rpoly & 6);
}