From: Oleg Endo Date: Mon, 23 Feb 2015 20:40:45 +0000 (+0000) Subject: backport: re PR target/65163 ([SH] ICE in decompose at rtl.h:2007) X-Git-Tag: releases/gcc-4.8.5~255 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=152e767e2fcc1c64f9034b7f79b2c772af5c8f91;p=thirdparty%2Fgcc.git backport: re PR target/65163 ([SH] ICE in decompose at rtl.h:2007) gcc/ Backport from mainline 2015-02-23 Oleg Endo 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 PR target/65163 * gcc.c-torture/compile/pr65163.c: New. From-SVN: r220918 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 014da10875a7..c48fa0719e94 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2015-02-23 Oleg Endo + + Backport from mainline + 2015-02-23 Oleg Endo + + PR target/65163 + * config/sh/sh.md (swapbsi2, related peephole2): Use const_int -65536 + instead of const_int 4294901760. + 2015-02-23 Dominik Vogt Backport from mainline diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md index f86ae3d3e1e6..5eb68e9737e4 100644 --- a/gcc/config/sh/sh.md +++ b/gcc/config/sh/sh.md @@ -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)) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c9c7c836de6e..1e89a1f38ad9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2015-02-23 Oleg Endo + + Backport from mainline + 2015-02-23 Oleg Endo + + PR target/65163 + * gcc.c-torture/compile/pr65163.c: New. + 2015-02-20 Georg-Johann Lay 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 index 000000000000..3a6b2880e31a --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr65163.c @@ -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; +}