[Bug tree-optimization/57742] memset(malloc(n),0,n) -> calloc(n,1)

Joost.VandeVondele at mat dot ethz.ch gcc-bugzilla@gcc.gnu.org
Wed Jun 25 06:46:00 GMT 2014


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

--- Comment #17 from Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> ---
(In reply to Marc Glisse from comment #16)
> Done. Joost, feel free to add your testcase from comment #3 if you want to
> (I can't write a "hello world" in fortran so I will avoid adding such
> testcases myself).

Thanks Marc, I don't have write access, but I can try to dg-ify the testcase
from comment #3.. however, first test, it still seems to contain a call to
builtin_malloc at -O2, seems to work at -O3... expected ?


Also, my nightly CP2K tester fails with :

0xa63a0f crash_signal
        ../../gcc/gcc/toplev.c:337
0x871f76 bb_seq_addr
        ../../gcc/gcc/gimple.h:1389
0x871f76 gsi_start_bb
        ../../gcc/gcc/gimple-iterator.h:118
0x871f76 gsi_for_stmt(gimple_statement_base*)
        ../../gcc/gcc/gimple-iterator.c:620
0xbfe1c1 handle_builtin_memset
        ../../gcc/gcc/tree-ssa-strlen.c:1653
0xbfe1c1 strlen_optimize_stmt
        ../../gcc/gcc/tree-ssa-strlen.c:1917
0xbfe1c1 strlen_dom_walker::before_dom_children(basic_block_def*)
        ../../gcc/gcc/tree-ssa-strlen.c:2096
0xfa483a dom_walker::walk(basic_block_def*)
        ../../gcc/gcc/domwalk.c:177
0xbf963d execute
        ../../gcc/gcc/tree-ssa-strlen.c:2170
Please submit a full bug report,

which I suppose is related to this patch... I'll see if I can get a testcase.



More information about the Gcc-bugs mailing list