Mercurial > hg > CbC > CbC_gcc
comparison 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 |
comparison
equal
deleted
inserted
replaced
46:b85a337e5837 | 47:3bfb6c00c1e0 |
---|---|
149 static tree stabilize_va_list (tree, int); | 149 static tree stabilize_va_list (tree, int); |
150 static rtx expand_builtin_expect (tree, rtx); | 150 static rtx expand_builtin_expect (tree, rtx); |
151 static tree fold_builtin_constant_p (tree); | 151 static tree fold_builtin_constant_p (tree); |
152 static tree fold_builtin_expect (tree, tree); | 152 static tree fold_builtin_expect (tree, tree); |
153 static tree fold_builtin_classify_type (tree); | 153 static tree fold_builtin_classify_type (tree); |
154 static tree fold_builtin_strlen (tree); | 154 static tree fold_builtin_strlen (tree, tree); |
155 static tree fold_builtin_inf (tree, int); | 155 static tree fold_builtin_inf (tree, int); |
156 static tree fold_builtin_nan (tree, tree, int); | 156 static tree fold_builtin_nan (tree, tree, int); |
157 static tree rewrite_call_expr (tree, int, tree, int, ...); | 157 static tree rewrite_call_expr (tree, int, tree, int, ...); |
158 static bool validate_arg (const_tree, enum tree_code code); | 158 static bool validate_arg (const_tree, enum tree_code code); |
159 static bool integer_valued_real_p (tree); | 159 static bool integer_valued_real_p (tree); |
3710 expand_builtin_strcpy_args (tree fndecl, tree dest, tree src, | 3710 expand_builtin_strcpy_args (tree fndecl, tree dest, tree src, |
3711 rtx target, enum machine_mode mode) | 3711 rtx target, enum machine_mode mode) |
3712 { | 3712 { |
3713 tree result = fold_builtin_strcpy (fndecl, dest, src, 0); | 3713 tree result = fold_builtin_strcpy (fndecl, dest, src, 0); |
3714 if (result) | 3714 if (result) |
3715 return expand_expr (result, target, mode, EXPAND_NORMAL); | 3715 { |
3716 while (TREE_CODE (result) == COMPOUND_EXPR) | |
3717 { | |
3718 expand_expr (TREE_OPERAND (result, 0), const0_rtx, VOIDmode, | |
3719 EXPAND_NORMAL); | |
3720 result = TREE_OPERAND (result, 1); | |
3721 } | |
3722 return expand_expr (result, target, mode, EXPAND_NORMAL); | |
3723 } | |
3716 return expand_movstr (dest, src, target, /*endp=*/0); | 3724 return expand_movstr (dest, src, target, /*endp=*/0); |
3717 | 3725 |
3718 } | 3726 } |
3719 | 3727 |
3720 /* Expand a call EXP to the stpcpy builtin. | 3728 /* Expand a call EXP to the stpcpy builtin. |
7349 } | 7357 } |
7350 | 7358 |
7351 /* Fold a call to __builtin_strlen with argument ARG. */ | 7359 /* Fold a call to __builtin_strlen with argument ARG. */ |
7352 | 7360 |
7353 static tree | 7361 static tree |
7354 fold_builtin_strlen (tree arg) | 7362 fold_builtin_strlen (tree type, tree arg) |
7355 { | 7363 { |
7356 if (!validate_arg (arg, POINTER_TYPE)) | 7364 if (!validate_arg (arg, POINTER_TYPE)) |
7357 return NULL_TREE; | 7365 return NULL_TREE; |
7358 else | 7366 else |
7359 { | 7367 { |
7360 tree len = c_strlen (arg, 0); | 7368 tree len = c_strlen (arg, 0); |
7361 | 7369 |
7362 if (len) | 7370 if (len) |
7363 { | 7371 return fold_convert (type, len); |
7364 /* Convert from the internal "sizetype" type to "size_t". */ | |
7365 if (size_type_node) | |
7366 len = fold_convert (size_type_node, len); | |
7367 return len; | |
7368 } | |
7369 | 7372 |
7370 return NULL_TREE; | 7373 return NULL_TREE; |
7371 } | 7374 } |
7372 } | 7375 } |
7373 | 7376 |
10124 | 10127 |
10125 case BUILT_IN_CLASSIFY_TYPE: | 10128 case BUILT_IN_CLASSIFY_TYPE: |
10126 return fold_builtin_classify_type (arg0); | 10129 return fold_builtin_classify_type (arg0); |
10127 | 10130 |
10128 case BUILT_IN_STRLEN: | 10131 case BUILT_IN_STRLEN: |
10129 return fold_builtin_strlen (arg0); | 10132 return fold_builtin_strlen (type, arg0); |
10130 | 10133 |
10131 CASE_FLT_FN (BUILT_IN_FABS): | 10134 CASE_FLT_FN (BUILT_IN_FABS): |
10132 return fold_builtin_fabs (arg0, type); | 10135 return fold_builtin_fabs (arg0, type); |
10133 | 10136 |
10134 case BUILT_IN_ABS: | 10137 case BUILT_IN_ABS: |