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 problem with VIEW_CONVERT_EXPR


This obviously-correct change affects Ada only.

Sat May  3 08:30:50 2003  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>

	* expr.c (expand_expr, case VIEW_CONVERT_EXPR): Don't use
	gen_lowpart on non-integer modes

*** gcc/expr.c	3 May 2003 14:25:20 -0000	1.533
--- gcc/expr.c	3 May 2003 14:28:09 -0000
*************** expand_expr (exp, target, tmode, modifie
*** 7960,7969 ****
  
        /* If the input and output modes are both the same, we are done.
! 	 Otherwise, if neither mode is BLKmode and both are within a word, we
! 	 can use gen_lowpart.  If neither is true, make sure the operand is
! 	 in memory and convert the MEM to the new mode.  */
        if (TYPE_MODE (type) == GET_MODE (op0))
  	;
        else if (TYPE_MODE (type) != BLKmode && GET_MODE (op0) != BLKmode
  	       && GET_MODE_SIZE (TYPE_MODE (type)) <= UNITS_PER_WORD
  	       && GET_MODE_SIZE (GET_MODE (op0)) <= UNITS_PER_WORD)
--- 7960,7971 ----
  
        /* If the input and output modes are both the same, we are done.
! 	 Otherwise, if neither mode is BLKmode and both are integral and within
! 	 a word, we can use gen_lowpart.  If neither is true, make sure the
! 	 operand is in memory and convert the MEM to the new mode.  */
        if (TYPE_MODE (type) == GET_MODE (op0))
  	;
        else if (TYPE_MODE (type) != BLKmode && GET_MODE (op0) != BLKmode
+ 	       && GET_MODE_CLASS (GET_MODE (op0)) == MODE_INT
+ 	       && GET_MODE_CLASS (TYPE_MODE (type)) == MODE_INT
  	       && GET_MODE_SIZE (TYPE_MODE (type)) <= UNITS_PER_WORD
  	       && GET_MODE_SIZE (GET_MODE (op0)) <= UNITS_PER_WORD)


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