Your change to function.c

Richard Henderson rth@cygnus.com
Fri Oct 2 23:15:00 GMT 1998


On Fri, Oct 02, 1998 at 02:27:57PM -0700, Mark Mitchell wrote:
> Wed Sep 30 18:03:22 1998  Richard Henderson  <rth@cygnus.com>
> 
> 	* function.c (purge_addressof_1): Use bitfield manipulation
> 	routines to handle mem mode < reg mode.
> 
> seems to cause GCC to run "forever" on:

Comments on the following fix?


r~



	* combine.c (expand_field_assignment): Don't do bitwise operations
	on MODE_FLOAT; pun to MODE_INT if possible.

Index: combine.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/combine.c,v
retrieving revision 1.44
diff -c -p -d -r1.44 combine.c
*** combine.c	1998/09/20 00:01:31	1.44
--- combine.c	1998/10/03 06:11:32
*************** expand_field_assignment (x)
*** 5384,5389 ****
--- 5384,5407 ----
  
        compute_mode = GET_MODE (inner);
  
+       /* Don't attempt bitwise arithmetic on non-integral modes.  */
+       if (! INTEGRAL_MODE_P (compute_mode))
+ 	{
+ 	  enum machine_mode imode;
+ 
+ 	  /* Something is probably seriously wrong if this matches.  */
+ 	  if (! FLOAT_MODE_P (compute_mode))
+ 	    break;
+ 
+ 	  /* Try to find an integral mode to pun with.  */
+ 	  imode = mode_for_size (GET_MODE_BITSIZE (compute_mode), MODE_INT, 0);
+ 	  if (imode == BLKmode)
+ 	    break;
+ 
+ 	  compute_mode = imode;
+ 	  inner = gen_lowpart_for_combine (imode, inner);
+ 	}
+ 
        /* Compute a mask of LEN bits, if we can do this on the host machine.  */
        if (len < HOST_BITS_PER_WIDE_INT)
  	mask = GEN_INT (((HOST_WIDE_INT) 1 << len) - 1);



More information about the Gcc-patches mailing list