[Bug tree-optimization/86089] [9 Regression] ICE in get_string_length, at tree-ssa-strlen.c:653
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Jun 10 21:18:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86089
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |NEW
CC| |marxin at gcc dot gnu.org
--- Comment #6 from Martin Sebor <msebor at gcc dot gnu.org> ---
Thanks for the dump. I can confirm the iCE with the simplified test case
below. It's caused by a typo in r261304 in the hunk below. The
BUILT_IN_STRCPY_CHK case needs to stay:
@@ -628,16 +617,8 @@ get_string_length (strinfo *si)
lhs = NULL_TREE;
/* FALLTHRU */
case BUILT_IN_STRCPY:
- case BUILT_IN_STRCPY_CHK:
- case BUILT_IN_STRCPY_CHKP:
- case BUILT_IN_STRCPY_CHK_CHKP:
gcc_assert (builtin_decl_implicit_p (BUILT_IN_STPCPY));
- if (gimple_call_num_args (stmt) == (with_bounds ? 4 : 2))
- fn = builtin_decl_implicit (BUILT_IN_STPCPY);
- else
- fn = builtin_decl_explicit (BUILT_IN_STPCPY_CHK);
- if (with_bounds)
- fn = chkp_maybe_create_clone (fn)->decl;
+ fn = builtin_decl_implicit (BUILT_IN_STPCPY);
gcc_assert (lhs == NULL_TREE);
if (dump_file && (dump_flags & TDF_DETAILS) != 0)
{
$ cat pr86089.c && gcc -O2 -S -Wall pr86089.c
extern char* stpcpy (char*, const char*);
int f (char* s)
{
char a[32];
__builtin___strcpy_chk (a, s, __builtin_object_size (a, 1));
return __builtin_strlen (a);
}
during GIMPLE pass: strlen
pr86089.c: In function ‘f’:
pr86089.c:3:5: internal compiler error: in get_string_length, at
tree-ssa-strlen.c:653
int f (char* s)
^
0x1233bb5 get_string_length
/ssd/src/gcc/git-svn/gcc/tree-ssa-strlen.c:653
0x1235343 handle_builtin_strlen
/ssd/src/gcc/git-svn/gcc/tree-ssa-strlen.c:1190
0x123bd1c strlen_check_and_optimize_stmt
/ssd/src/gcc/git-svn/gcc/tree-ssa-strlen.c:3330
0x123d4b3 strlen_dom_walker::before_dom_children(basic_block_def*)
/ssd/src/gcc/git-svn/gcc/tree-ssa-strlen.c:3683
0x1b3cea3 dom_walker::walk(basic_block_def*)
/ssd/src/gcc/git-svn/gcc/domwalk.c:353
0x123d744 execute
/ssd/src/gcc/git-svn/gcc/tree-ssa-strlen.c:3763
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
More information about the Gcc-bugs
mailing list