diff options
author | Wilco Dijkstra <wdijkstr@arm.com> | 2016-09-28 16:31:34 +0000 |
---|---|---|
committer | Wilco Dijkstra <wilco@gcc.gnu.org> | 2016-09-28 16:31:34 +0000 |
commit | 93c9b105be716efa6ede687f5bc6af6d5224a0de (patch) | |
tree | 6e87c0667cdb91d59bca529216cdf8d8f06c7150 | |
parent | 2b1b5938422ef07c10509de00d52b735e55a86f4 (diff) | |
download | gcc-93c9b105be716efa6ede687f5bc6af6d5224a0de.zip gcc-93c9b105be716efa6ede687f5bc6af6d5224a0de.tar.gz gcc-93c9b105be716efa6ede687f5bc6af6d5224a0de.tar.bz2 |
If strchr can't be folded in gimple-fold...
If strchr can't be folded in gimple-fold, we still need to fall into
the generic code so the folding code in builtins.c is also called.
gcc/
* gimple-fold.c (gimple_fold_builtin): After failing to fold
strchr, also try the generic folding.
From-SVN: r240585
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/gimple-fold.c | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 194c9bf..4c02c9d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2016-09-28 Wilco Dijkstra <wdijkstr@arm.com> + + * gimple-fold.c (gimple_fold_builtin): After failing to fold + strchr, also try the generic folding. + 2016-09-28 Martin Sebor <msebor@redhat.com> PR c/77762 diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c index f5a5e5d..1aae845 100644 --- a/gcc/gimple-fold.c +++ b/gcc/gimple-fold.c @@ -2948,7 +2948,10 @@ gimple_fold_builtin (gimple_stmt_iterator *gsi) case BUILT_IN_STRNCAT: return gimple_fold_builtin_strncat (gsi); case BUILT_IN_STRCHR: - return gimple_fold_builtin_strchr (gsi); + if (gimple_fold_builtin_strchr (gsi)) + return true; + /* Perform additional folding in builtin.c. */ + break; case BUILT_IN_FPUTS: return gimple_fold_builtin_fputs (gsi, gimple_call_arg (stmt, 0), gimple_call_arg (stmt, 1), false); |