Fix pessimistic DImode handling in combine.c:make_field_assignment
authorRichard Sandiford <richard.sandiford@linaro.org>
Mon, 12 Jun 2017 16:06:38 +0000 (16:06 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Mon, 12 Jun 2017 16:06:38 +0000 (16:06 +0000)
The make_field_assignment code:

      src = force_to_mode (src, mode,
       GET_MODE_PRECISION (mode) >= HOST_BITS_PER_WIDE_INT
       ? HOST_WIDE_INT_M1U
       : (HOST_WIDE_INT_1U << len) - 1,
       0);

would ignore the field length len for DImode, even though DImode can be
handled using HWIs.  I think the code should be testing len instead.

2017-06-12  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
* combine.c (make_field_assignment): Check len rather than the mode
precision when calling force_to_mode.

From-SVN: r249128

gcc/ChangeLog
gcc/combine.c

index d4f4dee2714130eaac2a2ac6ffd282af50f66f1d..cc5435d54a60bba6c4bb125a74c9441267c45b22 100644 (file)
@@ -1,3 +1,8 @@
+2017-06-12  Richard Sandiford  <richard.sandiford@linaro.org>
+
+       * combine.c (make_field_assignment): Check len rather than the mode
+       precision when calling force_to_mode.
+
 2017-06-12  Georg-Johann Lay  <avr@gjlay.de>
 
        Support multilibs and devices that see flash in RAM address range.
index 39ef3c6ecb82e364ca41e12877559252d67b4fe9..2d49bc2233c98ac7d4f8e59d80458d7bee39269c 100644 (file)
@@ -9634,7 +9634,7 @@ make_field_assignment (rtx x)
                                                     other, pos),
                               dest);
   src = force_to_mode (src, mode,
-                      GET_MODE_PRECISION (mode) >= HOST_BITS_PER_WIDE_INT
+                      len >= HOST_BITS_PER_WIDE_INT
                       ? HOST_WIDE_INT_M1U
                       : (HOST_WIDE_INT_1U << len) - 1,
                       0);