From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6C83A3887011; Wed, 8 Apr 2020 10:05:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6C83A3887011 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1586340330; bh=5vlYfE5aPqOEIQqJoIqFw1aJfPj4rSiDS+m5zzkhTEQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=LKvPuYmFXhx61ZIs7zUXB471dPOlzzmYfs8QbHef73p5xBB8uV1OY3AWEy8oFQJrN DViUTzSbitwECtbBVJjMni+6RhVaT2/IasmqhFHkeOFYv8M8qNqg3jC4GkWQk7I6J8 /7dQII3vLX0i9v+k6rLcJ8TY/6Rh+LRl6tmQIQ6k= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/94516] [10 Regression] gnutls test ./psk-file fails since r10-7515-g2c0fa3ecf70d199af18785702e9e0548fd3ab793 Date: Wed, 08 Apr 2020 10:05:30 +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: 10.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.0 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-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2020 10:05:30 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94516 --- Comment #10 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:70b55b25aa14b60f0e0f0193f7178bae756076ad commit r10-7617-g70b55b25aa14b60f0e0f0193f7178bae756076ad Author: Jakub Jelinek Date: Wed Apr 8 12:04:46 2020 +0200 postreload: Fix autoinc handling in reload_cse_move2add [PR94516] The following testcase shows two separate issues caused by the cselib changes. One is that through the cselib sp tracking improvements on ... r12 =3D rsp; rsp -=3D 8; push cst1; push cst2; push cst3; call rsp +=3D 32; rsp -=3D 8; push cst4; push cst5; push cst6; call rsp +=3D 32; rsp -=3D 8; push cst7; push cst8; push cst9; call rsp +=3D 32 reload_cse_simplify_set decides to optimize the rsp +=3D 32 insns into rsp =3D r12 because cselib figures that the r12 register holds the= right value. From the pure cost perspective that seems like a win and on its= own at least for -Os that would be beneficial, except that there are those rsp -=3D 8 stack adjustments after it, where rsp +=3D 32; rsp -=3D 8; is optimized into rsp +=3D 24; by the csa pass, but rsp =3D r12; rsp -=3D 8 can't. = Dunno what to do about this part, the PR has a hack in a comment. Anyway, the following patch fixes the other part, which isn't a missed optimization, but a wrong-code issue. The problem is that the pushes of constant are on x86 represented through PRE_MODIFY and while move2add_note_store has some code to handle {PRE,POST}_{INC,DEC} without REG_INC note, it doesn't handle {PRE,POST}_MODIFY (that would be enough to fix this testcase). But additionally it looks misplaced, because move2add_note_store is only called on the rtxes that are stored into, while RTX_AUTOINC can happen not just in those, but anywhere else in the instruction (e.g. pop insn can have autoinc in the SET_SRC MEM). REG_INC note seems to be required for any autoinc except for stack poin= ter autoinc which doesn't have those notes, so this patch just handles the sp autoinc after the REG_INC note handling loop. 2020-04-08 Jakub Jelinek PR rtl-optimization/94516 * postreload.c: Include rtl-iter.h. (reload_cse_move2add): Handle SP autoinc here by FOR_EACH_SUBRTX_VAR looking for all MEMs with RTX_AUTOINC operand. (move2add_note_store): Remove {PRE,POST}_{INC,DEC} handling. * gcc.dg/torture/pr94516.c: New test.=