This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug rtl-optimization/34522] inefficient code for long long multiply when only low bits are needed



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]