From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 92D043851C37; Mon, 1 Jun 2020 20:47:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 92D043851C37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1591044469; bh=OZYiDT8lB2wY7FLPAO08bTQYHguwSmPg/U2odBFVwco=; h=From:To:Subject:Date:In-Reply-To:References:From; b=YTmUkoqjyhBePLfjQGWzKt6knhytahIx7tcVDKUT4S/KKk5+sxu4npFr+WtbX7YCC EKBU++2MOSmwP8/R15R6kGcyOeITgnJPHnnAcoV09KxB+twe+fpDAghXlej7CYXbpN zYqfDhCYqjF2I8ufkf+vq3n1dEZT+MvrxAhJQD3Y= From: "skpgkp2 at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/95237] LOCAL_DECL_ALIGNMENT shrinks alignment, FAIL gcc.target/i386/pr69454-2.c Date: Mon, 01 Jun 2020 20:47:49 +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: 11.0 X-Bugzilla-Keywords: ice-on-valid-code, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: skpgkp2 at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: skpgkp2 at gmail dot com X-Bugzilla-Target-Milestone: 11.0 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: Mon, 01 Jun 2020 20:47:49 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95237 --- Comment #4 from Sunil Pandey --- This test case and many other regression on x86 caused by following change = set r11-508 Good =3D=3D=3D=3D $ /local/skpandey/gccwork/pr95237/tools-build/gcc-debug-r11-507/release/usr/g= cc-11.0.0-x86-64/bin/gcc -m32 -mpreferred-stack-boundary=3D2 foo.c bash-5.0$ echo $? 0 Bad =3D=3D=3D bash-5.0$ /local/skpandey/gccwork/pr95237/tools-build/gcc-debug-r11-508/release/usr/g= cc-11.0.0-x86-64/bin/gcc -m32 -mpreferred-stack-boundary=3D2 foo.c during GIMPLE pass: adjust_alignment foo.c: In function ??main??: foo.c:7:5: internal compiler error: in execute, at adjust-alignment.c:73 7 | int main() | ^~~~ 0x206a091 execute /local/skpandey/gccwork/pr95237/gcc/gcc/adjust-alignment.c:73 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See for instructions. $git show dfa4fcdba374ed44d4aa1a22b2738f3f5c5b37af commit dfa4fcdba374ed44d4aa1a22b2738f3f5c5b37af Author: Kito Cheng Date: Tue Apr 14 14:53:19 2020 +0800 Fix alignment for local variable [PR90811] - The alignment for local variable was adjust during estimate_stack_frame_size, however it seems wrong spot to adjust that, expand phase will adjust that but it little too late to some gimple optimization, which rely on certain target hooks need to check alignment, forwprop is an example for that, result of simplify_builtin_call rely on the alignment on some target like ARM or RISC-V. - Exclude static local var and hard register var in the process of alignment adjustment. - This patch fix gfortran.dg/pr45636.f90 for arm and riscv. - Regression test on riscv32/riscv64 and x86_64-linux-gnu, no new fail introduced. gcc/ChangeLog PR target/90811 * Makefile.in (OBJS): Add adjust-alignment.o. * adjust-alignment.c (pass_data_adjust_alignment): New. (pass_adjust_alignment): New. (pass_adjust_alignment::execute): New. (make_pass_adjust_alignment): New. * tree-pass.h (make_pass_adjust_alignment): New. * passes.def: Add pass_adjust_alignment. diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9eee988e12c..fdaa94ae8b9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2020-05-20 Kito Cheng + + PR target/90811 + * Makefile.in (OBJS): Add adjust-alignment.o. + * adjust-alignment.c (pass_data_adjust_alignment): New. + (pass_adjust_alignment): New. + (pass_adjust_alignment::execute): New. + (make_pass_adjust_alignment): New. + * tree-pass.h (make_pass_adjust_alignment): New. + * passes.def: Add pass_adjust_alignment. GDB dump: =3D=3D=3D=3D=3D=3D=3D=3D=3D The program being debugged has been started already. Start it from the beginning? (y or n) y Starting program: /local/skpandey/gccwork/pr95237/tools-build/gcc-debug-r11-508/release/usr/g= cc-11.0.0-x86-64/libexec/gcc/x86_64-pc-linux-gnu/11.0.0/cc1 -quiet -imultilib 32 -iprefix /local/skpandey/gccwork/pr95237/tools-build/gcc-debug-r11-508/release/usr/g= cc-11.0.0-x86-64/bin/../lib/gcc/x86_64-pc-linux-gnu/11.0.0/ foo.c -quiet -dumpbase foo.c -m32 -mpreferred-stack-boundary=3D2 -mtune=3Dg= eneric -march=3Dx86-64 -auxbase foo -o /tmp/ccEnTcu1.s File "/usr/share/gdb/auto-load/usr/lib64/libisl.so.15.1.1-gdb.py", line 67 print "No isl printer for this type" ^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print("No= isl printer for this type")? Breakpoint 1, (anonymous namespace)::pass_adjust_alignment::execute (this=3D0x32fbb10, fun=3D0x7fffea9340b0) at /local/skpandey/gccwork/pr95237/gcc/gcc/adjust-alignment.c:73 73 gcc_assert (align >=3D DECL_ALIGN (var)); (gdb) c Continuing. Breakpoint 1, (anonymous namespace)::pass_adjust_alignment::execute (this=3D0x32fbb10, fun=3D0x7fffea9340b0) at /local/skpandey/gccwork/pr95237/gcc/gcc/adjust-alignment.c:73 73 gcc_assert (align >=3D DECL_ALIGN (var)); (gdb) n during GIMPLE pass: adjust_alignment foo.c: In function ??main??: foo.c:7:5: internal compiler error: in execute, at adjust-alignment.c:73 7 | int main() | ^~~~ 0x206a091 execute /local/skpandey/gccwork/pr95237/gcc/gcc/adjust-alignment.c:73 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See for instructions. [Inferior 1 (process 4132225) exited with code 04] (gdb)=20 Can we just exclude adjust-alignment pass for x86?=