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

Thomas Schwinge <tschwinge at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2020-04-22
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Thomas Schwinge <tschwinge at gcc dot gnu.org> ---
With '#pragma GCC optimize "-O0"' added to the top of 'gcc/recog.c',
'gcc/rtlanal.c', and courtesy of GDB, here is a better backtrace of
'build-gcc-offload-amdgcn-amdhsa/gcc/lto1', and more information:

    during RTL pass: split2
    [...]/libgomp.c-c++-common/for-2.h: In function
‘f4_tpf_simd_guided32._omp_fn.1’:
    [...]/libgomp.c-c++-common/for-2.h:69:9: internal compiler error: RTL
check: expected code 'const_int', have 'reg' in rtx_to_poly_int64, at
rtl.h:2380

    (gdb) bt
    #0  internal_error (gmsgid=0x15dcf70 "RTL check: expected code '%s', have
'%s' in %s, at %s:%d") at [...]/gcc/diagnostic.c:1706
    #1  0x0000000000553aa6 in rtl_check_failed_code1 (r=0x7ffff64960a8,
code=<optimized out>, file=<optimized out>, line=<optimized out>,
func=<optimized out>) at [...]/gcc/rtl.c:881
    #2  0x0000000000b4500c in rtx_to_poly_int64 (x=0x7ffff64960a8) at
[...]/gcc/rtl.h:2380
    #3  0x0000000000b252b4 in set_noop_p (set=0x7ffff6496120) at
[...]/gcc/rtlanal.c:1635
    #4  0x0000000000ad741b in split_all_insns () at [...]/gcc/recog.c:2975
    #5  0x0000000000adac0e in (anonymous
namespace)::pass_split_before_regstack::execute (this=0x1d95fe0) at
[...]/gcc/recog.c:4027
    #6  0x0000000000a7f090 in execute_one_pass (pass=pass@entry=0x1d95fe0) at
[...]/gcc/passes.c:2502
    #7  0x0000000000a7f9e8 in execute_pass_list_1 (pass=0x1d95fe0) at
[...]/gcc/passes.c:2590
    #8  0x0000000000a7f9fa in execute_pass_list_1 (pass=0x1d95ec0) at
[...]/gcc/passes.c:2591
    #9  0x0000000000a7f9fa in execute_pass_list_1 (pass=0x1d94cc0) at
[...]/gcc/passes.c:2591
    #10 0x0000000000a7fa45 in execute_pass_list (fn=<optimized out>,
pass=<optimized out>) at [...]/gcc/passes.c:2601
    #11 0x0000000000682413 in cgraph_node::expand (this=0x7ffff6642ca8) at
[...]/gcc/cgraphunit.c:2300
    #12 0x0000000000683b74 in expand_all_functions () at
[...]/gcc/cgraphunit.c:2471
    #13 symbol_table::compile (this=0x7ffff67a9000) at
[...]/gcc/cgraphunit.c:2822
    #14 0x0000000000684246 in symbol_table::compile (this=<optimized out>) at
[...]/gcc/cgraphunit.c:2856
    #15 0x00000000005b79f6 in lto_main () at [...]/gcc/lto/lto.c:653
    #16 0x0000000000b91abf in compile_file () at [...]/gcc/toplev.c:458
    #17 0x000000000059035d in do_compile () at [...]/gcc/toplev.c:2273
    #18 toplev::main (this=this@entry=0x7fffffffd220, argc=argc@entry=19,
argv=0x1d616e0, argv@entry=0x7fffffffd328) at [...]/gcc/toplev.c:2412
    #19 0x0000000000592f37 in main (argc=19, argv=0x7fffffffd328) at
[...]/gcc/main.c:39
    (gdb) frame 4
    #4  0x0000000000ad741b in split_all_insns () at [...]/gcc/recog.c:2975
    2975                  if (set && set_noop_p (set))
    (gdb) list
    2970                  rtx set = single_set (insn);
    2971
    2972                  /* Don't split no-op move insns.  These should
silently
    2973                     disappear later in final.  Splitting such insns
would
    2974                     break the code that handles LIBCALL blocks.  */
    2975                  if (set && set_noop_p (set))
    2976                    {
    2977                      /* Nops get in the way while scheduling, so
delete them
    2978                         now if register allocation has already been
done.  It
    2979                         is too risky to try to do this before register
    (gdb) call debug_rtx(insn)
    (insn 109 108 182 13 (set (reg/v:SI 2 s2 [orig:434 i ] [434])
            (vec_select:SI (reg:V64SI 163 v3 [orig:450 vect_i_22.2317 ] [450])
                (parallel [
                        (reg:SI 2 s2 [503])
                    ]))) 140 {vec_extractv64sisi}
         (nil))
    (gdb) call debug_rtx(set)
    (set (reg/v:SI 2 s2 [orig:434 i ] [434])
        (vec_select:SI (reg:V64SI 163 v3 [orig:450 vect_i_22.2317 ] [450])
            (parallel [
                    (reg:SI 2 s2 [503])
                ])))
    (gdb) down
    #3  0x0000000000b252b4 in set_noop_p (set=0x7ffff6496120) at
[...]/gcc/rtlanal.c:1635
    1635          poly_int64 c0 = rtx_to_poly_int64 (XVECEXP (par, 0, 0));
    (gdb) list 1598
    1593    ^L
    1594    /* Return nonzero if the destination of SET equals the source
    1595       and there are no side effects.  */
    1596
    1597    int
    1598    set_noop_p (const_rtx set)
    1599    {
    1600      rtx src = SET_SRC (set);
    1601      rtx dst = SET_DEST (set);
    1602
    (gdb) call debug_rtx(src)
    (vec_select:SI (reg:V64SI 163 v3 [orig:450 vect_i_22.2317 ] [450])
        (parallel [
                (reg:SI 2 s2 [503])
            ]))
    (gdb) call debug_rtx(dst)
    (reg/v:SI 2 s2 [orig:434 i ] [434])
    (gdb) list 1635
    1630          && HARD_REGISTER_P (dst))
    1631        {
    1632          int i;
    1633          rtx par = XEXP (src, 1);
    1634          rtx src0 = XEXP (src, 0);
    1635          poly_int64 c0 = rtx_to_poly_int64 (XVECEXP (par, 0, 0));
    1636          poly_int64 offset = GET_MODE_UNIT_SIZE (GET_MODE (src0)) *
c0;
    1637
    1638          for (i = 1; i < XVECLEN (par, 0); i++)
    1639            if (maybe_ne (rtx_to_poly_int64 (XVECEXP (par, 0, i)), c0 +
i))
    (gdb) call debug_rtx(par)
    (parallel [
            (reg:SI 2 s2 [503])
        ])
    (gdb) down
    #2  0x0000000000b4500c in rtx_to_poly_int64 (x=0x7ffff64960a8) at
[...]/gcc/rtl.h:2380
    2380      return INTVAL (x);
    (gdb) list 2371
    2366    }
    2367
    2368    /* Return the value of X as a poly_int64.  */
    2369
    2370    inline poly_int64
    2371    rtx_to_poly_int64 (const_rtx x)
    2372    {
    2373      if (CONST_POLY_INT_P (x))
    2374        {
    2375          poly_int64 res;
    (gdb) call debug_rtx(x)
    (reg:SI 2 s2 [503])

Sorry, I don't speak RTL, so don't know how/what to fix here.  Should we even
be getting down there?

Reply via email to