]> 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:37:20 +0000 (20:37 +0000)
committerOleg Endo <olegendo@gcc.gnu.org>
Mon, 23 Feb 2015 20:37:20 +0000 (20:37 +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: r220917

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

index b2b2398a1d01652867bf9b7fdb804cfa2ff90e72..72b3137eb6661e782b385512afda3263f3eca84f 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  Richard Biener  <rguenther@suse.de>
 
        Backport from mainline
index d957e55400bde60d28509abf7fcb1e4400926470..2b4123165ba3716789ee81145e6eae7de21ecbce 100644 (file)
@@ -5847,7 +5847,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))
@@ -5915,7 +5915,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))
@@ -5925,7 +5925,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 d9bff1567fc792fa6ad74d0faff14b0b3e5a7e4a..d3bd0f0b38a4158e51eed5ffea4b4b9766ecafcb 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-23  Richard Biener  <rguenther@suse.de>
 
        Backport from mainline
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;
+}