From: DJ Delorie <dj@redhat.com>
Date: Wed, 31 Jan 2001 19:05:49 +0000 (-0500)
Subject: expmed.c (extract_bit_field): allow non-integral modes if we want to extract a whole... 
X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=aac280fbf0443390d32f7e29f8085e9902a95aa7;p=gcc.git

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

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

From-SVN: r39381
---

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d82c6c99bcf..fb457a14a7f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2001-12-31  DJ Delorie  <dj@redhat.com>
+
+	* expmed.c (extract_bit_field): allow non-integral modes if we
+	want to extract a whole register from itself.
+
 2001-01-31  Jakub Jelinek  <jakub@redhat.com>
 
 	* c-typeck.c (set_init_index): If first is equal to last, assume as
diff --git a/gcc/expmed.c b/gcc/expmed.c
index 5a2e7f0131e..6eb5f9ebfee 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -1027,6 +1027,15 @@ extract_bit_field (str_rtx, bitsize, bitnum, unsignedp,
       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.  */
   {