gcc/c-family:
[official-gcc.git] / gcc / c / ChangeLog
blob1b4b29772943c09503c0a27329de6c2bafffc789
1 2013-09-08  Joern Rennecke  <joern.rennecke@embecosm.com>
3         * c-typeck.c (build_binary_op): Use vector_types_compatible_elements_p.
5 2013-09-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
7         * c-objc-common.c (c_tree_printer): Tidy.
9 2013-08-30  Marek Polacek  <polacek@redhat.com>
11         * c-typeck.c (build_binary_op): Add division by zero and shift
12         instrumentation.
14 2013-08-26  Joern Rennecke  <joern.rennecke@embecosm.com>
15             Joseph Myers  <joseph@codesourcery.com>
17         PR c/35649
18         * c-typeck.c (c_common_type): Prefer double_type_node over
19         other REAL_TYPE types with the same precision.
20         (convert_arguments): Likewise.
22 2013-08-23  Gabriel Dos Reis  <gdr@integrable-solutions.net>
24         * c-objc-common.c (c_tree_printer): Document the nature of the cast.
25         (c_initialize_diagnostics): Call a destructor for the early printer.
27 2013-08-22  Gabriel Dos Reis  <gdr@integrable-solutions.net>
29         * c-objc-common.c (c_initialize_diagnostics): Simplify C pretty
30         printer initialization.
32 2013-08-19  Balaji V. Iyer  <balaji.v.iyer@intel.com>
34         PR c/57490
35         * c-array-notation.c (fix_conditional_array_notations_1): Added a
36         check for truth values.
37         (expand_array_notation_exprs): Added truth values case.  Removed an
38         unwanted else.  Added for-loop to walk through subtrees in default
39         case.
41 2013-08-04  Gabriel Dos Reis  <gdr@integrable-solutions.net>
43         * c-objc-common.c (c_initialize_diagnostics): Don't call pp_base.
45 2013-07-23  Joseph Myers  <joseph@codesourcery.com>
47         * c-parser.c (struct c_generic_association): Fix typo.
49 2013-07-23  Tom Tromey  <tromey@redhat.com>
50             Joseph Myers  <joseph@codesourcery.com>
52         * c-parser.c (struct c_generic_association): New.
53         (c_generic_association_d): New typedef.
54         (c_parser_generic_selection): New function.
55         (c_parser_postfix_expression): Handle RID_GENERIC.
57 2013-07-13  Jason Merrill  <jason@redhat.com>
59         PR c++/57793
60         * c-decl.c (finish_struct): Check for too-large class.
62 2013-07-04  Joern Rennecke <joern.rennecke@embecosm.com>
64         PR c/57821
65         * c-typeck.c (set_init_index): When folding, check for index overflow.
67 2013-06-28  Balaji V. Iyer  <balaji.v.iyer@intel.com>
69         * c-parser.c (c_parser_array_notation): Removed rejection of array
70         notations in an array of function pointers.
72 2013-06-21  Balaji V. Iyer  <balaji.v.iyer@intel.com>
74         * c-array-notation.c (make_triplet_val_inv): New function.
75         (create_cmp_incr): Likewise.
76         (create_array_refs): Likewise.
77         (fix_builtin_array_notation_fn): Replaced all mallocs with tree vec.
78         Also modularized common parts between functions and called the function.
79         (build_array_notation_expr): Likewise.
80         (fix_conditional_array_notations_1): Likewise.
81         (fix_array_notation_expr): Likewise.
82         (fix_array_notation_call_expr): Likewise.
84 2013-06-18  Marek Polacek  <polacek@redhat.com>
86         PR c/57630
87         * c-decl.c (check_for_loop_decls): Improve diagnostics messages.
89 2013-06-12  Balaji V. Iyer  <balaji.v.iyer@intel.com>
91         * c-array-notation.c (build_array_notation_expr): Reject array notation
92         mismatch between LHS and RHS even inside a call_expr.  Also, removed
93         a couple while statements that were dead code.
95 2013-06-10  Balaji V. Iyer  <balaji.v.iyer@intel.com>
97         * c-array-notation.c (fix_builtin_array_notation_fn): Fully folded
98         excessive precision expressions in function parameters.  Also removed
99         couple unwanted while statements.
101 2013-06-07  Balaji V. Iyer  <balaji.v.iyer@intel.com>
103         * c-array-notation.c (expand_array_notation_exprs): Added
104         ARRAY_NOTATION_REF case.
105         
106 2013-06-07  Balaji V. Iyer  <balaji.v.iyer@intel.com>
108         * c-array-notation.c (length_mismatch_in_expr_p): Moved this
109         function to c-family/array-notation-common.c.
110         (is_cilkplus_reduce_builtin): Likewise.
111         (find_rank): Likewise.
112         (extract_array_notation_exprs): Likewise.
113         (replace_array_notations): Likewise.
114         (find_inv_trees): Likewise.
115         (replace_inv_trees): Likewise.
116         (contains_array_notation_expr): Likewise.
117         (find_correct_array_notation_type): Likewise.
118         (replace_invariant_exprs): Initialized additional_tcodes to NULL.
119         (struct inv_list): Moved this to c-family/array-notation-common.c.
120         * c-tree.h (is_cilkplus_builtin_reduce): Remove prototype.
121         
122 2013-06-05  Balaji V. Iyer  <balaji.v.iyer@intel.com>
124         * c-typeck.c (convert_arguments): Moved checking of builtin cilkplus
125         reduction functions outside the for-loop.  Added a check if the fundecl
126         is non-NULL.  Finally, removed an unwanted if-statement, and made the
127         body unconditional.
129 2013-06-03  Balaji V. Iyer  <balaji.v.iyer@intel.com>
131         * c-typeck.c (c_finish_if_stmt): Added a check to see if the rank of the
132         condition of the if-statement matches the rank of else-block and then-
133         block when array notations are used.
134         * c-parser.c (c_parser_declaration_or_fndef): Expanded array notation
135         expression after the entire function body is parsed.
136         (c_parser_expr_no_commas): Delayed creating array notation expressions
137         to the end of function parsing.
138         * c-array-notation.c (fix_conditional_array_notations_1): Expanded the
139         whole if-statement instead of just the condition.
140         (expand_array_notation_exprs): Added MODIFY_EXPR case.  
142 2013-06-03  Balaji V. Iyer  <balaji.v.iyer@intel.com>
144         PR c/57474
145         * c-array-notation.c (build_array_notation_expr): Initialized rhs_length
146         array to NULL_TREE if they are unused.  Also added a check for the
147         field to be NULL before its fields are used in future.
148         
149 2013-05-29  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
151         PR bootstrap/57450
152         * c-array-notation.c (length_mismatch_in_expr_p): Use absu_hwi.
153         (build_array_notation_expr): Likewise.
155 2013-05-28  Balaji V. Iyer  <balaji.v.iyer@intel.com>
157         * c-typeck.c (build_array_ref): Added a check to see if array's
158         index is greater than one.  If true, then emit an error.
159         (build_function_call_vec): Exclude error reporting and checking
160         for builtin array-notation functions.
161         (convert_arguments): Likewise.
162         (c_finish_return): Added a check for array notations as a return
163         expression.  If true, then emit an error.
164         (c_finish_loop): Added a check for array notations in a loop
165         condition.  If true then emit an error.
166         (lvalue_p): Added a ARRAY_NOTATION_REF case.
167         (build_binary_op): Added a check for array notation expr inside
168         op1 and op0.  If present, we call another function to find correct
169         type.
170         * Make-lang.in (C_AND_OBJC_OBJS): Added c-array-notation.o.
171         * c-parser.c (c_parser_compound_statement): Check if array
172         notation code is used in tree, if so, then transform them into
173         appropriate C code.
174         (c_parser_expr_no_commas): Check if array notation is used in LHS
175         or RHS, if so, then build array notation expression instead of
176         regular modify.
177         (c_parser_postfix_expression_after_primary): Added a check for
178         colon(s) after square braces, if so then handle it like an array
179         notation.  Also, break up array notations in unary op if found.
180         (c_parser_direct_declarator_inner): Added a check for array
181         notation.
182         (c_parser_compound_statement): Added a check for array notation in
183         a stmt.  If one is present, then expand array notation expr.
184         (c_parser_if_statement): Likewise.
185         (c_parser_switch_statement): Added a check for array notations in
186         a switch statement's condition.  If true, then output an error.
187         (c_parser_while_statement): Similarly, but for a while.
188         (c_parser_do_statement): Similarly, but for a do-while.
189         (c_parser_for_statement): Similarly, but for a for-loop.
190         (c_parser_unary_expression): Check if array notation is used in a
191         pre-increment or pre-decrement expression.  If true, then expand
192         them.
193         (c_parser_array_notation): New function.
194         * c-array-notation.c: New file.
195         * c-tree.h (is_cilkplus_reduce_builtin): Protoize.
196         
197 2013-05-23  Mike Stump  <mikestump@comcast.net>
199         * c-typeck.c (convert_for_assignment): Handle references to memory
200         spaces better.
202 2013-05-16  Jason Merrill  <jason@redhat.com>
204         * Make-lang.in (cc1$(exeext)): Use link mutex.
206 2013-04-24  Paolo Carlini  <paolo.carlini@oracle.com>
208         * c-typeck.c (pointer_diff): Change -Wpointer-arith pedwarns
209         to simply use OPT_Wpointer_arith.
210         (build_unary_op): Likewise.
212 2013-04-03  Jakub Jelinek  <jakub@redhat.com>
214         PR c/19449
215         * c-parser.c (c_parser_get_builtin_args): Add choose_expr_p
216         argument.  If set, or it temporarily for parsing of the first
217         argument into force_folding_builtin_constant_p.
218         (c_parser_postfix_expression): Adjust callers.
220 2013-03-21  Richard Biener  <rguenther@suse.de>
222         * c-objc-common.c (c_tree_printer): Use DECL_HAS_DEBUG_EXPR_P
223         instead of DECL_DEBUG_EXPR_IS_FROM.  Guard properly.
225 2013-02-12  Marek Polacek  <polacek@redhat.com>
227         PR c/44938
228         * c-parser.c (c_parser_postfix_expression_after_primary): Initialize
229         origtypes to NULL.
231 2013-01-24  Jakub Jelinek  <jakub@redhat.com>
233         PR c/56078
234         * c-typeck.c (set_nonincremental_init_from_string): If
235         constructor_max_index is NULL, treat it as if tree_int_cst_lt
236         returned false.
237         (process_init_element): Likewise.
239 2012-12-20  Jakub Jelinek  <jakub@redhat.com>
241         PR c++/55619
242         * c-parser.c (c_parser_asm_operands): Remove CONVERT_P
243         argument, don't call default_function_array_conversion
244         nor c_fully_fold here.
245         (c_parser_asm_statement): Adjust callers.
246         * c-typeck.c (build_asm_expr): Call c_fully_fold on inputs
247         and outputs here, and call default_function_array_conversion
248         on inputs that don't need to be addressable.
250 2012-12-18  Jakub Jelinek  <jakub@redhat.com>
252         PR c/39464
253         * c-typeck.c (convert_for_assignment): For -Wpointer-sign
254         warning require that both c_common_unsigned_type as well as
255         c_common_signed_type is the same for both mvl and mvr types.
257 2012-11-16  Diego Novillo  <dnovillo@google.com>
259         Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec)
261         * c-common.c: Use new vec API in vec.h.
262         * c-common.h: Likewise.
263         * c-gimplify.c: Likewise.
264         * c-pragma.c: Likewise.
265         * c-pretty-print.c: Likewise.
266         * c-pretty-print.h: Likewise.
267         * c-semantics.c: Likewise.
268         * c-decl.c: Likewise.
269         * c-parser.c: Likewise.
270         * c-tree.h: Likewise.
271         * c-typeck.c: Likewise.
273 2012-10-29  Jonathan Wakely  <jwakely.gcc@gmail.com>
275         PR c++/54930
276         * c-typeck.c (c_finish_return): Use OPT_Wreturn_local_addr.
278 2012-10-29  Manuel López-Ibáñez  <manu@gcc.gnu.org>
280         PR c/53066
281         * c-decl.c (warn_if_shadowing): Do not warn if a variable
282         shadows a function, unless the variable is a function or a
283         pointer-to-function.
285 2012-10-12  Jakub Jelinek  <jakub@redhat.com>
287         PR c/54381
288         * c-parser.c (struct c_tree_loc_pair): Removed.
289         (c_parser_expr_list): Remove struct c_tree_loc_pair * argument,
290         add location_t * and tree * arguments, fill in array of 3
291         sizeof_arg trees and corresponding locs.
292         (c_parser_attributes, c_parser_objc_keywordexpr): Adjust
293         c_parser_expr_list callers.
294         (c_parser_postfix_expression_after_primary): Likewise.  Pass
295         array of 3 sizeof_arg trees and locs (corresponding to first
296         3 arguments) to sizeof_pointer_memaccess_warning.
298 2012-10-09  Lawrence Crowl  <crowl@google.com>
300         * Make-lang.in (c-decl.o): Add dependence on hash-table.h.
301         * c-decl.c (detect_field_duplicates_hash): Change to new type-safe
302         hash table.
304 2012-10-09  Paolo Carlini  <paolo.carlini@oracle.com>
306         PR c++/54194
307         * c-typeck.c (parser_build_binary_op): Update warn_about_parentheses
308         call.
310 2012-10-09  Marc Glisse  <marc.glisse@inria.fr>
312         PR c++/54427
313         * c-typeck.c: Include c-common.h.
314         (enum stv_conv): Moved to c-common.h.
315         (scalar_to_vector): Moved to c-common.c.
316         (build_binary_op): Adapt to scalar_to_vector's new prototype.
317         * Make-lang.in: c-typeck.c depends on c-common.h.
319 2012-10-04  Arnaud Charlet  <charlet@adacore.com>
321         * c-decl.c (c_write_global_declarations): Fix handling of
322         -fdump-ada-spec*.
324 2012-09-30  Sharad Singhai  <singhai@google.com>
326         * c-decl.c (c_write_global_declarations): Use a different method
327         to determine if the dump has ben initialized.
329 2012-09-14  Joseph Myers  <joseph@codesourcery.com>
331         PR c/54552
332         * c-typeck.c (c_cast_expr): When casting to a type requiring
333         C_MAYBE_CONST_EXPR to be created, pass the inner expression to
334         c_fully_fold first.
336 2012-09-14  Joseph Myers  <joseph@codesourcery.com>
338         PR c/54103
339         * c-typeck.c (build_unary_op): Pass original argument of
340         TRUTH_NOT_EXPR to c_objc_common_truthvalue_conversion, then remove
341         any C_MAYBE_CONST_EXPR, if it has integer operands.
342         (build_binary_op): Pass original arguments of TRUTH_ANDIF_EXPR,
343         TRUTH_ORIF_EXPR, TRUTH_AND_EXPR, TRUTH_OR_EXPR and TRUTH_XOR_EXPR
344         to c_objc_common_truthvalue_conversion, then remove any
345         C_MAYBE_CONST_EXPR, if they have integer operands.  Use
346         c_objc_common_truthvalue_conversion not
347         c_common_truthvalue_conversion.
348         (c_objc_common_truthvalue_conversion): Build NE_EXPR directly and
349         call note_integer_operands for arguments with integer operands
350         that are not integer constants.
352 2012-09-13  Jakub Jelinek  <jakub@redhat.com>
354         PR c/54559
355         * c-typeck.c (c_finish_return): Do convert to BOOLEAN_TYPE or
356         COMPLEX_TYPE with in_late_binary_op set temporarily to true.
358 2012-08-31  Jakub Jelinek  <jakub@redhat.com>
360         PR c/54428
361         * c-convert.c (convert): Don't call fold_convert_loc if
362         TYPE_MAIN_VARIANT of a COMPLEX_TYPE is the same, unless e
363         is a COMPLEX_EXPR.  Remove TYPE_MAIN_VARIANT check from
364         COMPLEX_TYPE -> COMPLEX_TYPE conversion.
366 2012-08-24  Jakub Jelinek  <jakub@redhat.com>
368         PR c/54355
369         * c-decl.c (c_parser_label): Pass true as nested and fix up comments
370         for nested and empty_ok arguments in the call to
371         c_parser_declaration_or_fndef.
373 2012-08-17  Jakub Jelinek  <jakub@redhat.com>
375         * c-tree.h (c_last_sizeof_arg): Declare.
376         * c-parser.c (struct c_tree_loc_pair): New type.
377         (c_parser_expr_list): Add sizeof_arg argument.  Fill it in if
378         non-NULL.
379         (c_parser_attributes, c_parser_objc_keywordexpr): Adjust callers.
380         (c_parser_postfix_expression_after_primary): Likewise.  Call
381         sizeof_pointer_memaccess_warning if needed.
382         (sizeof_ptr_memacc_comptypes): New function.
383         * c-typeck.c (c_last_sizeof_arg): New global variable.
384         (c_expr_sizeof_expr, c_expr_sizeof_type): Initialize it.
386 2012-07-24  Uros Bizjak  <ubizjak@gmail.com>
388         * c-lang.h (lang_decl): Add variable_size GTY option.
390 2012-07-16  Steven Bosscher  <steven@gcc.gnu.org>
392         * c-decl.c: Include dumpfile.h instead of tree-dump.h.
393         * Make-lang.in: Fix dependencies.
395 2012-06-29  Steven Bosscher  <steven@gcc.gnu.org>
397         * Make-lang.in: New file, rules migrated from gcc/Makefile.in
398         and add language Makefile hooks.
399         * config-lang.in: New file.
400         * c-config-lang.in: Moved from gcc/config-lang.in to here, and
401         add the required "normal" config-lang.in rules.
402         * c-lang.h: Moved from gcc/ to here.
403         * c-tree.h: Likewise.
404         * c-objc-common.c: Likewise.
405         * c-objc-common.h: Likewise.
406         * c-typeck.c: Likewise.
407         * c-convert.c: Likewise.
408         * c-lang.c: Likewise.
409         * c-aux-info.c: Likewise.
410         * c-errors.c: Likewise.
411         * gccspec.c: Likewise.
412         * c-decl.c: Likewise.  Include gt-c-c-decl.h, not gt-c-decl.h.
413         * c-parser.c: Likewise.  Include gt-c-c-parser.h, not gt-c-parser.h.
415 Copyright (C) 2012-2013 Free Software Foundation, Inc.
417 Copying and distribution of this file, with or without modification,
418 are permitted in any medium without royalty provided the copyright
419 notice and this notice are preserved.