PR tree-optimization/15738.
* builtins.c (fold_builtin_strchr): Transform
strrchr (s, '\0') to strchr (s, '\0').
From-SVN: r82572
+2004-06-02 Kazu Hirata <kazu@cs.umass.edu>
+
+ PR tree-optimization/15738.
+ * builtins.c (fold_builtin_strchr): Transform
+ strrchr (s, '\0') to strchr (s, '\0').
+
2004-06-02 Steven Bosscher <stevenb@suse.de>
* i386.c (ix86_adjust_cost): Don't increase the cost for
ssize_int (r - p1))));
}
+ if (actually_strrchr)
+ {
+ tree fn;
+
+ if (!integer_zerop (s2))
+ return 0;
+
+ fn = implicit_built_in_decls[BUILT_IN_STRCHR];
+ if (!fn)
+ return 0;
+
+ /* Transform strrchr(s1, '\0') to strchr(s1, '\0'). */
+ return build_function_call_expr (fn, arglist);
+ }
+
return 0;
}
}