[Bug target/105428] New: compilation never (?) finishes with __builtin_casinl() and __builtin_csqrtl() with -O -mlong-double-128

zsojka at seznam dot cz gcc-bugzilla@gcc.gnu.org
Thu Apr 28 19:37:36 GMT 2022


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

            Bug ID: 105428
           Summary: compilation never (?) finishes with __builtin_casinl()
                    and __builtin_csqrtl() with -O -mlong-double-128
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: compile-time-hog, memory-hog
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: x86_64-pc-linux-gnu

Created attachment 52900
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52900&action=edit
reduced testcase

Compiler output:
$ /repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc -O
-mlong-double-128 testcase.c -wrapper gdb,--args
...
^C
Program received signal SIGINT, Interrupt.
0x00007ffff7d91d00 in __memset_avx2_unaligned_erms () from /lib64/libc.so.6
(gdb) bt
#0  0x00007ffff7d91d00 in __memset_avx2_unaligned_erms () from /lib64/libc.so.6
#1  0x0000000000d5f1d0 in memset (__len=<optimized out>, __ch=0,
__dest=0x7fe9e27b8018) at /usr/include/bits/string_fortified.h:59
#2  mpfr_add1 (a=a@entry=0x7fffffffc780, b=0x7fffffffc7c0, c=<optimized out>,
rnd_mode=MPFR_RNDA) at /repo/gcc-trunk/mpfr/src/add1.c:151
#3  0x0000000000d5e70d in mpfr_add (a=a@entry=0x7fffffffc780,
b=b@entry=0x7fffffffc7c0, c=c@entry=0x7fffffffc9b0,
rnd_mode=rnd_mode@entry=MPFR_RNDA) at /repo/gcc-trunk/mpfr/src/add.c:120
#4  0x0000000002764e5c in mpc_sqr (rop=rop@entry=0x7fffffffc880,
op=op@entry=0x7fffffffc990, rnd=rnd@entry=0) at
/repo/gcc-trunk/mpc/src/sqr.c:269
#5  0x000000000275b1eb in mpc_asin (rop=rop@entry=0x7fffffffc990,
op=op@entry=0x7fffffffc990, rnd=rnd@entry=0) at
/repo/gcc-trunk/mpc/src/asin.c:420
#6  0x000000000107147e in do_mpc_arg1 (format=0x28c2260 <ieee_quad_format>,
arg_imag=0x7ffff7b6ae20, arg_real=0x7ffff7b6ae40, func=0x275b0b0 <mpc_asin>,
result_imag=0x7fffffffcb20, 
    result_real=0x7fffffffcad0) at /repo/gcc-trunk/gcc/fold-const-call.cc:346
#7  do_mpc_arg1 (result_real=0x7fffffffcad0, result_imag=0x7fffffffcb20,
func=0x275b0b0 <mpc_asin>, arg_real=0x7ffff7b6ae40, arg_imag=0x7ffff7b6ae20,
format=0x28c2260 <ieee_quad_format>)
    at /repo/gcc-trunk/gcc/fold-const-call.cc:326
#8  0x0000000001073246 in fold_const_call_cc (format=<optimized out>,
arg_imag=<optimized out>, arg_real=<optimized out>, fn=CFN_BUILT_IN_CASINL,
result_imag=0x7fffffffcb20, 
    result_real=0x7fffffffcad0) at /repo/gcc-trunk/gcc/fold-const-call.cc:1151
#9  fold_const_call_1 (fn=<optimized out>, type=0x7ffff7a3ff18, arg=<optimized
out>) at /repo/gcc-trunk/gcc/fold-const-call.cc:1252
#10 0x00000000018facc6 in gimple_resimplify1 (seq=0x0, res_op=0x7fffffffcd00,
valueize=0x1516d10 <valueize_op_1(tree)>) at
/repo/gcc-trunk/gcc/gimple-match-head.cc:215
#11 0x0000000001934571 in gimple_simplify (stmt=stmt@entry=0x7ffff7b853f0,
res_op=res_op@entry=0x7fffffffcd00, seq=seq@entry=0x0,
valueize=valueize@entry=0x1516d10 <valueize_op_1(tree)>, 
    top_valueize=top_valueize@entry=0x1516e00 <valueize_op(tree)>) at
/repo/gcc-trunk/gcc/gimple-match-head.cc:1113
#12 0x00000000010ad95a in gimple_fold_stmt_to_constant_1
(stmt=stmt@entry=0x7ffff7b853f0, valueize=valueize@entry=0x1516e00
<valueize_op(tree)>, 
    gvalueize=gvalueize@entry=0x1516d10 <valueize_op_1(tree)>) at
