This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/34522] inefficient code for long long multiply when only low bits are needed
- From: "bonzini at gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Dec 2007 16:58:58 -0000
- Subject: [Bug rtl-optimization/34522] inefficient code for long long multiply when only low bits are needed
- References: <bug-34522-7849@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from bonzini at gnu dot org 2007-12-18 16:58 -------
Prototype untested patch. Produces
movl 12(%esp), %eax
imull 4(%esp), %eax
ret
on the testcase.
Index: expr.c
===================================================================
--- expr.c (revision 130928)
+++ expr.c (working copy)
@@ -8642,7 +8642,8 @@ expand_expr_real_1 (tree exp, rtx target
}
expand_operands (TREE_OPERAND (exp, 0), TREE_OPERAND (exp, 1),
subtarget, &op0, &op1, 0);
- return REDUCE_BIT_FIELD (expand_mult (mode, op0, op1, target,
unsignedp));
+ return REDUCE_BIT_FIELD (expand_mult (tmode != VOIDmode ? tmode : mode,
+ op0, op1, target, unsignedp));
case TRUNC_DIV_EXPR:
case FLOOR_DIV_EXPR:
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34522