From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D32BD384DEF5; Mon, 26 Aug 2024 04:16:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D32BD384DEF5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1724645777; bh=RmbJK1WwZuOboXOSBRoCI/y3dyenOC98+EdnQ7ARe5M=; h=From:To:Subject:Date:In-Reply-To:References:From; b=jjE34YV1jBNNXeUUG/3S/dGmT2rYKl4jNeafo2kxeZOfu6aASTALxUDYESYc1gdEV 5AHxRDMxkJ0R1HJGtk/zVYo+CBlqEpJ0WyycMytEaplAIIgREylhkFkjhIHusNp2HI pfrpCoSYst/Da86VyphLVdHZT67b8D1+ge+RTXj4= From: "guojiufu at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/97448] Unneccessary stack frame when using stack protector Date: Mon, 26 Aug 2024 04:16:15 +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.1.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: guojiufu at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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=3D97448 Jiu Fu Guo changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |guojiufu at gcc dot gnu.org --- Comment #2 from Jiu Fu Guo --- In rs6000-logue.cc, there are code to check if there are something(var/vector/...) using stack. But the vars_size is adjusted under these options, and then even if there are no vars, the 'vars_size' is not '0'(it becomes padding size). So, tune code: unadjust_vars_size =3D info->vars_size; if (FRAME_GROWS_DOWNWARD) 773 info->vars_size 774 +=3D RS6000_ALIGN (info->fixed_size + info->vars_size + info->parm_size, 775 ABI_STACK_BOUNDARY / BITS_PER_UNIT) 776 - (info->fixed_size + info->vars_size + info->parm_size); unajust_non_fixed_size =3D unadjust_vars_size + info->parm_size + info->save_size; 868 non_fixed_size =3D info->vars_size + info->parm_size + info->save_si= ze; 919 info->push_p =3D non_fixed_size !=3D 0; =3D=3D> 919 info->push_p =3D unajust_non_fixed_size !=3D 0; Sorry for not putting the patch here.=