]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR target/65163 ([SH] ICE in decompose at rtl.h:2007)
authorOleg Endo <olegendo@gcc.gnu.org>
Mon, 23 Feb 2015 20:40:45 +0000 (20:40 +0000)
committerOleg Endo <olegendo@gcc.gnu.org>
Mon, 23 Feb 2015 20:40:45 +0000 (20:40 +0000)
gcc/
Backport from mainline
2015-02-23  Oleg Endo  <olegendo@gcc.gnu.org>

PR target/65163
* config/sh/sh.md (swapbsi2, related peephole2): Use const_int -65536
instead of const_int 4294901760.

gcc/testsuite/
Backport from mainline
2015-02-23  Oleg Endo  <olegendo@gcc.gnu.org>

PR target/65163
* gcc.c-torture/compile/pr65163.c: New.

From-SVN: r220918

gcc/ChangeLog
gcc/config/sh/sh.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr65163.c [new file with mode: 0644]

index 014da10875a7a97841a31bea821cc7adf4c8c5d0..c48fa0719e9487f2ed8cc9d20d4e5ff0ef2b33c6 100644 (file)
@@ -1,3 +1,12 @@
+2015-02-23  Oleg Endo  <olegendo@gcc.gnu.org>
+
+       Backport from mainline
+       2015-02-23  Oleg Endo  <olegendo@gcc.gnu.org>
+
+       PR target/65163
+       * config/sh/sh.md (swapbsi2, related peephole2): Use const_int -65536
+       instead of const_int 4294901760.
+
 2015-02-23  Dominik Vogt  <vogt@linux.vnet.ibm.com>
 
        Backport from mainline
index f86ae3d3e1e6769f34b05bd7818e8e486b8730e9..5eb68e9737e43f0ef67655da9c173d534fefb00c 100644 (file)
@@ -5649,7 +5649,7 @@ label:
 (define_insn "swapbsi2"
   [(set (match_operand:SI 0 "arith_reg_dest" "=r")
        (ior:SI (and:SI (match_operand:SI 1 "arith_reg_operand" "r")
-                       (const_int 4294901760))
+                       (const_int -65536)) ;; 0xFFFF0000
                (ior:SI (and:SI (ashift:SI (match_dup 1) (const_int 8))
                                (const_int 65280))
                        (and:SI (ashiftrt:SI (match_dup 1) (const_int 8))
@@ -5717,7 +5717,7 @@ label:
 (define_peephole2
   [(set (match_operand:SI 0 "arith_reg_dest" "")
        (ior:SI (and:SI (match_operand:SI 1 "arith_reg_operand" "")
-                       (const_int 4294901760))
+                       (const_int -65536)) ;; 0xFFFF0000
                (ior:SI (and:SI (ashift:SI (match_dup 1) (const_int 8))
                                (const_int 65280))
                        (and:SI (ashiftrt:SI (match_dup 1) (const_int 8))
@@ -5727,7 +5727,7 @@ label:
   "TARGET_SH1 && peep2_reg_dead_p (2, operands[0])"
   [(set (match_dup 2)
        (ior:SI (and:SI (match_operand:SI 1 "arith_reg_operand" "")
-                       (const_int 4294901760))
+                       (const_int -65536)) ;; 0xFFFF0000
                (ior:SI (and:SI (ashift:SI (match_dup 1) (const_int 8))
                                (const_int 65280))
                        (and:SI (ashiftrt:SI (match_dup 1) (const_int 8))
index c9c7c836de6e515b4abd4665f5a35c0c1772db58..1e89a1f38ad97bbd2a65a90bc3fab5abacc10758 100644 (file)
@@ -1,3 +1,11 @@
+2015-02-23  Oleg Endo  <olegendo@gcc.gnu.org>
+
+       Backport from mainline
+       2015-02-23  Oleg Endo  <olegendo@gcc.gnu.org>
+
+       PR target/65163
+       * gcc.c-torture/compile/pr65163.c: New.
+
 2015-02-20  Georg-Johann Lay  <avr@gjlay.de>
 
        Backport from 2015-02-20 trunk r220847.
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr65163.c b/gcc/testsuite/gcc.c-torture/compile/pr65163.c
new file mode 100644 (file)
index 0000000..3a6b288
--- /dev/null
@@ -0,0 +1,22 @@
+/* PR target/65163  */
+
+typedef unsigned int uint32_t;
+typedef unsigned short uint16_t;
+union unaligned_32 { uint32_t l; } __attribute__((packed));
+union unaligned_16 { uint16_t l; } __attribute__((packed));
+
+int
+test_00 (unsigned char* buf, int bits_per_component)
+{
+  (((union unaligned_32*)(buf))->l) =
+    __builtin_bswap32 (bits_per_component == 10 ? 1 : 0);
+  return 0;
+}
+
+int
+test_01 (unsigned char* buf, int bits_per_component)
+{
+  (((union unaligned_16*)(buf))->l) =
+    __builtin_bswap16 (bits_per_component == 10 ? 1 : 0);
+  return 0;
+}