From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DFFEC3858D35; Sat, 3 Jun 2023 15:43:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DFFEC3858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685806990; bh=P1gqKuz9H9P3CMUM1SZMdXND+u2Njqr6zaQqR8LtZ6o=; h=From:To:Subject:Date:In-Reply-To:References:From; b=i1zYc/FR/0C3UEfti/hITj3Fdx3Y1HWtBlgG+Rx3YjiNsUVxNuv/UxgL+0r+CC9OC cgIGUatyBicMuHhbGfFRSZ974HS98MGhWtgvfVCJZCTExSb4IG++92fAywl3sY9OO5 X/fAIx8+EzRseGDYu87F+sNNRM/FJhKQpCCrJg+Q= From: "klepikov.alex+bugs at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/54089] [SH] Refactor shift patterns Date: Sat, 03 Jun 2023 15:43:09 +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: klepikov.alex+bugs at gmail dot com X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: olegendo 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D54089 --- Comment #56 from Alexander Klepikov --- > > Regarding testsuite. There's execute fails, but this is due to lack of > > multilib. I'll rebuild and retest. > >=20 > > There's also fail in pr64345-1.c, in this function: > > [...] > >=20 > > But it looks more like it's not a fail, but an optimization. >=20 > Yeah, that looks like an improvement. There might be some SH specific te= sts > that scan for particular assembler outputs like that one. Those tests wo= uld > need to be adjusted of course. I checked and that one was the only one. > In that test you can see the unnecessary push/pop of PR. This is because > initially it wanted to expand as a library call, but then your patterns > decided to change the insns. This can or can't be avoided, depending on t= he > case. That's an valuable observation, thank you! I found why. Sometimes 'collapsed libcall' instruction is emitted in combine pass and 'clobber PR' is set the= n. I commented this out and checked that file and it seems to be OK. I will rerun testsuite again to be sure. Now regarding tests that fail on vanilla GCC and pass with patch. It looks = like something was changed in the middle of GCC and it started to produce other instruction patterns that cannot be catched by existing isns and thus expan= ded to library calls. The patch simply fixed it.=