Bug 84677 - [7 Regression] internal compiler error: in extract_constrain_insn, at recog.c:2205
Summary: [7 Regression] internal compiler error: in extract_constrain_insn, at recog.c...
Status: RESOLVED DUPLICATE of bug 84682
Alias: None
Product: gcc
Classification: Unclassified
Component: inline-asm (show other bugs)
Version: 8.0.1
: P3 normal
Target Milestone: 7.4
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-checking, ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2018-03-02 16:37 UTC by Vegard Nossum
Modified: 2018-11-22 08:55 UTC (History)
3 users (show)

See Also:
Host:
Target: x86_64-*-*, i?86-*-*
Build:
Known to work: 5.4.0
Known to fail: 6.4.0, 7.3.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:37:19 UTC
Input:

void a() {
  double b;
  asm ("" : "+pz, y" (b));
}


Output:

$ xgcc -x c++ -S -
<stdin>: In function 'void a()':
<stdin>:4:1: error: unrecognizable insn:
(insn 7 11 5 2 (parallel [
            (set (reg:DF 0 ax [orig:87 b ] [87])
                (asm_operands:DF ("") ("=pz, y") 0 [
                        (reg:DF 0 ax [orig:87 b ] [87])
                    ]
                     [
                        (asm_input:DF ("0,0") <stdin>:3)
                    ]
                     [] <stdin>:3))
            (clobber (reg:CCFP 18 fpsr))
            (clobber (reg:CC 17 flags))
        ]) "<stdin>":3 -1
     (nil))
during RTL pass: reload
<stdin>:4:1: internal compiler error: in extract_constrain_insn, at recog.c:2205
0x610903 _fatal_insn(char const*, rtx_def const*, char const*, int, char const*)
        /home/vegard/git/gcc/gcc/rtl-error.c:108
0x610991 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
        /home/vegard/git/gcc/gcc/rtl-error.c:116
0x2d17a96 extract_constrain_insn(rtx_insn*)
        /home/vegard/git/gcc/gcc/recog.c:2205
0x282f53f check_rtl
        /home/vegard/git/gcc/gcc/lra.c:2155
0x282f53f lra(_IO_FILE*)
        /home/vegard/git/gcc/gcc/lra.c:2573
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).

7.3.0 seems fine with this.

Test case was minimised by C-Reduce.
Comment 1 David Malcolm 2018-03-06 22:08:15 UTC
Doesn't need the "-x c++".

Started somewhere between r229464 (unaffected) and r229470 (affected); probably r229470.

Running into this for gcc 8 due to:

2572	  if (flag_checking)
2573	    check_rtl (true);

Is this valid code?  My asm-syntax knowledge isn't strong.
Comment 2 Martin Sebor 2018-03-08 04:39:50 UTC
Confirmed.  My bisection also points to r229470 (gcc 6.0.0):

r229470 | law | 2015-10-27 21:05:53 -0400 (Tue, 27 Oct 2015) | 184 lines

[PATCH 7/9] ENABLE_CHECKING refactoring: middle-end, LTO FE
gcc/lto/ChangeLog:
2015-10-27  Mikhail Maltsev  <maltsevm@gmail.com>

	* lto.c (unify_scc): Use flag_checking and remove ENABLE_CHECKING
	conditionals.
	(lto_fixup_state): Likewise.
	(do_whole_program_analysis): Use
	symtab_node::checking_verify_symtab_nodes and remove ENABLE_CHECKING
	conditionals.
...

Before that GCC accepted the code so I'm assuming it's ice-on-valid-code.
Comment 3 Jakub Jelinek 2018-03-28 18:18:31 UTC
This got fixed with r258393 aka PR84682 on the trunk; doesn't ICE with -fno-checking, so doesn't fail on release branches.
Comment 4 Jakub Jelinek 2018-10-26 10:14:35 UTC
GCC 6 branch is being closed
Comment 5 Richard Biener 2018-11-22 08:55:37 UTC
Let's close it as dup.

*** This bug has been marked as a duplicate of bug 84682 ***