http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40154

Jorn Wolfgang Rennecke <amylaar at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amylaar at gcc dot gnu.org
      Known to fail|                            |

--- Comment #3 from Jorn Wolfgang Rennecke <amylaar at gcc dot gnu.org> 
2011-11-07 22:37:22 UTC ---
I see a similar problem on epiphany-elf in three libstdc++-v3 tests.
FAIL: tr1/5_numerical_facilities/special_functions/10_cyl_bessel_k/check_nan.cc
(test for excess errors)
FAIL: tr1/5_numerical_facilities/special_functions/10_cyl_bessel_k/compile.cc
(test for excess errors)
FAIL: tr1/5_numerical_facilities/special_functions/10_cyl_bessel_k/compile_2.cc
(test for excess errors)

expand_absneg_bit sets a REG_EQUAL note in SFmode on an instruction that
sets an SImode subreg of an SFmode pseudo.
At register allocation time, this has morphed into an SImode register that
has an SFmode reg_equiv value.  Reload tried to compute the SFmode
equivalent of the constant, which it assumes should have the same mode
as the pseudo register, i.e. SImode.  So it uses the wrong mode when it
calls simplify_gen_subreg, which then aborts:

Starting program: /home/amylaar/epiphany/bld-epiphany-20111107/gcc/cc1plus
-fpreprocessed check_nan.ii -quiet -dumpbase check_nan.cc -auxbase check_nan -g
-g -g -O2 -O2 -O2 -version -fmessage-length=0 -ffunction-sections
-fdata-sections -o check_nan.s
warning: Could not load shared library symbols for linux-vdso64.so.1.
Do you need "set solib-search-path" or "set sysroot"?
GNU C++ (GCC) version 4.7.0 20111107 (experimental) (epiphany-elf)
        compiled by GNU C version 4.6.1 20111003 (Red Hat 4.6.1-10), GMP
version 4.3.2, MPFR version 3.0.0, MPC version 0.9
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU C++ (GCC) version 4.7.0 20111107 (experimental) (epiphany-elf)
        compiled by GNU C version 4.6.1 20111003 (Red Hat 4.6.1-10), GMP
version 4.3.2, MPFR version 3.0.0, MPC version 0.9
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 0f8de98d0e7bcafd1b7bc2585fb69db8

Breakpoint 1, fancy_abort (file=0x11434c18 "../../srcw/gcc/simplify-rtx.c", 
    line=5424, function=0x11434d38 "simplify_subreg")
    at ../../srcw/gcc/diagnostic.c:899
899       internal_error ("in %s, at %s:%d", function, trim_filename (file),
line);
Missing separate debuginfos, use: debuginfo-install
cloog-ppl-0.15.9-3.fc15.ppc64 gmp-4.3.2-4.fc16.ppc64 libmpc-0.9-1.fc16.ppc64
mpfr-3.0.0-4.fc15.ppc64 ppl-0.11.2-2.fc16.ppc64 ppl-pwl-0.11.2-2.fc16.ppc64
(gdb) frame 3
#3  0x0000000010a75a20 in find_reloads_toplev (x=0xfffa968dba8, opnum=3, 
    type=RELOAD_FOR_INPUT_ADDRESS, ind_levels=0, is_set_dest=0, 
    insn=0xfffa95e46e0, address_reloaded=0xfffffffd394)
    at ../../srcw/gcc/reload.c:4727
4727                simplify_gen_subreg (GET_MODE (x), reg_equiv_constant
(regno),
(gdb) p  (VEC_reg_equivs_t_base_index(((reg_equivs) ? &(reg_equivs)->base :
0),(regno) ,"../../srcw/gcc/reload.c",4724,__FUNCTION__))->constant
$1 = (rtx) 0xfffa9531c70
(gdb) call debug_rtx($1)
(const_double:SF -1.0e+0 [-0x0.8p+1])
(gdb) call debug_rtx(x)
(subreg:SF (reg:SI 555) 0)
(gdb) frame 4
#4  0x0000000010a6b658 in find_reloads (insn=0xfffa95e46e0, replace=0, 
    ind_levels=0, live_known=1, reload_reg_p=0x11605278)
    at ../../srcw/gcc/reload.c:2847
