aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/c
diff options
context:
space:
mode:
authorBen Cheng <bccheng@google.com>2014-04-22 13:33:12 -0700
committerBen Cheng <bccheng@google.com>2014-04-22 13:33:12 -0700
commite3cc64dec20832769406aa38cde83c7dd4194bf4 (patch)
treeef8e39be37cfe0cb69d850043b7924389ff17164 /gcc-4.9/gcc/c
parentf33c7b3122b1d7950efa88067c9a156229ba647b (diff)
downloadtoolchain_gcc-e3cc64dec20832769406aa38cde83c7dd4194bf4.tar.gz
toolchain_gcc-e3cc64dec20832769406aa38cde83c7dd4194bf4.tar.bz2
toolchain_gcc-e3cc64dec20832769406aa38cde83c7dd4194bf4.zip
[4.9] GCC 4.9.0 official release refresh
Change-Id: Ic99a7da8b44b789a48aeec93b33e93944d6e6767
Diffstat (limited to 'gcc-4.9/gcc/c')
-rw-r--r--gcc-4.9/gcc/c/ChangeLog27
-rw-r--r--gcc-4.9/gcc/c/c-array-notation.c21
-rw-r--r--gcc-4.9/gcc/c/c-decl.c4
-rw-r--r--gcc-4.9/gcc/c/c-parser.c5
-rw-r--r--gcc-4.9/gcc/c/c-tree.h2
-rw-r--r--gcc-4.9/gcc/c/c-typeck.c42
6 files changed, 72 insertions, 29 deletions
diff --git a/gcc-4.9/gcc/c/ChangeLog b/gcc-4.9/gcc/c/ChangeLog
index b39b7d654..f5e7179e9 100644
--- a/gcc-4.9/gcc/c/ChangeLog
+++ b/gcc-4.9/gcc/c/ChangeLog
@@ -1,3 +1,30 @@
+2014-04-22 Release Manager
+
+ * GCC 4.9.0 released.
+
+2014-04-15 Igor Zamyatin <igor.zamyatin@intel.com>
+
+ PR middle-end/60469
+ * c-array-notation.c (fix_builtin_array_notation_fn): Use
+ create_tmp_var instead build_decl for creating temps.
+ (build_array_notation_expr): Likewise.
+ (fix_conditional_array_notations_1): Likewise.
+ (fix_array_notation_expr): Likewise.
+ (fix_array_notation_call_expr): Likewise.
+
+2014-03-28 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/60689
+ * c-tree.h (c_build_function_call_vec): New prototype.
+ * c-typeck.c (build_function_call_vec): Don't call
+ resolve_overloaded_builtin here.
+ (c_build_function_call_vec): New wrapper function around
+ build_function_call_vec. Call resolve_overloaded_builtin here.
+ (convert_lvalue_to_rvalue, build_function_call, build_atomic_assign):
+ Call c_build_function_call_vec instead of build_function_call_vec.
+ * c-parser.c (c_parser_postfix_expression_after_primary): Likewise.
+ * c-decl.c (finish_decl): Likewise.
+
2014-03-18 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c/55383
diff --git a/gcc-4.9/gcc/c/c-array-notation.c b/gcc-4.9/gcc/c/c-array-notation.c
index 6a5631c3b..0ac6ba8e1 100644
--- a/gcc-4.9/gcc/c/c-array-notation.c
+++ b/gcc-4.9/gcc/c/c-array-notation.c
@@ -70,6 +70,7 @@
#include "coretypes.h"
#include "tree.h"
#include "c-tree.h"
+#include "gimple-expr.h"
#include "tree-iterator.h"
#include "opts.h"
#include "c-family/c-common.h"
@@ -282,8 +283,7 @@ fix_builtin_array_notation_fn (tree an_builtin_fn, tree *new_var)
for (ii = 0; ii < rank; ii++)
{
- an_loop_info[ii].var = build_decl (location, VAR_DECL, NULL_TREE,
- integer_type_node);
+ an_loop_info[ii].var = create_tmp_var (integer_type_node, NULL);
an_loop_info[ii].ind_init =
build_modify_expr (location, an_loop_info[ii].var,
TREE_TYPE (an_loop_info[ii].var), NOP_EXPR,
@@ -781,8 +781,8 @@ build_array_notation_expr (location_t location, tree lhs, tree lhs_origtype,
for (ii = 0; ii < lhs_rank; ii++)
if (lhs_an_info[0][ii].is_vector)
{
- lhs_an_loop_info[ii].var = build_decl (location, VAR_DECL, NULL_TREE,
- integer_type_node);
+ lhs_an_loop_info[ii].var = create_tmp_var (integer_type_node,
+ NULL);
lhs_an_loop_info[ii].ind_init = build_modify_expr
(location, lhs_an_loop_info[ii].var,
TREE_TYPE (lhs_an_loop_info[ii].var), NOP_EXPR,
@@ -793,8 +793,8 @@ build_array_notation_expr (location_t location, tree lhs, tree lhs_origtype,
{
/* When we have a polynomial, we assume that the indices are of type
integer. */
- rhs_an_loop_info[ii].var = build_decl (location, VAR_DECL, NULL_TREE,
- integer_type_node);
+ rhs_an_loop_info[ii].var = create_tmp_var (integer_type_node,
+ NULL);
rhs_an_loop_info[ii].ind_init = build_modify_expr
(location, rhs_an_loop_info[ii].var,
TREE_TYPE (rhs_an_loop_info[ii].var), NOP_EXPR,
@@ -970,8 +970,7 @@ fix_conditional_array_notations_1 (tree stmt)
cilkplus_extract_an_triplets (array_list, list_size, rank, &an_info);
for (ii = 0; ii < rank; ii++)
{
- an_loop_info[ii].var = build_decl (location, VAR_DECL, NULL_TREE,
- integer_type_node);
+ an_loop_info[ii].var = create_tmp_var (integer_type_node, NULL);
an_loop_info[ii].ind_init =
build_modify_expr (location, an_loop_info[ii].var,
TREE_TYPE (an_loop_info[ii].var), NOP_EXPR,
@@ -1067,8 +1066,7 @@ fix_array_notation_expr (location_t location, enum tree_code code,
loop_init = push_stmt_list ();
for (ii = 0; ii < rank; ii++)
{
- an_loop_info[ii].var = build_decl (location, VAR_DECL, NULL_TREE,
- integer_type_node);
+ an_loop_info[ii].var = create_tmp_var (integer_type_node, NULL);
an_loop_info[ii].ind_init =
build_modify_expr (location, an_loop_info[ii].var,
TREE_TYPE (an_loop_info[ii].var), NOP_EXPR,
@@ -1163,8 +1161,7 @@ fix_array_notation_call_expr (tree arg)
}
for (ii = 0; ii < rank; ii++)
{
- an_loop_info[ii].var = build_decl (location, VAR_DECL, NULL_TREE,
- integer_type_node);
+ an_loop_info[ii].var = create_tmp_var (integer_type_node, NULL);
an_loop_info[ii].ind_init =
build_modify_expr (location, an_loop_info[ii].var,
TREE_TYPE (an_loop_info[ii].var), NOP_EXPR, location,
diff --git a/gcc-4.9/gcc/c/c-decl.c b/gcc-4.9/gcc/c/c-decl.c
index 2c41bf2ce..df84980e3 100644
--- a/gcc-4.9/gcc/c/c-decl.c
+++ b/gcc-4.9/gcc/c/c-decl.c
@@ -4568,8 +4568,8 @@ finish_decl (tree decl, location_t init_loc, tree init,
cleanup = build_unary_op (input_location, ADDR_EXPR, decl, 0);
vec_alloc (v, 1);
v->quick_push (cleanup);
- cleanup = build_function_call_vec (DECL_SOURCE_LOCATION (decl),
- vNULL, cleanup_decl, v, NULL);
+ cleanup = c_build_function_call_vec (DECL_SOURCE_LOCATION (decl),
+ vNULL, cleanup_decl, v, NULL);
vec_free (v);
/* Don't warn about decl unused; the cleanup uses it. */
diff --git a/gcc-4.9/gcc/c/c-parser.c b/gcc-4.9/gcc/c/c-parser.c
index d0d35c577..5653e49f4 100644
--- a/gcc-4.9/gcc/c/c-parser.c
+++ b/gcc-4.9/gcc/c/c-parser.c
@@ -7703,8 +7703,9 @@ c_parser_postfix_expression_after_primary (c_parser *parser,
expr.value, exprlist,
sizeof_arg,
sizeof_ptr_memacc_comptypes);
- expr.value = build_function_call_vec (expr_loc, arg_loc, expr.value,
- exprlist, origtypes);
+ expr.value
+ = c_build_function_call_vec (expr_loc, arg_loc, expr.value,
+ exprlist, origtypes);
expr.original_code = ERROR_MARK;
if (TREE_CODE (expr.value) == INTEGER_CST
&& TREE_CODE (orig_expr.value) == FUNCTION_DECL
diff --git a/gcc-4.9/gcc/c/c-tree.h b/gcc-4.9/gcc/c/c-tree.h
index 84d5e0b08..85df8858d 100644
--- a/gcc-4.9/gcc/c/c-tree.h
+++ b/gcc-4.9/gcc/c/c-tree.h
@@ -643,6 +643,8 @@ extern tree c_finish_omp_clauses (tree);
extern tree c_build_va_arg (location_t, tree, tree);
extern tree c_finish_transaction (location_t, tree, int);
extern bool c_tree_equal (tree, tree);
+extern tree c_build_function_call_vec (location_t, vec<location_t>, tree,
+ vec<tree, va_gc> *, vec<tree, va_gc> *);
/* Set to 0 at beginning of a function definition, set to 1 if
a return statement that specifies a return value is seen. */
diff --git a/gcc-4.9/gcc/c/c-typeck.c b/gcc-4.9/gcc/c/c-typeck.c
index 0bfc12bea..65aad4565 100644
--- a/gcc-4.9/gcc/c/c-typeck.c
+++ b/gcc-4.9/gcc/c/c-typeck.c
@@ -2016,7 +2016,7 @@ convert_lvalue_to_rvalue (location_t loc, struct c_expr exp,
params->quick_push (expr_addr);
params->quick_push (tmp_addr);
params->quick_push (seq_cst);
- func_call = build_function_call_vec (loc, vNULL, fndecl, params, NULL);
+ func_call = c_build_function_call_vec (loc, vNULL, fndecl, params, NULL);
/* EXPR is always read. */
mark_exp_read (exp.value);
@@ -2801,7 +2801,7 @@ build_function_call (location_t loc, tree function, tree params)
vec_alloc (v, list_length (params));
for (; params; params = TREE_CHAIN (params))
v->quick_push (TREE_VALUE (params));
- ret = build_function_call_vec (loc, vNULL, function, v, NULL);
+ ret = c_build_function_call_vec (loc, vNULL, function, v, NULL);
vec_free (v);
return ret;
}
@@ -2840,14 +2840,6 @@ build_function_call_vec (location_t loc, vec<location_t> arg_loc,
/* Convert anything with function type to a pointer-to-function. */
if (TREE_CODE (function) == FUNCTION_DECL)
{
- /* Implement type-directed function overloading for builtins.
- resolve_overloaded_builtin and targetm.resolve_overloaded_builtin
- handle all the type checking. The result is a complete expression
- that implements this function call. */
- tem = resolve_overloaded_builtin (loc, function, params);
- if (tem)
- return tem;
-
name = DECL_NAME (function);
if (flag_tm)
@@ -2970,6 +2962,30 @@ build_function_call_vec (location_t loc, vec<location_t> arg_loc,
}
return require_complete_type (result);
}
+
+/* Like build_function_call_vec, but call also resolve_overloaded_builtin. */
+
+tree
+c_build_function_call_vec (location_t loc, vec<location_t> arg_loc,
+ tree function, vec<tree, va_gc> *params,
+ vec<tree, va_gc> *origtypes)
+{
+ /* Strip NON_LVALUE_EXPRs, etc., since we aren't using as an lvalue. */
+ STRIP_TYPE_NOPS (function);
+
+ /* Convert anything with function type to a pointer-to-function. */
+ if (TREE_CODE (function) == FUNCTION_DECL)
+ {
+ /* Implement type-directed function overloading for builtins.
+ resolve_overloaded_builtin and targetm.resolve_overloaded_builtin
+ handle all the type checking. The result is a complete expression
+ that implements this function call. */
+ tree tem = resolve_overloaded_builtin (loc, function, params);
+ if (tem)
+ return tem;
+ }
+ return build_function_call_vec (loc, arg_loc, function, params, origtypes);
+}
/* Convert the argument expressions in the vector VALUES
to the types in the list TYPELIST.
@@ -3634,7 +3650,7 @@ build_atomic_assign (location_t loc, tree lhs, enum tree_code modifycode,
params->quick_push (lhs_addr);
params->quick_push (rhs);
params->quick_push (seq_cst);
- func_call = build_function_call_vec (loc, vNULL, fndecl, params, NULL);
+ func_call = c_build_function_call_vec (loc, vNULL, fndecl, params, NULL);
add_stmt (func_call);
/* Finish the compound statement. */
@@ -3666,7 +3682,7 @@ build_atomic_assign (location_t loc, tree lhs, enum tree_code modifycode,
params->quick_push (lhs_addr);
params->quick_push (old_addr);
params->quick_push (seq_cst);
- func_call = build_function_call_vec (loc, vNULL, fndecl, params, NULL);
+ func_call = c_build_function_call_vec (loc, vNULL, fndecl, params, NULL);
add_stmt (func_call);
params->truncate (0);
@@ -3705,7 +3721,7 @@ build_atomic_assign (location_t loc, tree lhs, enum tree_code modifycode,
params->quick_push (integer_zero_node);
params->quick_push (seq_cst);
params->quick_push (seq_cst);
- func_call = build_function_call_vec (loc, vNULL, fndecl, params, NULL);
+ func_call = c_build_function_call_vec (loc, vNULL, fndecl, params, NULL);
goto_stmt = build1 (GOTO_EXPR, void_type_node, done_decl);
SET_EXPR_LOCATION (goto_stmt, loc);