From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9674C385DC11; Mon, 5 Feb 2024 19:08:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9674C385DC11 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1707160135; bh=tQWNyUnXJckun4JXfR4pI09WP/q2SZaz4aGRWDqTZVg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=An8PzHZq4YJIMcxkPApO0kM90ft6gemI6b6YacduBqC88SueXNRq+VYfuTD+Rao1s tC6Ppsnfv479o1z5o/xRN8tqUW8rEUbwZTJAVv/yYhr7OQCEdBNurpNjLrT9nVxhW2 yQDVr4tCERW3APJCZatEsj6KSyeQm+qBJoyFoi9c= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/113689] [11/12/13/14 Regression] wrong code with -fprofile -mcmodel=large when needing drap register since r11-6548 Date: Mon, 05 Feb 2024 19:08:53 +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: 14.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit 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: 11.5 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=3D113689 --- Comment #5 from GCC Commits --- The master branch has been updated by H.J. Lu : https://gcc.gnu.org/g:51f8ac3341078303e81e72d9013698a31c5ddd29 commit r14-8808-g51f8ac3341078303e81e72d9013698a31c5ddd29 Author: H.J. Lu Date: Thu Feb 1 08:02:27 2024 -0800 x86-64: Find a scratch register for large model profiling 2 scratch registers, %r10 and %r11, are available at function entry for large model profiling. But %r10 may be used by stack realignment and we can't use %r10 in this case. Add x86_64_select_profile_regnum to find a caller-saved register which isn't live or a callee-saved register which has been saved on stack in the prologue at entry for large model profiling and sorry if we can't find one. gcc/ PR target/113689 * config/i386/i386.cc (x86_64_select_profile_regnum): New. (x86_function_profiler): Call x86_64_select_profile_regnum to get a scratch register for large model profiling. gcc/testsuite/ PR target/113689 * gcc.target/i386/pr113689-1.c: New file. * gcc.target/i386/pr113689-2.c: Likewise. * gcc.target/i386/pr113689-3.c: Likewise.=