]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
combine.c (apply_distributive_law <SUBREG>): Check TRULY_NOOP_TRUNCATION.
authorAdam Nemet <anemet@caviumnetworks.com>
Tue, 3 Jan 2006 05:05:06 +0000 (05:05 +0000)
committerAdam Nemet <nemet@gcc.gnu.org>
Tue, 3 Jan 2006 05:05:06 +0000 (05:05 +0000)
* combine.c (apply_distributive_law <SUBREG>): Check
TRULY_NOOP_TRUNCATION.

From-SVN: r109261

gcc/ChangeLog
gcc/combine.c

index cac247956039a7fdd63631ef2cd2f47da6d792e4..1be3f95da3ff16bdf3609e6bbf5272804cf87ff7 100644 (file)
@@ -1,3 +1,8 @@
+2006-01-02  Adam Nemet  <anemet@caviumnetworks.com>
+
+       * combine.c (apply_distributive_law <SUBREG>): Check
+       TRULY_NOOP_TRUNCATION.
+
 2006-01-02  Geoffrey Keating  <geoffk@apple.com>
 
        * dwarf2out.c (have_switched_text_section): Delete.
index 1361b10d27c04c83d237cdd8e6e8e0af5fe1e373..e9bd6676792436cd70914852a776f236a208fbe3 100644 (file)
@@ -7798,7 +7798,12 @@ apply_distributive_law (rtx x)
          || (GET_MODE_SIZE (GET_MODE (lhs))
              > GET_MODE_SIZE (GET_MODE (SUBREG_REG (lhs))))
          || VECTOR_MODE_P (GET_MODE (lhs))
-         || GET_MODE_SIZE (GET_MODE (SUBREG_REG (lhs))) > UNITS_PER_WORD)
+         || GET_MODE_SIZE (GET_MODE (SUBREG_REG (lhs))) > UNITS_PER_WORD
+         /* Result might need to be truncated.  Don't change mode if
+            explicit truncation is needed.  */
+         || !TRULY_NOOP_TRUNCATION
+              (GET_MODE_BITSIZE (GET_MODE (x)),
+               GET_MODE_BITSIZE (GET_MODE (SUBREG_REG (lhs)))))
        return x;
 
       tem = simplify_gen_binary (code, GET_MODE (SUBREG_REG (lhs)),