From 7ee93d4e3473e678dcabef2e09b3cc1c820968e4 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 15 Mar 2011 12:28:35 +0100 Subject: [PATCH] re PR tree-optimization/48129 (gcc.c-torture/execute/builtins/snprintf-chk.c ICE) PR tree-optimization/48129 * builtins.c (fold_builtin_snprintf): Convert to type of built_in_decls[BUILT_IN_SNPRINTF] retval instead of implicit_built_in_decls[BUILT_IN_SNPRINTF] retval. From-SVN: r170985 --- gcc/ChangeLog | 7 +++++++ gcc/builtins.c | 5 ++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3c55339f424..ec59459bc97 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2011-03-15 Jakub Jelinek + + PR tree-optimization/48129 + * builtins.c (fold_builtin_snprintf): Convert to type of + built_in_decls[BUILT_IN_SNPRINTF] retval instead of + implicit_built_in_decls[BUILT_IN_SNPRINTF] retval. + 2011-03-15 Richard Guenther PR tree-optimization/41490 diff --git a/gcc/builtins.c b/gcc/builtins.c index a59b23c5040..ad21b2d6163 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -12038,9 +12038,8 @@ fold_builtin_snprintf (location_t loc, tree dest, tree destsize, tree fmt, if (call && retval) { - retval = fold_convert_loc - (loc, TREE_TYPE (TREE_TYPE (implicit_built_in_decls[BUILT_IN_SNPRINTF])), - retval); + tree fn = built_in_decls[BUILT_IN_SNPRINTF]; + retval = fold_convert_loc (loc, TREE_TYPE (TREE_TYPE (fn)), retval); return build2 (COMPOUND_EXPR, TREE_TYPE (retval), call, retval); } else -- 2.30.2