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]

Re: [testcase] ia32 extract_bit_field failure



> * gcc.c-torture/compile/20001212-1.c: New test.

How's this?

2001-01-30  DJ Delorie  <dj@redhat.com>

	* expmed.c (extract_bit_field): allow non-integral modes if we
	want to extract a whole register from itself.

Index: expmed.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/expmed.c,v
retrieving revision 1.75
diff -p -3 -r1.75 expmed.c
*** expmed.c	2001/01/21 09:19:15	1.75
--- expmed.c	2001/01/31 02:53:12
*************** extract_bit_field (str_rtx, bitsize, bit
*** 1027,1032 ****
--- 1027,1041 ----
        op0 = SUBREG_REG (op0);
      }
  
+   if (GET_CODE (op0) == REG
+       && mode == GET_MODE (op0)
+       && bitnum == 0
+       && bitsize == GET_MODE_BITSIZE (GET_MODE (op0)))
+     {
+       /* We're trying to extract a full register from itself.  */
+       return op0;
+     }
+ 
    /* Make sure we are playing with integral modes.  Pun with subregs
       if we aren't.  */
    {

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