This is the mail archive of the gcc-patches@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]

fix target/6922


RTL incoming to loop has

      (mult:DI (sign_extend:DI (reg:SI))
               (sign_extend:DI (reg:SI)))

which is not handled by expand_mult_add.  We wind up trying
to copy (sign_extend:DI (reg:SI)) directly into a register,
which we can't do in Sparc 32-bit mode.

It'd be nice if we handled this some other way.  We've just
replaced a 32->64 bit widening multiply with a 64-bit multiply.
I couldn't think of anything though.  At least this does the
right thing without ICEing.

Tested sparc-solaris2.8; applied mainline and branch.


r~


        * expmed.c (make_tree): Handle SIGN_EXTEND/ZERO_EXTEND.

Index: expmed.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/expmed.c,v
retrieving revision 1.108.2.3
diff -c -p -d -r1.108.2.3 expmed.c
*** expmed.c	13 Mar 2002 02:05:27 -0000	1.108.2.3
--- expmed.c	17 Jun 2002 18:04:10 -0000
*************** make_tree (type, x)
*** 4136,4141 ****
--- 4136,4147 ----
  			    build (TRUNC_DIV_EXPR, t,
  				   make_tree (t, XEXP (x, 0)),
  				   make_tree (t, XEXP (x, 1)))));
+ 
+     case SIGN_EXTEND:
+     case ZERO_EXTEND:
+       t = type_for_mode (GET_MODE (XEXP (x, 0)), GET_CODE (x) == ZERO_EXTEND);
+       return fold (convert (type, make_tree (t, XEXP (x, 0))));
+ 
     default:
        t = make_node (RTL_EXPR);
        TREE_TYPE (t) = type;


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