https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98194
Bug ID: 98194 Summary: [9/10/11 Regression]internal compiler error: output_operand: invalid use of register 'frame' Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: anbu1024.me at gmail dot com Target Milestone: --- $ cat test.c void sub_0 ( void ) { register int var_0 asm ( "19" ) ; if ( var_0 != - 1 ) sub_0 ( ) ; } -------------------------------------------------------------------------------- $ gcc-11 --version gcc (GCC) 11.0.0 20201129 (experimental) Copyright (C) 2020 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -------------------------------------------------------------------------------- $ gcc-11 test.c during RTL pass: final test.c: In function ‘sub_0’: test.c:7:1: internal compiler error: output_operand: invalid use of register 'frame' 7 | } | ^ 0xaa7706 output_operand_lossage(char const*, ...) ../../gcc-11-20201129/gcc/final.c:3627 0xaa7a41 output_operand(rtx_def*, int) ../../gcc-11-20201129/gcc/final.c:4069 0xaa85bd output_asm_insn(char const*, rtx_def**) ../../gcc-11-20201129/gcc/final.c:3981 0xaabf19 final_scan_insn_1 ../../gcc-11-20201129/gcc/final.c:3124 0xaac35b final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*) ../../gcc-11-20201129/gcc/final.c:3170 0xaac456 final_1 ../../gcc-11-20201129/gcc/final.c:2021 0xaad004 rest_of_handle_final ../../gcc-11-20201129/gcc/final.c:4676 0xaad004 execute ../../gcc-11-20201129/gcc/final.c:4754 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. -------------------------------------------------------------------------------- $ gcc-10 test.c during RTL pass: final test.c: In function ‘sub_0’: test.c:7:1: internal compiler error: output_operand: invalid use of register 'frame' 7 | } | ^ 0x8445b6 output_operand_lossage(char const*, ...) ../../gcc-10-20201128/gcc/final.c:3609 0x8448e1 output_operand(rtx_def*, int) ../../gcc-10-20201128/gcc/final.c:4051 0x84541d output_asm_insn(char const*, rtx_def**) ../../gcc-10-20201128/gcc/final.c:3963 0x848ad9 final_scan_insn_1 ../../gcc-10-20201128/gcc/final.c:3106 0x848d8b final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*) ../../gcc-10-20201128/gcc/final.c:3152 0x849074 final_1 ../../gcc-10-20201128/gcc/final.c:2020 0x849804 rest_of_handle_final ../../gcc-10-20201128/gcc/final.c:4658 0x849804 execute ../../gcc-10-20201128/gcc/final.c:4736 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. -------------------------------------------------------------------------------- $ gcc-10 --version gcc (GCC) 10.2.1 20201128 Copyright (C) 2020 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -------------------------------------------------------------------------------- $ gcc-9 test.c during RTL pass: final test.c: In function ‘sub_0’: test.c:7:1: internal compiler error: output_operand: invalid use of register 'frame' 7 | } | ^ 0x7f5806 output_operand_lossage(char const*, ...) ../../gcc-9-20201127/gcc/final.c:3610 0xd67504 ix86_print_operand(_IO_FILE*, rtx_def*, int) ../../gcc-9-20201127/gcc/config/i386/i386.c:18398 0x7f5b31 output_operand(rtx_def*, int) ../../gcc-9-20201127/gcc/final.c:4052 0x7f665c output_asm_insn(char const*, rtx_def**) ../../gcc-9-20201127/gcc/final.c:3964 0x7f7d22 final_scan_insn_1 ../../gcc-9-20201127/gcc/final.c:3107 0x7f7f7b final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*) ../../gcc-9-20201127/gcc/final.c:3153 0x7f8254 final_1 ../../gcc-9-20201127/gcc/final.c:2021 0x7f8c44 rest_of_handle_final ../../gcc-9-20201127/gcc/final.c:4659 0x7f8c44 execute ../../gcc-9-20201127/gcc/final.c:4737 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. -------------------------------------------------------------------------------- $ gcc-9 --version gcc (GCC) 9.3.1 20201127 Copyright (C) 2019 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -------------------------------------------------------------------------------- $ gcc-8 test.c test.c: In function ‘sub_0’: test.c:4:15: error: the register specified for ‘var_0’ is not general enough to be used as a register variable register int var_0 asm ( "19" ) ; ^~~~~ -------------------------------------------------------------------------------- $ gcc-8 --version gcc (GCC) 8.4.1 20201126 Copyright (C) 2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.