/repo/gcc-trunk/gcc/gimple-fold.cc:7391
#13 0x0000000001522450 in ccp_fold (stmt=0x7ffff7b853f0) at
/repo/gcc-trunk/gcc/tree-ssa-ccp.cc:1289
#14 evaluate_stmt (stmt=0x7ffff7b853f0) at
/repo/gcc-trunk/gcc/tree-ssa-ccp.cc:2208
#15 0x000000000152479e in visit_assignment (stmt=0x7ffff7b853f0,
output_p=0x7fffffffd308) at /repo/gcc-trunk/gcc/tree-ssa-ccp.cc:2841
#16 0x00000000015c4f64 in ssa_propagation_engine::simulate_stmt
(this=0x7fffffffd3e0, stmt=0x7ffff7b853f0) at
/repo/gcc-trunk/gcc/tree-ssa-propagate.cc:230
#17 0x00000000015c523b in ssa_propagation_engine::simulate_block
(this=0x7fffffffd3e0, block=0x7ffff7a27270) at
/repo/gcc-trunk/gcc/tree-ssa-propagate.cc:337
#18 0x00000000015c5654 in ssa_propagation_engine::ssa_propagate
(this=this@entry=0x7fffffffd3e0) at
/repo/gcc-trunk/gcc/tree-ssa-propagate.cc:504
#19 0x0000000001516ae1 in do_ssa_ccp (nonzero_p=true) at
/repo/gcc-trunk/gcc/tree-ssa-ccp.cc:2960
#20 (anonymous namespace)::pass_ccp::execute (this=<optimized out>) at
/repo/gcc-trunk/gcc/tree-ssa-ccp.cc:3004
#21 0x00000000012f994a in execute_one_pass (pass=0x35d7df0) at
/repo/gcc-trunk/gcc/passes.cc:2638
#22 0x00000000012fa210 in execute_pass_list_1 (pass=0x35d7df0) at
/repo/gcc-trunk/gcc/passes.cc:2738
#23 0x00000000012fa222 in execute_pass_list_1 (pass=0x35d7cc0) at
/repo/gcc-trunk/gcc/passes.cc:2739
#24 0x00000000012fa249 in execute_pass_list (fn=0x7ffff7b7f0b8, pass=<optimized
out>) at /repo/gcc-trunk/gcc/passes.cc:2749
#25 0x0000000000f1efa6 in cgraph_node::expand (this=0x7ffff7b80110) at
/repo/gcc-trunk/gcc/context.h:48
#26 cgraph_node::expand (this=0x7ffff7b80110) at
/repo/gcc-trunk/gcc/cgraphunit.cc:1788
#27 0x0000000000f20540 in expand_all_functions () at
/repo/gcc-trunk/gcc/cgraphunit.cc:1999
#28 symbol_table::compile (this=0x7ffff7a1f000) at
/repo/gcc-trunk/gcc/cgraphunit.cc:2349
#29 0x0000000000f23178 in symbol_table::compile (this=0x7ffff7a1f000) at
/repo/gcc-trunk/gcc/cgraphunit.cc:2262
#30 symbol_table::finalize_compilation_unit (this=0x7ffff7a1f000) at
/repo/gcc-trunk/gcc/cgraphunit.cc:2530
#31 0x0000000001405890 in compile_file () at /repo/gcc-trunk/gcc/toplev.cc:479
#32 0x0000000000d5b7ae in do_compile (no_backend=false) at
/repo/gcc-trunk/gcc/toplev.cc:2168
#33 toplev::main (this=this@entry=0x7fffffffd65e, argc=<optimized out>,
argc@entry=18, argv=<optimized out>, argv@entry=0x7fffffffd7a8) at
/repo/gcc-trunk/gcc/toplev.cc:2320
#34 0x0000000000d5d6ef in main (argc=18, argv=0x7fffffffd7a8) at
/repo/gcc-trunk/gcc/main.cc:39


(gdb) fini
Run till exit from #0  0x00007ffff7d91d00 in __memset_avx2_unaligned_erms ()
from /lib64/libc.so.6
mpfr_add1 (a=a@entry=0x7fffffffc780, b=0x7fffffffc7c0, c=<optimized out>,
rnd_mode=MPFR_RNDA) at /repo/gcc-trunk/mpfr/src/add1.c:152
152               difn = cn;
(gdb) fini
Run till exit from #0  mpfr_add1 (a=a@entry=0x7fffffffc780, b=0x7fffffffc7c0,
c=<optimized out>, rnd_mode=MPFR_RNDA) at /repo/gcc-trunk/mpfr/src/add1.c:152
0x0000000002764e5c in mpc_sqr (rop=rop@entry=0x7fffffffc880,
op=op@entry=0x7fffffffc990, rnd=rnd@entry=0) at
/repo/gcc-trunk/mpc/src/sqr.c:270
270                        | mpfr_sub (v, x, mpc_imagref (op), MPFR_RNDA);
Value returned is $1 = 0
(gdb) 
Run till exit from #0  0x0000000002764e5c in mpc_sqr
(rop=rop@entry=0x7fffffffc880, op=op@entry=0x7fffffffc990, rnd=rnd@entry=0) at
/repo/gcc-trunk/mpc/src/sqr.c:270

Program terminated with signal SIGKILL, Killed.
The program no longer exists.

(consumed memory is ~80GiB)


$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r13-7-20220428134959-g00c4405cd7f-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/13.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --with-cloog --with-ppl --with-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r13-7-20220428134959-g00c4405cd7f-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.0.0 20220428 (experimental) (GCC)


More information about the Gcc-bugs mailing list