From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 27AA4383F866; Sat, 16 May 2020 12:15:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 27AA4383F866 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1589631355; bh=tUw5XxKHDahKm5J4u5OnbaqgqCMG2ZHoSRx4v4YMXw0=; h=From:To:Subject:Date:From; b=OQkl1xRPFXTWf48KyxPCETIpwVPUvFnXtWGrPkPRs1lRXPgiW3mD7qhRNAAjZcieo D5i6TI+GO2YOw1G+E+BR++nfEIkohrswLPjkIUNkc0b571aju0lqk4nL/9J+cEMMuE qw8ZZqE9lLnnyjbV0SUX+yIsx0ZtqWAXbaQBIv+c= From: "hjl.tools at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/95162] New: -mpreferred-stack-boundary=2 doesn't work with libgcc functions Date: Sat, 16 May 2020 12:15:54 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hjl.tools at gmail dot com 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone cf_gcctarget Message-ID: 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: Sat, 16 May 2020 12:15:55 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95162 Bug ID: 95162 Summary: -mpreferred-stack-boundary=3D2 doesn't work with libgcc functions Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: hjl.tools at gmail dot com CC: ubizjak at gmail dot com Target Milestone: --- Target: i386,x86-64 [hjl@gnu-cfl-2 pr95021]$ cat d.c void foo (_Decimal32 x) { if (x !=3D 3.0df) __builtin_abort (); } [hjl@gnu-cfl-2 pr95021]$ make d.s CC=3Dgcc gcc -O2 -W -m32 -mpreferred-stack-boundary=3D2 -S d.c [hjl@gnu-cfl-2 pr95021]$ cat d.s .file "d.c" .text .globl __bid_nesd2 .section .text.unlikely,"ax",@progbits .LCOLDB0: .text .LHOTB0: .p2align 4 .globl foo .type foo, @function foo: .LFB0: .cfi_startproc pushl $838860830 .cfi_def_cfa_offset 8 pushl 8(%esp) .cfi_def_cfa_offset 12 call __bid_nesd2 <<<<<<<< It expects 16 byte alignments. popl %edx .cfi_def_cfa_offset 8 popl %ecx .cfi_def_cfa_offset 4 testl %eax, %eax jne .L4 ret .cfi_endproc .section .text.unlikely .cfi_startproc .type foo.cold, @function foo.cold: .LFSB0: .L4: call abort .cfi_endproc .LFE0: .text .size foo, .-foo .section .text.unlikely .size foo.cold, .-foo.cold .LCOLDE0: .text .LHOTE0: .ident "GCC: (GNU) 10.1.1 20200507 (Red Hat 10.1.1-1)" .section .note.GNU-stack,"",@progbits [hjl@gnu-cfl-2 pr95021]$=20 When calling libgcc functions which expect 16-byte alignments, we should realign the outgoing stack.=