Bug 84679 - [6/7/8 Regression] internal compiler error: in lra_eliminate_reg_if_possible, at lra-eliminations.c:1382
Summary: [6/7/8 Regression] internal compiler error: in lra_eliminate_reg_if_possible,...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: inline-asm (show other bugs)
Version: 8.0.1
: P3 normal
Target Milestone: 6.5
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2018-03-02 16:57 UTC by Vegard Nossum
Modified: 2018-03-28 19:49 UTC (History)
4 users (show)

See Also:
Host:
Target: x86_64-*-*, i?86-*-*
Build:
Known to work: 4.9.4
Known to fail: 5.3.0, 6.4.0, 7.3.0, 8.0
Last reconfirmed: 2018-03-08 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vegard Nossum 2018-03-02 16:57:18 UTC
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.
Comment 1 Martin Sebor 2018-03-08 04:35:24 UTC
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.
Comment 2 Richard Sandiford 2018-03-28 19:49:17 UTC
Fixed by the patch for PR84682 (r258393).