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 c/2035


We were rightly rejecting the creation of (subreg:SF (reg:DF x) 0).
But I see no reason why we can't leave the existing (subreg:DI (reg:DF x) 0)
intact and use the code farther down to process it.

As far as I can tell, this problem can only be triggered by invalid
type-punning on local variables.  I.e.  *(float *)&a_double.  But we
shouldn't crash either.


r~


        * expmed.c (extract_bit_field): Fall through to generic code rather
        than aborting on subreg special case.

Index: expmed.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/expmed.c,v
retrieving revision 1.116
diff -c -p -d -r1.116 expmed.c
*** expmed.c	22 Apr 2002 23:20:12 -0000	1.116
--- expmed.c	26 Apr 2002 02:07:47 -0000
*************** extract_bit_field (str_rtx, bitsize, bit
*** 1144,1150 ****
  		/* Else we've got some float mode source being extracted into
  		   a different float mode destination -- this combination of
  		   subregs results in Severe Tire Damage.  */
! 		abort ();
  	    }
  	  if (GET_CODE (op0) == REG)
  	    op0 = gen_rtx_SUBREG (mode1, op0, byte_offset);
--- 1144,1150 ----
  		/* Else we've got some float mode source being extracted into
  		   a different float mode destination -- this combination of
  		   subregs results in Severe Tire Damage.  */
! 		goto no_subreg_mode_swap;
  	    }
  	  if (GET_CODE (op0) == REG)
  	    op0 = gen_rtx_SUBREG (mode1, op0, byte_offset);
*************** extract_bit_field (str_rtx, bitsize, bit
*** 1155,1160 ****
--- 1155,1161 ----
  	return convert_to_mode (tmode, op0, unsignedp);
        return op0;
      }
+  no_subreg_mode_swap:
  
    /* Handle fields bigger than a word.  */
  


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