From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0B65D396E876; Fri, 16 Apr 2021 11:38:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0B65D396E876 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/99596] [11 Regression] arm: internal error in single_pred_edge Date: Fri, 16 Apr 2021 11:38:19 +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: 11.0 X-Bugzilla-Keywords: ice-on-valid-code 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: rsandifo at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.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: Fri, 16 Apr 2021 11:38:20 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99596 --- Comment #4 from CVS Commits --- The master branch has been updated by Richard Sandiford : https://gcc.gnu.org/g:b4d6af55fe55c0eab87ab875bfd0346677e12236 commit r11-8213-gb4d6af55fe55c0eab87ab875bfd0346677e12236 Author: Richard Sandiford Date: Fri Apr 16 12:38:01 2021 +0100 rtlanal: Don't assume that calls write to a global SP [PR99596] This patch is a GCC 11 regression caused by the rtl-ssa code. Normally we treat calls as containing a potential set of a global register, but DF makes a sensible exception for the stack pointer: if (i =3D=3D STACK_POINTER_REGNUM) /* The stack ptr is used (honorarily) by a CALL insn. */ df_ref_record (DF_REF_BASE, collection_rec, regno_reg_rtx[i], NULL, bb, insn_info, DF_REF_REG_USE, DF_REF_CALL_STACK_USAGE | flags); else if (global_regs[i]) { /* Calls to const functions cannot access any global registers and calls to pure functions cannot set them. All other calls = may reference any of the global registers, so they are recorde= d as used. */ The only DF definition of SP was therefore the one in the entry block. However, the rtlanal.c rtx_properties code (wrongly) assumed that calls also clobbered the global SP. This led to multiple definitions of SP when we only expected one. This patch tightens the rtlanal.c handling of global registers to match the DF approach. gcc/ PR rtl-optimization/99596 * rtlanal.c (rtx_properties::try_to_add_insn): Don't add global register accesses for const calls. Assume that pure functions can only read from global registers. Ignore cases in which the stack pointer has been marked global. gcc/testsuite/ PR rtl-optimization/99596 * gcc.target/arm/pr99596.c: New test.=