+2006-02-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/26092
+ * gimplify.c (gimplify_call_expr): Don't call get_callee_fndecl
+ twice if decl is a builtin. When trying again, call get_callee_fndecl
+ first to verify it is still a builtin.
+
2006-02-13 Geoffrey Keating <geoffk@apple.com>
* dwarf2out.c (base_type_die): Don't add AT_name here.
decl = get_callee_fndecl (*expr_p);
if (decl && DECL_BUILT_IN (decl))
{
- tree fndecl = get_callee_fndecl (*expr_p);
tree arglist = TREE_OPERAND (*expr_p, 1);
- tree new = fold_builtin (fndecl, arglist, !want_value);
+ tree new = fold_builtin (decl, arglist, !want_value);
if (new && new != *expr_p)
{
TREE_OPERAND (*expr_p, 1) = nreverse (TREE_OPERAND (*expr_p, 1));
/* Try this again in case gimplification exposed something. */
- if (ret != GS_ERROR && decl && DECL_BUILT_IN (decl))
+ if (ret != GS_ERROR)
{
- tree fndecl = get_callee_fndecl (*expr_p);
- tree arglist = TREE_OPERAND (*expr_p, 1);
- tree new = fold_builtin (fndecl, arglist, !want_value);
-
- if (new && new != *expr_p)
+ decl = get_callee_fndecl (*expr_p);
+ if (decl && DECL_BUILT_IN (decl))
{
- /* There was a transformation of this call which computes the
- same value, but in a more efficient way. Return and try
- again. */
- *expr_p = new;
- return GS_OK;
+ tree arglist = TREE_OPERAND (*expr_p, 1);
+ tree new = fold_builtin (decl, arglist, !want_value);
+
+ if (new && new != *expr_p)
+ {
+ /* There was a transformation of this call which computes the
+ same value, but in a more efficient way. Return and try
+ again. */
+ *expr_p = new;
+ return GS_OK;
+ }
}
}