Input: void f() { int b; asm("" : "=mp" (b)); (void) &b; } Output: $ xgcc -x c++ -S -Wall - during RTL pass: reload <stdin>: In function 'void f()': <stdin>:5:1: internal compiler error: in lra_eliminate_reg_if_possible, at lra-eliminations.c:1382 0x28cfae3 lra_eliminate_reg_if_possible(rtx_def**) /home/vegard/git/gcc/gcc/lra-eliminations.c:1382 0x289671b address_eliminator /home/vegard/git/gcc/gcc/lra-constraints.c:362 0x289671b satisfies_address_constraint_p /home/vegard/git/gcc/gcc/lra-constraints.c:411 0x289671b satisfies_address_constraint_p /home/vegard/git/gcc/gcc/lra-constraints.c:423 0x289671b process_alt_operands /home/vegard/git/gcc/gcc/lra-constraints.c:2281 0x28a8be3 curr_insn_transform /home/vegard/git/gcc/gcc/lra-constraints.c:3860 0x28bbf56 lra_constraints(bool) /home/vegard/git/gcc/gcc/lra-constraints.c:4877 0x282c524 lra(_IO_FILE*) /home/vegard/git/gcc/gcc/lra.c:2419 0x260b334 do_reload /home/vegard/git/gcc/gcc/ira.c:5465 0x260b334 execute /home/vegard/git/gcc/gcc/ira.c:5649 $ xgcc --version xgcc (GCC) 8.0.1 20180301 (experimental) Built from git c435a9e730c6e8f10da09d58b4fc9aaeb401b0d5 (r258097). Seems to have been introduced between 6.3.0 and 7.1.0. Test case was minimised by C-Reduce.
Confirmed. Bisection points to r211475 (gcc 4.10.0): r211475 | rsandifo | 2014-06-11 12:59:17 -0400 (Wed, 11 Jun 2014) | 34 lines gcc/ * common.md: New file. * doc/md.texi: Update description of generic, machine-independent constraints. * config/s390/constraints.md (e): Delete. * Makefile.in (md_file): Include common.md. * config/m32c/t-m32c (md_file): Likewise. * genpreds.c (general_mem): New array. (generic_constraint_letters): Remove constraints now defined by common.md. (add_constraint): Map TARGET_MEM_CONSTRAINT to general_mem. Allow the first character to be '<' or '>' as well. * genoutput.c (general_mem): New array. (indep_constraints): Remove constraints now defined by common.md. (note_constraint): Map TARGET_MEM_CONSTRAINT to general_mem. Remove special handling of 'm'. * ira-costs.c (record_reg_classes): Remove special handling of constraints now defined by common.md. * ira.c (ira_setup_alts, ira_get_dup_out_num): Likewise. * ira-lives.c (single_reg_class): Likewise. (ira_implicitly_set_insn_hard_regs): Likewise. * lra-constraints.c (reg_class_from_constraints): Likewise. (process_alt_operands, process_address, curr_insn_transform): Likewise. * postreload.c (reload_cse_simplify_operands): Likewise. * reload.c (push_secondary_reload, scratch_reload_class) (find_reloads, alternative_allows_const_pool_ref): Likewise. * reload1.c (maybe_fix_stack_asms): Likewise. * targhooks.c (default_secondary_reload): Likewise. * stmt.c (parse_output_constraint): Likewise. * recog.c (preprocess_constraints): Likewise. (constrain_operands, peep2_find_free_register): Likewise. (asm_operand_ok): Likewise, but add a comment saying why 'o' must be handled specially.
Fixed by the patch for PR84682 (r258393).