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

            Bug ID: 106966
           Summary: alpha cross build crashes gcc-12 "internal compiler
                    error: in emit_move_insn"
           Product: gcc
           Version: 12.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: christian.ehrhardt at canonical dot com
  Target Milestone: ---

Created attachment 53591
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53591&action=edit
Full interim state generated with -freport-bug

Hi,
this was found as part of Ubuntu's build of qemu for the upcoming 22.10
release.
That already uses gcc 12.2. But gladly it can be reproduced much easier as it
breaks in cross-building one of the firmware blobs.

Repro steps in Ubuntu 22.10:
$ git clone https://gitlab.com/qemu-project/qemu-palcode.git
$ cd qemu-palcode/
$ apt install gcc-alpha-linux-gnu
$ make CROSS=alpha-linux-gnu-
...

alpha-linux-gnu-gcc -O2 -g1 -Wall -fvisibility=hidden -fno-strict-aliasing
-msmall-text -msmall-data -mno-fp-regs -mbuild-constants -mcpu=ev67
-DSYSTEM_H='"sys-clipper.h"'  -c -o console.o console.c
during RTL pass: expand
console.c: In function ‘do_console’:
console.c:130:12: internal compiler error: in emit_move_insn, at expr.cc:4010
  130 |     vga[0] = 'H' + attr;
      |     ~~~~~~~^~~~~~~~~~~~
0x137917b internal_error(char const*, ...)
        ???:0
0x5a9326 fancy_abort(char const*, int, char const*)
        ???:0
0xe0a692 alpha_split_const_mov(machine_mode, rtx_def**)
        ???:0
0xe0a801 alpha_expand_mov(machine_mode, rtx_def**)
        ???:0
0x112e2dd gen_movv4hi(rtx_def*, rtx_def*)
        ???:0
0x7eedeb emit_move_insn_1(rtx_def*, rtx_def*)
        ???:0
0x7ef1d7 emit_move_insn(rtx_def*, rtx_def*)
        ???:0
0xe0d016 alpha_expand_movmisalign(machine_mode, rtx_def**)
        ???:0
0x112e5aa gen_movmisalignv4hi(rtx_def*, rtx_def*)
        ???:0
0xa278fc expand_insn(insn_code, unsigned int, expand_operand*)
        ???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <file:///usr/share/doc/gcc-12/README.Bugs> for instructions.
make: *** [<builtin>: console.o] Error 1



Note: Sadly I have no more recent e.g. gcc-snapshot of the cross toolchain to
test.

The issue occurred on my laptop on the builders of Ubuntu, so I assume it is
pretty generic.

Details about how GCC was built can be fetched from the Ubuntu build logs at
https://launchpad.net/ubuntu/+source/gcc-12/12.2.0-2ubuntu1

I have tried to compare older builds using gcc on Jammy. The version
11.3.0-1ubuntu1~22.04 there works fine. So it seems to be a regression between
that and 12.2.0-2ubuntu1.

Note: I have found that setting -O1 (instead of the -O2 default) will mitigate
the issue.

Reply via email to