From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1D7093A76429; Fri, 23 Apr 2021 09:09:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1D7093A76429 From: "iains at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/100152] [10/11/12 Regression] used caller-saved register not preserved across a call. Date: Fri, 23 Apr 2021 09:09:38 +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: 10.3.0 X-Bugzilla-Keywords: ra, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: iains at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.4 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, 23 Apr 2021 09:09:39 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100152 --- Comment #36 from Iain Sandoe --- (In reply to Richard Biener from comment #35) > Which means another possible candidate for the "bug" is darwin_binds_loca= l_p yeah... see below. > > > .. but something similar must apply to PLT and targets with linker ve= neers ? > >=20 > > I don't know how IPA RA works in detail but obviously the target has to > > expose this detail. It looks like IPA RA causes us to add some notes to > > call insns which are supposed to describe those details and there's > > collect_fn_hard_reg_usage which looks at the target function (but likely > > does not include the ABI details of the call itself, in this case the > > resolver). > @deftypevr {Target Hook} bool TARGET_CALL_FUSAGE_CONTAINS_NON_CALLEE_CLOB= BERS > Set to true if each call that binds to a local definition explicitly > clobbers or sets all non-fixed registers modified by performing the call. > That is, by the call pattern itself, or by code that might be inserted by= the > linker (e.g.@: stubs, veneers, branch islands), but not including those > modifiable by the callee. The affected registers may be mentioned explic= itly > in the call pattern, or included as clobbers in CALL_INSN_FUNCTION_USAGE. > The default version of this hook is set to false. The purpose of this ho= ok > is to enable the fipa-ra optimization. > @end deftypevr thanks for the pointer, I'll take a look at that when i have some cycles. I guess it was never added at the time the IPA stuff was done... and someho= w we "got away with it" mostly. > might be relevant - though when compiling for a shared library the call > to ___UTF_8_put does not bind locally (but then IPA RA shouldn't apply > either I guess). So, does ___UTF_8_put bind locally? extern void ___UTF_8_put (char* *ptr, unsigned int c) If it does, then that's also a bug :), will have to check (sometime later). (we are always building with fPIC for x86_64, snd don't specifically identi= fy that the result will be a shlib [all Darwin exes are DSOs too] - although Linux does identify shlibs as something special).=