From: DJ Delorie Date: Thu, 18 Oct 2012 01:50:24 +0000 (-0400) Subject: re PR target/54950 (Incorrect 32-bit moltiplication on m32c target) X-Git-Tag: releases/gcc-4.6.4~318 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c93860d5e2cdce737a5823a9b0809255c224f9c;p=thirdparty%2Fgcc.git re PR target/54950 (Incorrect 32-bit moltiplication on m32c target) PR target/54950 * config/m32c/predicates.md (m32c_const_u16_operand): New. * config/m32c/muldiv.md: Use it. From-SVN: r192553 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d5e09948d6fd..c7b26bbcc854 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2012-10-17 DJ Delorie + + PR target/54950 + * config/m32c/predicates.md (m32c_const_u16_operand): New. + * config/m32c/muldiv.md: Use it. + 2012-10-10 John David Anglin * config/pa/pa.md (addhi3): Fix typo in last change. diff --git a/gcc/config/m32c/muldiv.md b/gcc/config/m32c/muldiv.md index 49870838b903..17b0b5d18111 100644 --- a/gcc/config/m32c/muldiv.md +++ b/gcc/config/m32c/muldiv.md @@ -108,7 +108,7 @@ (define_insn "umulhisi3_c" [(set (match_operand:SI 0 "ra_operand" "=Rsi") (mult:SI (zero_extend:SI (match_operand:HI 1 "mra_operand" "%0")) - (match_operand 2 "immediate_operand" "i")))] + (match_operand 2 "m32c_const_u16_operand" "i")))] "" "mulu.w\t%u2,%1" [(set_attr "flags" "o")] diff --git a/gcc/config/m32c/predicates.md b/gcc/config/m32c/predicates.md index 9293baa65f1f..982bb1be849c 100644 --- a/gcc/config/m32c/predicates.md +++ b/gcc/config/m32c/predicates.md @@ -293,3 +293,7 @@ (define_predicate "m32c_1mask16_operand" (and (match_operand 0 "const_int_operand") (match_test "m32c_const_ok_for_constraint_p(INTVAL(op), 'I', \"Imw\")"))) + +(define_predicate "m32c_const_u16_operand" + (and (match_operand 0 "const_int_operand") + (match_test "fprintf(stderr, \"u16=%d\\n\", INTVAL(op)),INTVAL (op) >= 0 && INTVAL (op) <= 65535")))