2847              rtx op
(gdb) call debug_rtx(insn)
(insn 512 934 513 31 (parallel [
            (set (reg:SF 0 r0 [496])
                (fma:SF (reg/v:SF 5 r5 [orig:192 __b ] [192])
                    (reg/v:SF 9 r9 [orig:195 __d ] [195])
                    (subreg:SF (reg:SI 555) 0)))
            (clobber (reg:CC_FP 67 cc2))
            (use (reg:SI 74 fp_near))
            (clobber (reg:SI 75 fp_trunc))
        ])
/home/amylaar/epiphany/bld-epiphany-20111107/epiphany-elf/libstdc++-v3/include/tr1/modified_bessel_func.tcc:216
23 {*fmadd}
     (expr_list:REG_UNUSED (reg:SI 75 fp_trunc)
        (expr_list:REG_UNUSED (reg:CC_FP 67 cc2)
            (nil))))
(gdb) frame 3
#3  0x0000000010a75a20 in find_reloads_toplev (x=0xfffa968dba8, opnum=3, 
    type=RELOAD_FOR_INPUT_ADDRESS, ind_levels=0, is_set_dest=0, 
    insn=0xfffa95e46e0, address_reloaded=0xfffffffd394)
    at ../../srcw/gcc/reload.c:4727
