Mercurial > hg > CbC > CbC_gcc
diff gcc/builtins.c @ 47:3bfb6c00c1e0
update it from 4.4.2 to 4.4.3.
author | kent <kent@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 07 Feb 2010 17:44:34 +0900 |
parents | 855418dad1a3 |
children | 77e2b8dfacca |
line wrap: on
line diff
--- a/gcc/builtins.c Sun Feb 07 17:43:48 2010 +0900 +++ b/gcc/builtins.c Sun Feb 07 17:44:34 2010 +0900 @@ -151,7 +151,7 @@ static tree fold_builtin_constant_p (tree); static tree fold_builtin_expect (tree, tree); static tree fold_builtin_classify_type (tree); -static tree fold_builtin_strlen (tree); +static tree fold_builtin_strlen (tree, tree); static tree fold_builtin_inf (tree, int); static tree fold_builtin_nan (tree, tree, int); static tree rewrite_call_expr (tree, int, tree, int, ...); @@ -3712,7 +3712,15 @@ { tree result = fold_builtin_strcpy (fndecl, dest, src, 0); if (result) - return expand_expr (result, target, mode, EXPAND_NORMAL); + { + while (TREE_CODE (result) == COMPOUND_EXPR) + { + expand_expr (TREE_OPERAND (result, 0), const0_rtx, VOIDmode, + EXPAND_NORMAL); + result = TREE_OPERAND (result, 1); + } + return expand_expr (result, target, mode, EXPAND_NORMAL); + } return expand_movstr (dest, src, target, /*endp=*/0); } @@ -7351,7 +7359,7 @@ /* Fold a call to __builtin_strlen with argument ARG. */ static tree -fold_builtin_strlen (tree arg) +fold_builtin_strlen (tree type, tree arg) { if (!validate_arg (arg, POINTER_TYPE)) return NULL_TREE; @@ -7360,12 +7368,7 @@ tree len = c_strlen (arg, 0); if (len) - { - /* Convert from the internal "sizetype" type to "size_t". */ - if (size_type_node) - len = fold_convert (size_type_node, len); - return len; - } + return fold_convert (type, len); return NULL_TREE; } @@ -10126,7 +10129,7 @@ return fold_builtin_classify_type (arg0); case BUILT_IN_STRLEN: - return fold_builtin_strlen (arg0); + return fold_builtin_strlen (type, arg0); CASE_FLT_FN (BUILT_IN_FABS): return fold_builtin_fabs (arg0, type);