]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/33436 (Bad constant output with TARGET_ASM_ALIGNED_DI_OP)
authorJohn David Anglin <dave.anglin@nrc-cnrc.gc.ca>
Tue, 22 Jan 2008 19:39:39 +0000 (19:39 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Tue, 22 Jan 2008 19:39:39 +0000 (19:39 +0000)
PR middle-end/33436
* expr.c (emit_group_load_1): Split constant double when destination
length is half source length.

From-SVN: r131739

gcc/ChangeLog
gcc/expr.c

index 4c52209fc4d538aa591a3e8ebc3835406866fd19..1c3d9d110e78edea8cb225674e65a1f1aa12fda9 100644 (file)
@@ -1,3 +1,12 @@
+2008-01-22  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+       Backport:
+       2007-09-27  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+       PR middle-end/33436
+       * expr.c (emit_group_load_1): Split constant double when destination
+       length is half source length.
+
 2008-01-22  Richard Guenther  <rguenther@suse.de>
 
        PR middle-end/34739
index 7ca1819088cf9b865c14e2a51c464f11b42c9b7f..9ef151eeb0c2eb68645242a324b1f0c25ef242b8 100644 (file)
@@ -1739,8 +1739,25 @@ emit_group_load_1 (rtx *tmps, rtx dst, rtx orig_src, tree type, int ssize)
       else if (CONSTANT_P (src) && GET_MODE (dst) != BLKmode
                && XVECLEN (dst, 0) > 1)
         tmps[i] = simplify_gen_subreg (mode, src, GET_MODE(dst), bytepos);
-      else if (CONSTANT_P (src)
-              || (REG_P (src) && GET_MODE (src) == mode))
+      else if (CONSTANT_P (src))
+       {
+         HOST_WIDE_INT len = (HOST_WIDE_INT) bytelen;
+
+         if (len == ssize)
+           tmps[i] = src;
+         else
+           {
+             rtx first, second;
+
+             gcc_assert (2 * len == ssize);
+             split_double (src, &first, &second);
+             if (i)
+               tmps[i] = second;
+             else
+               tmps[i] = first;
+           }
+       }
+      else if (REG_P (src) && GET_MODE (src) == mode)
        tmps[i] = src;
       else
        tmps[i] = extract_bit_field (src, bytelen * BITS_PER_UNIT,