From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1656 invoked by alias); 21 Dec 2014 16:54:38 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 1433 invoked by uid 48); 21 Dec 2014 16:54:31 -0000 From: "olegendo at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/53987] [SH] Unnecessary zero-extensions Date: Sun, 21 Dec 2014 16:54:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 4.8.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: olegendo at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-12/txt/msg02516.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D53987 --- Comment #5 from Oleg Endo --- (In reply to Oleg Endo from comment #4) > It seems that converting unsigned values to signed values, i.e. replacing > zero-extensions with sign-extensions and recombining sign-extensions with > loads could make sense in general. >=20 > For example, the following code from CSiBE > mpeg2dec-0.3.1/libmpeg2/motion_comp.s contains sequences like: >=20 > _MC_put_x_8_c: > .align 2 > .L24: > mov.b @r5,r0 > sett > extu.b r0,r1 > mov.b @(1,r5),r0 > extu.b r0,r0 > addc r1,r0 > shar r0 > mov.b r0,@r4 > sett > mov.b @(1,r5),r0 > extu.b r0,r3 > mov.b @(2,r5),r0 > extu.b r0,r1 > mov r3,r0 > addc r1,r0 > shar r0 > mov.b r0,@(1,r4) > .... >=20 > Here effectively only 8 bit values are calculated. The zero-extensions c= an > be omitted, since the higher bits do not influence the result of the lowe= st > 8 bits and the higher bits are discarded after the 8 bit stores. Sorry, bad example. The zero-extensions can't be emitted in this case beca= use of the right shift. In the following example bits > 15 are don't care void test_0 (unsigned short* x, int y, int z) { x[11] =3D ((x[0] + x[1] + 1) << 1) + ((x[2] + x[3] + 1) << 2) - y; } .. and there are no zero-extensions in this case. Using function arguments instead: void test_1 (unsigned short* x, unsigned short a, unsigned short b, unsigned short c, unsigned short d, unsigned short e) { x[11] =3D ((a + b + 1) << 1) + ((c + d + 1) << 2) - e; } ... brings back the zero extensions. This is probably because of the SH ABI (PR 52441), but in this case the extensions are really not needed. >>From gcc-bugs-return-471510-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 21 17:24:32 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 11221 invoked by alias); 21 Dec 2014 17:24:30 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 11163 invoked by uid 48); 21 Dec 2014 17:24:20 -0000 From: "olegendo at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/64366] Segmentation fault in remove_pseudos Date: Sun, 21 Dec 2014 17:24:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: ice-on-valid-code, ra X-Bugzilla-Severity: normal X-Bugzilla-Who: olegendo at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on everconfirmed Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-12/txt/msg02517.txt.bz2 Content-length: 573 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64366 Oleg Endo changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2014-12-21 Ever confirmed|0 |1 --- Comment #1 from Oleg Endo --- I get the same here when trying to compile the CSiBE set for -m4-single -O2 -mpretend-cmove and LRA enabled.