From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7CC163858012; Thu, 3 Mar 2022 08:12:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7CC163858012 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/104558] [9/10/11/12 Regression] ICE: in expand_call, at calls.cc:3601 with -fabi-version=9 on pr83487.c Date: Thu, 03 Mar 2022 08:12:32 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 12.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: P2 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: 9.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 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: Thu, 03 Mar 2022 08:12:32 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104558 --- Comment #4 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:e6e6e0a97340068c90fe091482efbaacd6474754 commit r12-7458-ge6e6e0a97340068c90fe091482efbaacd6474754 Author: Jakub Jelinek Date: Thu Mar 3 09:11:09 2022 +0100 calls: When bypassing emit_push_insn for 0 sized arg, emit at least anti_adjust_stack for alignment pad if needed [PR104558] The following testcase ICEs on x86_64 when asked to use the pre-GCC 8 ABI where zero sized arguments weren't ignored. In GCC 7 the emit_push_insn calls in store_one_arg were unconditional, it is true that they didn't actually push anything because it had zero size, but because arg->locate.alignment_pad is 8 in this case, emit_push_insn at the end performs if (alignment_pad && args_addr =3D=3D 0) anti_adjust_stack (alignment_pad); and an assert larger on is upset if we don't do it. The following patch keeps the emit_push_insn conditional but calls the anti_adjust_stack when needed by hand for the zero sized arguments. For the new x86_64 ABI where zero sized arguments are ignored arg->locate.alignment_pad is 0 in this case, so nothing changes - we in that case really do ignore it. There is another emit_push_insn call earlier in store_one_arg, also made conditional on non-zero size by Marek in GCC 8, but that one is for arguments with non-BLKmode and the only way those can be zero size is if they are TYPE_EMPTY_P aka when they are completely ignored. But I believe arg->locate.alignment_pad should be 0 in that case, so IMHO there is no need to do anything in the second spot. 2022-03-03 Jakub Jelinek PR middle-end/104558 * calls.cc (store_one_arg): When not calling emit_push_insn because size_rtx is const0_rtx, call at least anti_adjust_stack on arg->locate.alignment_pad if !argblock and the alignment mig= ht be non-zero. * gcc.dg/pr104558.c: New test.=