]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR bootstrap/10983 ([SPARC64] ICE in verify_wide_reg, at flow.c:551, while compili...
authorJames E Wilson <wilson@tuliptree.org>
Fri, 13 Jun 2003 22:13:07 +0000 (22:13 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Fri, 13 Jun 2003 22:13:07 +0000 (22:13 +0000)
PR bootstrap/10983
* combine.c (make_extraction): Use gen_lowpart_for_combine
when extracting from a REG and not in the destination of a SET.

Co-Authored-By: Eric Botcazou <ebotcazou@libertysurf.fr>
From-SVN: r67916

gcc/ChangeLog
gcc/combine.c

index c526f71cd7b0a5ab4e842db677830be6b8ad6842..9a5424692e3dd806b1116b27af10ac6e59884d6e 100644 (file)
@@ -1,3 +1,10 @@
+2003-06-13  Jim Wilson  <wilson@tuliptree.org>
+            Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       PR bootstrap/10983
+       * combine.c (make_extraction): Use gen_lowpart_for_combine
+       when extracting from a REG and not in the destination of a SET.
+
 2003-06-13  Doug Evans  <dje@sebabeach.org>
 
        * tsystem.h (abort): Declare in inhibit_libc case to remove build
index 3e2f089bed978f1f77427b8968d9b1f3b621832d..16385767e66a1ff2055d09066667574b27281183 100644 (file)
@@ -6139,30 +6139,35 @@ make_extraction (enum machine_mode mode, rtx inner, HOST_WIDE_INT pos,
        }
       else if (GET_CODE (inner) == REG)
        {
-         /* We can't call gen_lowpart_for_combine here since we always want
-            a SUBREG and it would sometimes return a new hard register.  */
          if (tmode != inner_mode)
            {
-             HOST_WIDE_INT final_word = pos / BITS_PER_WORD;
-
-             if (WORDS_BIG_ENDIAN
-                 && GET_MODE_SIZE (inner_mode) > UNITS_PER_WORD)
-               final_word = ((GET_MODE_SIZE (inner_mode)
-                              - GET_MODE_SIZE (tmode))
-                             / UNITS_PER_WORD) - final_word;
-
-             final_word *= UNITS_PER_WORD;
-             if (BYTES_BIG_ENDIAN &&
-                 GET_MODE_SIZE (inner_mode) > GET_MODE_SIZE (tmode))
-               final_word += (GET_MODE_SIZE (inner_mode)
-                              - GET_MODE_SIZE (tmode)) % UNITS_PER_WORD;
-
-             /* Avoid creating invalid subregs, for example when
-                simplifying (x>>32)&255.  */
-             if (final_word >= GET_MODE_SIZE (inner_mode))
-               return NULL_RTX;
-
-             new = gen_rtx_SUBREG (tmode, inner, final_word);
+             if (in_dest)
+               {
+                 /* We can't call gen_lowpart_for_combine here since we always want
+                    a SUBREG and it would sometimes return a new hard register.  */
+                 HOST_WIDE_INT final_word = pos / BITS_PER_WORD;
+
+                 if (WORDS_BIG_ENDIAN
+                     && GET_MODE_SIZE (inner_mode) > UNITS_PER_WORD)
+                   final_word = ((GET_MODE_SIZE (inner_mode)
+                                  - GET_MODE_SIZE (tmode))
+                                 / UNITS_PER_WORD) - final_word;
+
+                 final_word *= UNITS_PER_WORD;
+                 if (BYTES_BIG_ENDIAN &&
+                     GET_MODE_SIZE (inner_mode) > GET_MODE_SIZE (tmode))
+                   final_word += (GET_MODE_SIZE (inner_mode)
+                                  - GET_MODE_SIZE (tmode)) % UNITS_PER_WORD;
+
+                 /* Avoid creating invalid subregs, for example when
+                    simplifying (x>>32)&255.  */
+                 if (final_word >= GET_MODE_SIZE (inner_mode))
+                   return NULL_RTX;
+
+                 new = gen_rtx_SUBREG (tmode, inner, final_word);
+               }
+             else
+               new = gen_lowpart_for_combine (tmode, inner);
            }
          else
            new = inner;