[Bug target/64108] ICE: SIGSEGV in decide_alg() with -mmemset-strategy=libcall:-1:align -minline-all-stringops
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64108 --- Comment #4 from hjl at gcc dot gnu.org hjl at gcc dot gnu.org --- Author: hjl Date: Fri Dec 5 11:52:44 2014 New Revision: 218419 URL: https://gcc.gnu.org/viewcvs?rev=218419root=gccview=rev Log: Stop only if there aren't any usable algorithms When searching for an usable algorithm with -minline-all-stringops, decide_alg stops when it sees libcall even if there is a usable algorithm. It goes into an infinite loop. This patch changes decide_alg to stop searching only if there aren't any usable algorithms. Testd on Linux/x86-64. gcc/ Backport from mainline PR target/64108 * config/i386/i386.c (decide_alg): Stop only if there aren't any usable algorithms. gcc/testsuite/ Backport from mainline PR target/64108 * gcc.target/i386/memset-strategy-2.c: New test. Added: branches/gcc-4_9-branch/gcc/testsuite/gcc.target/i386/memset-strategy-2.c Modified: branches/gcc-4_9-branch/gcc/ChangeLog branches/gcc-4_9-branch/gcc/config/i386/i386.c branches/gcc-4_9-branch/gcc/testsuite/ChangeLog
[Bug target/64108] ICE: SIGSEGV in decide_alg() with -mmemset-strategy=libcall:-1:align -minline-all-stringops
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64108 H.J. Lu hjl.tools at gmail dot com changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #5 from H.J. Lu hjl.tools at gmail dot com --- Fixed for 4.9.3
[Bug target/64108] ICE: SIGSEGV in decide_alg() with -mmemset-strategy=libcall:-1:align -minline-all-stringops
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64108 --- Comment #3 from Zdenek Sojka zsojka at seznam dot cz --- Created attachment 34187 -- https://gcc.gnu.org/bugzilla/attachment.cgi?id=34187action=edit another autoreduced testcase (from gcc.c-torture/execute/20020412-1.c) Hello, I am getting another similiar ICE (-minline-stringops-dynamically is used it this case, different testcase): $ gcc -mmemcpy-strategy=libcall:-1:align -minline-stringops-dynamically final.i final.i: In function 'foo': final.i:10:5: internal compiler error: in decide_alg, at config/i386/i386.c:24506 d = ^ 0xf0f862 decide_alg /mnt/svn/gcc-trunk/gcc/config/i386/i386.c:24506 0xf5848f ix86_expand_set_or_movmem(rtx_def*, rtx_def*, rtx_def*, rtx_def*, rtx_def*, rtx_def*, rtx_def*, rtx_def*, rtx_def*, rtx_def*, bool) /mnt/svn/gcc-trunk/gcc/config/i386/i386.c:24759 0x106b68e gen_movmemdi(rtx_def*, rtx_def*, rtx_def*, rtx_def*, rtx_def*, rtx_def*, rtx_def*, rtx_def*, rtx_def*) /mnt/svn/gcc-trunk/gcc/config/i386/i386.md:15893 0xb18792 insn_gen_fn::operator()(rtx_def*, rtx_def*, rtx_def*, rtx_def*, rtx_def*, rtx_def*, rtx_def*, rtx_def*, rtx_def*) const /mnt/svn/gcc-trunk/gcc/recog.h:310 0xb18792 maybe_gen_insn(insn_code, unsigned int, expand_operand*) /mnt/svn/gcc-trunk/gcc/optabs.c:8395 0xb18da8 maybe_expand_insn(insn_code, unsigned int, expand_operand*) /mnt/svn/gcc-trunk/gcc/optabs.c:8407 0x8d8a3e emit_block_move_via_movmem /mnt/svn/gcc-trunk/gcc/expr.c:1330 0x8d8a3e emit_block_move_hints(rtx_def*, rtx_def*, rtx_def*, block_op_methods, unsigned int, long, unsigned long, unsigned long, unsigned long) /mnt/svn/gcc-trunk/gcc/expr.c:1148 0x797721 expand_builtin_memcpy_args /mnt/svn/gcc-trunk/gcc/builtins.c:3243 0x7a746c expand_builtin(tree_node*, rtx_def*, rtx_def*, machine_mode, int) /mnt/svn/gcc-trunk/gcc/builtins.c:6288 0x8d45b6 expand_expr_real_1(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool) /mnt/svn/gcc-trunk/gcc/expr.c:10471 0x7cb4c9 expand_expr /mnt/svn/gcc-trunk/gcc/expr.h:299 0x7cb4c9 expand_call_stmt /mnt/svn/gcc-trunk/gcc/cfgexpand.c:2347 0x7cbbff expand_gimple_stmt_1 /mnt/svn/gcc-trunk/gcc/cfgexpand.c:3293 0x7cbbff expand_gimple_stmt /mnt/svn/gcc-trunk/gcc/cfgexpand.c:3447 0x7d1193 expand_gimple_basic_block /mnt/svn/gcc-trunk/gcc/cfgexpand.c:5280 0x7d3686 execute /mnt/svn/gcc-trunk/gcc/cfgexpand.c:5889 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See http://gcc.gnu.org/bugs.html for instructions.
[Bug target/64108] ICE: SIGSEGV in decide_alg() with -mmemset-strategy=libcall:-1:align -minline-all-stringops
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64108 --- Comment #2 from hjl at gcc dot gnu.org hjl at gcc dot gnu.org --- Author: hjl Date: Tue Dec 2 14:10:23 2014 New Revision: 218272 URL: https://gcc.gnu.org/viewcvs?rev=218272root=gccview=rev Log: Stop only if there aren't any usable algorithms When searching for an usable algorithm with -minline-all-stringops, decide_alg stops when it sees libcall even if there is a usable algorithm. It goes into an infinite loop. This patch changes decide_alg to stop searching only if there aren't any usable algorithms. Testd on Linux/x86-64. gcc/ PR target/64108 * config/i386/i386.c (decide_alg): Stop only if there aren't any usable algorithms. gcc/testsuite/ PR target/64108 * gcc.target/i386/memset-strategy-2.c: New test. Added: trunk/gcc/testsuite/gcc.target/i386/memset-strategy-2.c Modified: trunk/gcc/ChangeLog trunk/gcc/config/i386/i386.c trunk/gcc/testsuite/ChangeLog
[Bug target/64108] ICE: SIGSEGV in decide_alg() with -mmemset-strategy=libcall:-1:align -minline-all-stringops
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64108 H.J. Lu hjl.tools at gmail dot com changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed||2014-11-29 Target Milestone|--- |5.0 Ever confirmed|0 |1 --- Comment #1 from H.J. Lu hjl.tools at gmail dot com --- A patch is posted at https://gcc.gnu.org/ml/gcc-patches/2014-11/msg03532.html
[Bug target/64108] ICE: SIGSEGV in decide_alg() with -mmemset-strategy=libcall:-1:align -minline-all-stringops
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64108 H.J. Lu hjl.tools at gmail dot com changed: What|Removed |Added Target Milestone|5.0 |4.9.3