https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95237

--- Comment #4 from Sunil Pandey <skpgkp2 at gmail dot com> ---
This test case and many other regression on x86 caused by following change set
r11-508

Good
====
$
/local/skpandey/gccwork/pr95237/tools-build/gcc-debug-r11-507/release/usr/gcc-11.0.0-x86-64/bin/gcc
-m32 -mpreferred-stack-boundary=2 foo.c
bash-5.0$ echo $?
0

Bad
===
bash-5.0$
/local/skpandey/gccwork/pr95237/tools-build/gcc-debug-r11-508/release/usr/gcc-11.0.0-x86-64/bin/gcc
-m32 -mpreferred-stack-boundary=2 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 <https://gcc.gnu.org/bugs/> for instructions.

$git show dfa4fcdba374ed44d4aa1a22b2738f3f5c5b37af
commit dfa4fcdba374ed44d4aa1a22b2738f3f5c5b37af
Author: Kito Cheng <kito.ch...@sifive.com>
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  <kito.ch...@sifive.com>
+
+       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:
=========

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/gcc-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/gcc-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=2 -mtune=generic
-march=x86-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=0x32fbb10, fun=0x7fffea9340b0)
    at /local/skpandey/gccwork/pr95237/gcc/gcc/adjust-alignment.c:73
73            gcc_assert (align >= DECL_ALIGN (var));
(gdb) c
Continuing.

Breakpoint 1, (anonymous namespace)::pass_adjust_alignment::execute
(this=0x32fbb10, fun=0x7fffea9340b0)
    at /local/skpandey/gccwork/pr95237/gcc/gcc/adjust-alignment.c:73
73            gcc_assert (align >= 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 <https://gcc.gnu.org/bugs/> for instructions.
[Inferior 1 (process 4132225) exited with code 04]
(gdb) 

Can we just exclude adjust-alignment pass for x86?

Reply via email to