From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DFA273858D39; Tue, 14 Mar 2023 01:08:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DFA273858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1678756112; bh=HxUg7Fg56wU6L/M/UbtTjy4Dkm0E51JvpyTgmqVOrB8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=QYz/v71f4wrx4ykZzApqC5FY9kM+1Jhol+85n7a5iJ3GR5mv3uMziQ7rrxIXJgWB2 XagdqfCAuFa7XaWcNEZPRGsvXH0PyAR8nIFzW3HUCm0q17KAJ/6L42I6aaBaRq7rnG ZnktHewG2Sc8YxkVs0woXrkP4e2uTqNUy3n4BXSk= From: "hjl.tools at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/109093] [13 regression] csmith: a February runtime bug ? Date: Tue, 14 Mar 2023 01:08:31 +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: 13.0 X-Bugzilla-Keywords: needs-reduction, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: hjl.tools at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 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=3D109093 H.J. Lu changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |crazylht at gmail dot com --- Comment #10 from H.J. Lu --- We have static bool ix86_can_eliminate (const int from, const int to) { if (stack_realign_fp) return ((from =3D=3D ARG_POINTER_REGNUM && to =3D=3D HARD_FRAME_POINTER_REGNUM) || (from =3D=3D FRAME_POINTER_REGNUM && to =3D=3D STACK_POINTER_REGNUM)); else=20=20 return to =3D=3D STACK_POINTER_REGNUM ? !frame_pointer_needed : true;=20 } Before IRA, stack_realign_fp is set to true by AVX piecewise move and store. LRA replaces frame pointer with stack pointer: insn 259 261 297 4 (set (reg/f:DI 2 cx [144]) (plus:DI (reg/f:DI 7 sp) (const_int -32 [0xffffffffffffffe0]))) 241 {*leadi} (expr_list:REG_EQUAL (plus:DI (reg/f:DI 19 frame) (const_int -32 [0xffffffffffffffe0])) (nil))) In ix86_finalize_stack_frame_flags, stack_realign_fp is set to false. Since the stack realignment skipped, local variable is no longer properly aligned= .=