4727                simplify_gen_subreg (GET_MODE (x), reg_equiv_constant
(regno),
(gdb) p  (VEC_reg_equivs_t_base_index(((reg_equivs) ? &(reg_equivs)->base :
0),(regno) ,"../../srcw/gcc/reload.c",4724,__FUNCTION__))
$2 = (reg_equivs_t *) 0xfffb1747970
(gdb) p *$2
$3 = {constant = 0xfffa9531c70, invariant = 0x0, memory_loc = 0x0, 
  address = 0x0, mem = 0x0, alt_mem_list = 0x0, init = 0xfffa73653a0}
(gdb) call debug_rtx($3->init)
(insn_list:REG_DEP_TRUE 511 (nil))
(gdb) break make_insn_raw
Breakpoint 5 at 0x1058b730: file ../../srcw/gcc/emit-rtl.c, line 3679.
(gdb) cond 5 x_rtl->emit->x_cur_insn_uid == 511
(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y

Starting program: /home/amylaar/epiphany/bld-epiphany-20111107/gcc/cc1plus
-fpreprocessed check_nan.ii -quiet -dumpbase check_nan.cc -auxbase check_nan -g
-g -g -O2 -O2 -O2 -version -fmessage-length=0 -ffunction-sections
-fdata-sections -o check_nan.s
warning: Could not load shared library symbols for linux-vdso64.so.1.
Do you need "set solib-search-path" or "set sysroot"?
GNU C++ (GCC) version 4.7.0 20111107 (experimental) (epiphany-elf)
        compiled by GNU C version 4.6.1 20111003 (Red Hat 4.6.1-10), GMP
version 4.3.2, MPFR version 3.0.0, MPC version 0.9
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU C++ (GCC) version 4.7.0 20111107 (experimental) (epiphany-elf)
        compiled by GNU C version 4.6.1 20111003 (Red Hat 4.6.1-10), GMP
version 4.3.2, MPFR version 3.0.0, MPC version 0.9
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 0f8de98d0e7bcafd1b7bc2585fb69db8

Breakpoint 5, make_insn_raw (pattern=0xfffa9580160)
    at ../../srcw/gcc/emit-rtl.c:3679
3679      insn = rtx_alloc (INSN);
(gdb) finish
Run till exit from #0  make_insn_raw (pattern=0xfffa9580160)
    at ../../srcw/gcc/emit-rtl.c:3679
0x000000001058e928 in emit_insn (x=0xfffa9580160)
    at ../../srcw/gcc/emit-rtl.c:4689
4689          last = make_insn_raw (x);
Value returned is $4 = (struct rtx_def *) 0xfffa95e45c0
(gdb) 
Run till exit from #0  0x000000001058e928 in emit_insn (x=0xfffa9580160)
    at ../../srcw/gcc/emit-rtl.c:4689
0x00000000109b85f0 in expand_binop_directly (mode=SImode, binoptab=0x11599868, 
    op0=0xfffa9589900, op1=0xfffaf7d6750, target=0xfffa9459720, unsignedp=1, 
    methods=OPTAB_LIB_WIDEN, last=0xfffa95e44a0)
    at ../../srcw/gcc/optabs.c:1469
1469          emit_insn (pat);
Value returned is $5 = (struct rtx_def *) 0xfffa95e45c0
(gdb) call debug_rtx($5)
(insn 511 510 0 (parallel [
            (set (subreg:SI (reg:SF 493) 0)
                (xor:SI (reg:SI 494)
                    (reg:SI 495)))
            (clobber (reg:CC 66 cc1))
        ])
/home/amylaar/epiphany/bld-epiphany-20111107/epiphany-elf/libstdc++-v3/include/tr1/modified_bessel_func.tcc:81
-1
     (nil))
(gdb) finish
Run till exit from #0  0x00000000109b85f0 in expand_binop_directly (
    mode=SImode, binoptab=0x11599868, op0=0xfffa9589900, op1=0xfffaf7d6750, 
    target=0xfffa9459720, unsignedp=1, methods=OPTAB_LIB_WIDEN, 
    last=0xfffa95e44a0) at ../../srcw/gcc/optabs.c:1469
0x00000000109b87c8 in expand_binop (mode=SImode, binoptab=0x11599868, 
    op0=0xfffa9589900, op1=0xfffaf7d6750, target=0xfffa9459720, unsignedp=1, 
    methods=OPTAB_LIB_WIDEN) at ../../srcw/gcc/optabs.c:1522
1522          temp = expand_binop_directly (mode, binoptab, op0, op1, target,
Value returned is $6 = (struct rtx_def *) 0xfffa9459720
(gdb) 
Run till exit from #0  0x00000000109b87c8 in expand_binop (mode=SImode, 
    binoptab=0x11599868, op0=0xfffa9589900, op1=0xfffaf7d6750, 
    target=0xfffa9459720, unsignedp=1, methods=OPTAB_LIB_WIDEN)
    at ../../srcw/gcc/optabs.c:1522
0x00000000109bdac0 in expand_absneg_bit (code=NEG, mode=SFmode, 
    op0=0xfffaf7f00c8, target=0xfffab489360) at ../../srcw/gcc/optabs.c:2963
2963          temp = expand_binop (imode, code == ABS ? and_optab : xor_optab,
Value returned is $7 = (struct rtx_def *) 0xfffa9459720
(gdb) call debug_rtx($5)
(insn 511 510 0 (parallel [
            (set (subreg:SI (reg:SF 493) 0)
                (xor:SI (reg:SI 494)
                    (reg:SI 495)))
            (clobber (reg:CC 66 cc1))
        ])
/home/amylaar/epiphany/bld-epiphany-20111107/epiphany-elf/libstdc++-v3/include/tr1/modified_bessel_func.tcc:81
-1
     (nil))
(gdb) finish
Run till exit from #0  0x00000000109bdac0 in expand_absneg_bit (code=NEG, 
    mode=SFmode, op0=0xfffaf7f00c8, target=0xfffab489360)
    at ../../srcw/gcc/optabs.c:2963
0x00000000109be4f4 in expand_unop (mode=SFmode, unoptab=0x1159b0a0, 
    op0=0xfffaf7f00c8, target=0x0, unsignedp=0) at ../../srcw/gcc/optabs.c:3158
3158              temp = expand_absneg_bit (NEG, mode, op0, target);
Value returned is $8 = (struct rtx_def *) 0xfffab489360
(gdb) call debug_rtx($5)
(insn 511 510 0 (parallel [
            (set (subreg:SI (reg:SF 493) 0)
                (xor:SI (reg:SI 494)
                    (reg:SI 495)))
            (clobber (reg:CC 66 cc1))
        ])
/home/amylaar/epiphany/bld-epiphany-20111107/epiphany-elf/libstdc++-v3/include/tr1/modified_bessel_func.tcc:81
-1
     (expr_list:REG_EQUAL (neg:SF (const_double:SF 1.0e+0 [0x0.8p+1]))
        (nil)))


We should either have a no-op move in the original mode to tag the note onto,
or change the mode of the note's value to match the actual SET_DEST.

Reply via email to