Commit Graph

286 Commits

Author SHA1 Message Date
Nathan Sidwell
d739a3bc88 c-typeck.c (process_init_element): Detect excess elements in char array initializer.
* c-typeck.c (process_init_element): Detect excess elements in
	char array initializer.

From-SVN: r27507
1999-06-14 02:40:16 +00:00
Craig Burley
ea0f786baf Handle ERROR_MARK input
From-SVN: r26848
1999-05-09 15:56:58 -04:00
Kaveh R. Ghazi
5d5993dd31 bitmap.c (bitmap_print): Qualify a char* with the `const' keyword.
* bitmap.c (bitmap_print): Qualify a char* with the `const' keyword.
        * bitmap.h (bitmap_print): Likewise.
        * c-decl.c (builtin_function, grokdeclarator, grokfield): Likewise.
        * c-lang.c (build_objc_string): Likewise.
        * c-lex.c (yyerror, extend_token_buffer): Likewise.  Don't include
        limits.h or ctype.h.  Remove unused variable `p'.
        * c-lex.h (yyerror): Qualify a char* with the `const' keyword.
        * c-pragma.c (handle_pragma_token): Likewise.
        * c-pragma.h (handle_pragma_token): Likewise.
        * c-tree.h (build_objc_string, builtin_function, grokfield,
        build_indirect_ref, lvalue_or_else, readonly_warning, error_init,
        pedwarn_init): Likewise.
        * c-typeck.c (convert_for_assignment, warn_for_assignment,
        push_string, warning_init, incomplete_type_error,
        build_indirect_ref, lvalue_or_else, readonly_warning,
        build_c_cast, spelling, push_member_name, print_spelling,
        error_init, pedwarn_init, start_init): Likewise.
        * objc/objc-act.c (build_objc_string): Likewise.
        * print-tree.c (print_node_brief, print_node): Likewise.
        * tree.h (lvalue_or_else, print_node, print_node_brief): Likewise.

From-SVN: r25296
1999-02-18 20:38:48 +00:00
Vladimir N. Makarov
43f7bed538 c-typeck.c (check_init_type_bitfields): Use nonincremental initialization of unions whose first member is a bitfield.
Mon Feb  9 18:57:45 1999  Vladimir N. Makarov  <vmakarov@cygnus.com>
	* c-typeck.c (check_init_type_bitfields): Use nonincremental
	initialization of unions whose first member is a bitfield.
        Remove unnecessary code for checking the declaration mode
        after DECL_C_BIT_FIELD.
	* varasm.c (output_constructor): Additional comment about the
 	constructor of bitfield union initialization.

From-SVN: r25093
1999-02-08 16:00:46 +00:00
Jeffrey A Law
ab87f8c8d1 Merge in gcc2 snapshot 19980929. See gcc/ChangeLog and gcc/FSFChangeLog for
details.

From-SVN: r24879
1999-01-26 18:43:17 -07:00
Jason Merrill
b58c9a790a * c-typeck.c (convert_for_assignment): Parenthesize.
From-SVN: r23386
1998-10-27 20:39:54 -05:00
Mark Mitchell
3932261a55 invoke.texi: Document -flang-isoc9x.
* invoke.texi: Document -flang-isoc9x.
	* Makefile.in (OBJS): Add splay-tree.o.
	(c-common.o): Depend on rtl.h.
	(splay-tree.o): List dependencies and provide build rule.
	* rtl.h (record_alias_subset): New function.
	* alias.c: Include splay-tree.h.
	(alias_set_entry): New type.
	(CHECK_ALIAS_SETS_FOR_CONSISTENCY): Remove.
	(DIFFERENT_ALIAS_SETS_P): Use mem_in_disjoint_alias_sets_p.
	(mems_in_disjoin_alias_sets_p): New function.
	(alias_set_compare): Likewise.
	(insert_subset_children): Likewise.
	(get_alias_set_entry): Likewise.
	* tree.h (TYPE_RESTRICT): New macro.
	(TYPE_UNQUALIFIED): New manifest constant.
	(TYPE_QUAL_CONST): Likewise
	(TYPE_QUAL_VOLATILE): Likewise.
	(TYPE_QUAL_RESTRICT): Likewise.
	(tree_type): Add restrict_flag.  Reduce count of free bits.
	(DECL_POINTER_ALIAS_SET): New macro.
	(DECL_POINTER_ALIAS_SET_KNOWN_P): Likewise.
	(tree_decl): Add pointer_alias_set.
	(build_qualified_type): New function.
	(build_type_variant): Define in terms of build_qualified_type.
	* tree.c (set_type_quals): New function.
	(make_node): Initializae DECL_POINTER_ALIAS_SET.
	(build_type_attribute_variant): Use build_qualified_type and
	set_type_quals.
	(build_type_variant): Rename, and modify, to become...
	(build_qualified_type): New function.
	(build_complex_type): Use set_type_quals.
	* c-tree.h (C_TYPE_OBJECT_P): New macro.
	(C_TYPE_FUNCTION_P): Likewise.
	(C_TYPE_INCOMPLETE_P): Likewise.
	(C_TYPE_OBJECT_OR_INCOMPLETE_P): Likewise.
	(c_apply_type_quals_to_decl): New function.
	(c_build_qualified_type): New function.
	(c_build_type_variant): Define in terms of c_build_qualified_type.
	(flag_isoc9x): Declare.
	* c-typeck.c (qualify_type): Use c_build_qualified_type.
	(common_type): Change to use TYPE_QUALS.
	(comptypes): Likewise.
	(convert_for_assignment): Likewise.
	* c-aux-info.c (gen_type): Likewise.  Deal with `restrict'.
	* c-decl.c (flag_isoc9x): Define.
	(c_decode_option): Handle -flang-isoc9x.
	(grokdeclarator): Update to handle restrict.  Use TYPE_QUALS,
	c_build_qualified_type, etc.  Use c_apply_type_quals_to_decl.
	* c-lex.c (init_lex): Deal with restrict.
	(init_lex): Don't treat restrict as a reserved word in
	-traditional mode, or without -flang-isoc9x.
	* c-lex.h (rid): Add RID_RESTRICT.
	* c-parse.gperf (restrict, __restrict, __restrict__): Make
	equivalent to RID_RESTRICT.
	* c-parse.in (TYPE_QUAL): Update comment.
	* c-common.c: Include rtl.h.
	(c_find_base_decl): New function.
	(c_build_type_variant): Rename, and modify, to become ...
	(c_build_qualified_type): New function.
	(c_apply_type_quals_to_decl): Likewise.
	(c_get_alias_set): For INDIRECT_REFs, check to see if we can find
	a particular alias set for the reference.
	* toplev.c (documented_lang_options): Add -flang-isoc9x.

From-SVN: r23212
1998-10-21 09:53:40 +00:00
Jason Merrill
0d906a5f36 c-typeck.c (initializer_constant_valid_p): Allow conversion of 0 of any size to a pointer.
* c-typeck.c (initializer_constant_valid_p): Allow conversion of 0
	of any size to a pointer.

From-SVN: r21697
1998-08-13 11:26:46 -04:00
Bruno Haible
9dfcc8db5b c-typeck.c (pop_init_level): Warn about implicit zero initialization of struct members.
* c-typeck.c (pop_init_level): Warn about implicit zero initialization
        of struct members.

From-SVN: r20614
1998-06-19 16:27:35 -06:00
H.J. Lu
f5a8bfff50 c-typeck.c (c_expand_asm_operands): Use proper values when calling expand_expr..
* c-typeck.c (c_expand_asm_operands): Use proper values when calling
        expand_expr..

From-SVN: r20605
1998-06-19 15:49:26 -06:00
Jeff Law
38e012594e typo typo fixes fixes
From-SVN: r19601
1998-05-06 15:09:07 -06:00
Robert Lipe
5f6da3024b toplev.h: New file.
Wed May  6 06:35:38 1998  Robert Lipe  <robertl@dgii.com>
        * toplev.h: New file.   Protypes for functions in toplev.c.
        * tree.h, rtl.h: Deleted protos for functions in toplev.c.
        * c-common.c, c-convert.c, c-decl.c, c-iterate.c, c-lex.c,
        c-parse.in, c-parse.y, c-pragma.c, c-typeck.c, calls.c,
        convert.c, dwarf2out.c, except.c, expr.c, final.c, fold-const.c,
        function.c, hash.c, profile.c, real.c, reg-stack.c, regclass.c,
        reload.c, reload1.c, stmt.c, stor-layout.c, tlink.c, tree.c,
        varasm.c: include it.

From-SVN: r19563
1998-05-06 04:45:47 +00:00
Jeff Law
f5963e6170 * Check in merge from gcc2. See ChangeLog.12 for details.
From-SVN: r19553
1998-05-05 17:18:02 -06:00
Jeff Law
e5e809f419 * Check in merge from gcc2. See ChangeLog.11 and ChangeLog.12
for details.

        * haifa-sched.c: Mirror recent changes from gcc2.

From-SVN: r18984
1998-04-04 06:32:39 -07:00
Jeffrey A Law
234042f471 Makefile.in (c-typeck.o): Delete on expr.h, insn-codes.h and $(RTL_H).
* Makefile.in (c-typeck.o): Delete on expr.h, insn-codes.h and
        $(RTL_H).
        (stor-layout.o): Likewise.
        * c-typeck.c: Include rtl.h and expr.h.
        * stor-layout.c: Likewise.

From-SVN: r18894
1998-03-29 04:54:09 -07:00
Kaveh R. Ghazi
670ee92097 Major cutover to using system.h:
* Makefile.in (alias.o, bitmap.o, c-aux-info.o, c-common.o,
        c-decl.o, c-iterate.o, c-lang.o, c-lex.o, c-pragma.o, c-typeck.o,
        caller-save.o, calls.o, collect2.o, combine.o, cse.o, dbxout.o,
        dwarf2out.o, dwarfout.o, emit-rtl.o, except.o, explow.o, expmed.o,
        expr.o, final.o, flow.o, function.o, getpwd.o, global.o,
        integrate.o, jump.o, local-alloc.o, loop.o, optabs.o, pexecute.o,
        prefix.o, print-rtl.o, print-tree.o, profile.o, real.o, recog.o,
        reg-stack.o, regclass.o, regmove.o, reload.o, reload1.o, reorg.o,
        rtl.o, rtlanal.o, sdbout.o, stmt.o, stor-layout.o, stupid.o,
        tlink.o, toplev.o, tree.o, unroll.o, varasm.o, xcoffout.o): Depend
        on system.h.
        * alias.c, bitmap.c, c-aux-info.c, c-common.c, c-decl.c,
        c-iterate.c, c-lang.c, c-lex.c, c-pragma.c, c-typeck.c,
        caller-save.c, calls.c, collect2.c, combine.c, cse.c, dbxout.c,
        dwarf2out.c, dwarfout.c, emit-rtl.c, except.c, explow.c, expmed.c,
        expr.c, final.c, flow.c, function.c, gcc.c, getpwd.c, global.c,
        integrate.c, jump.c, local-alloc.c, loop.c, optabs.c, pexecute.c,
        prefix.c, print-rtl.c, print-tree.c, profile.c, real.c, recog.c,
        reg-stack.c, regclass.c, regmove.c, reload.c, reload1.c, reorg.c,
        rtl.c, rtlanal.c, sched.c, sdbout.c, stmt.c, stor-layout.c,
        stupid.c, tlink.c, toplev.c, tree.c, unroll.c, varasm.c,
        xcoffout.c: Include system.h.  Organize include ordering so
        that stdarg/varargs comes before other system headers.  Remove
        spurious casts of functions assured of a prototype in system.h.

From-SVN: r18726
1998-03-20 14:58:42 +00:00
Brendan Kehoe
d9525bec09 tree.h (merge_machine_{type,decl}_attributes): Declare.
./ChangeLog:	* tree.h (merge_machine_{type,decl}_attributes): Declare.
	(split_specs_attrs, strip_attrs): Add prototypes.
	* tree.c (merge_machine_{type,decl}_attributes): New functions.
	* c-decl.c (duplicate_decls): Call merge_machine_decl_attributes.
	Update olddecl's attributes too.
	* c-common.c (strip_attrs): New function.
	* c-typeck.c (common_type): Call merge_machine_type_attributes.
	* varasm.c (make_function_rtl): New target macro REDO_SECTION_INFO_P.
	(make_decl_rtl): Likewise.
	* c-decl.c (shadow_tag_warned): Call split_specs_attrs.
./cp/ChangeLog:	* decl.c (duplicate_decls): Call merge_machine_decl_attributes.
	Update olddecl's attributes too.
	(strip_attrs): Remove function.
	* typeck.c (common_type): Call merge_machine_type_attributes.

From-SVN: r18065
1998-02-18 05:38:57 -05:00
J"orn Rennecke
f8dac6eb3f expr.c (get_inner_reference): Use sbitsizetype for type sizes.
* expr.c (get_inner_reference): Use sbitsizetype for type sizes.
        * fold-const.c (size_int): Replace with
        (size_int_wide).
        (make_bit_field_ref): Use bitsize_int for bit position.
        * stor-layout.c (sizetype): Delete.
        (sizetype_tab, sbitsizetype, ubitsizetype): Declare.
        (layout_record, layout_union, layout_type):
        Use bitsize_int for bit size.
        (set_sizetype): New function.
        (make_signed_type, make_unsigned_type): Use it.
        * c-decl.c (init_decl_processing): Likewise.
        * tree.h (size_int): Don't delcare, #define.
        (size_int_wide, sizetype_tab, sbitsize, ubitsize): Declare.
        (set_sizetype): Declare.
        (bitsize_int, size_int_2, BITS_PER_UNIT_LOG, sizetype, bitsizetype):
        Define.
        * c-typeck.c (c_sizeof, c_sizeof_nowarn, c_size_in_bytes):
        Convert result to sizetype.
        (really_start_incremental_init, push_init_level):
        Set type of constructor_bit_index to sbitsizetype.
        (push_init_level): Use unsigned arithmetic to determine padding.
        (output_init_element): Likewise.

From-SVN: r17577
1998-02-01 04:47:59 -07:00
Jeff Law
a4fc4b2d12 Update copyrights.
From-SVN: r17348
1998-01-13 14:42:33 -07:00
Richard Henderson
8d47dfc57f * c-typeck.c (comptypes): Exit early on NULL input.
From-SVN: r17347
1998-01-13 14:40:27 -07:00
Kaveh R. Ghazi
1d300e19b6 bitmap.c (bitmap_clear): Ensure `inline' is at the beginning of the declaration.
* bitmap.c (bitmap_clear): Ensure `inline' is at the beginning
        of the declaration.
        * c-decl.c (finish_decl): Use parentheses around && within ||.
        * rtl.c: Include stdlib.h.
        (read_skip_spaces): Add parentheses around assignments used as
        truth values.
        (read_rtx): Initialize list_rtx.
        * cppexp.c (parse_number): Use || when operands are truth values.
        * alias.c (find_base_value): Add default case.
        (memrefs_conflict): Likewise.
        * combine.c (sets_function_arg_p): Likewise.
        * genemit.c (gen_exp): Likewise.
        * local-alloc.c (contains_replace_regs): Likewise.
        * rtlanal.c (jmp_uses_reg_or_mem): Likewise.
        * fold-const.c (fold_convert): Use "&&" for truth values.
        (fold): Add default case.
        * sdbout.c (sdbout_field_types): Fix typo in declaration.
        (sdbout_one_type): Add default case.
        * alpha.c (alpha_sa_mask): Prototype only if OPEN_VMS.
        (some_operand): Add default case.
        (input_operand): Likewise.
        (signed_comparison_operator): Likewise.
        (divmod_operator): Likewise.
        (alpha_set_memflags_1): Likewise.
        * reload1.c (reload_cse_simplify_operands): Ensure function
        always returns a value.
        * scan-decls.c (scan_decls): Likewise.
        * c-lex.c (skip_white_space): Fix typo in declaraion.
        * c-typeck.c (comp_target_types): Add parentheses around assignment
        used as truth value.
        (print_spelling): Likewise.
        (constructor_implicit, constructor_result): Remove unused variables.
        * collect2.c (scan_library): Protect prototype with
        #ifdef SCAN_LIBRARIES.
        * emit-rtl.c (find_line_note): Fix typo in declaration.
        * final.c (asm_insn_count): Protect prototype with
        #ifdef HAVE_ATTR_length.
        * flow.c (find_auto_inc): Protect prototype with #ifdef AUTO_INC_DEC.
        (try_pre_increment_1, try_pre_increment): Likewise.
        * regclass.c (auto_inc_dec_reg_p): Protect prototype with
        #ifdef FORBIDDEN_INC_DEC_CLASSES.  Make return type explicit.
        * gcov-io.h (__store_long, __write_long, __read_long): Fix
        unsigned/signed comparisons.
        * gcov.c (read_files): Remove unused "first_type" variable.
        (scan _for_source_files): Initialize s_ptr.
        (function_summary): Eliminate "%lf" formatting, use %ld for
        longs.
        (output_data): Initialize branch_probs and last_line_num.
        Eliminate "%lf" formatting, use "%ld" for longs.

Co-Authored-By: Jeffrey A Law <law@cygnus.com>

From-SVN: r17158
1997-12-20 04:31:54 -07:00
Jeff Law
956d69504d Merge from gcc-2.8
From-SVN: r16987
1997-12-06 17:31:01 -07:00
Jeff Law
e9a25f70a0 Update mainline egcs to gcc2 snapshot 971021.
From-SVN: r16278
1997-11-02 14:19:36 -07:00
Paul Eggert
407cb092e3 c-typeck.c (build_binary_op): Warn about comparing signed vs unsigned if...
* c-typeck.c (build_binary_op): Warn about comparing signed vs
        unsigned if -W is specified and -Wno-sign-compare is not.
        * c-decl.c (warn_sign_compare): Initialize to -1.
        (c_decode_option): -Wall no longer implies -Wsign-compare.

From-SVN: r15739
1997-09-26 21:46:35 -06:00
Richard Kenner
cff9c40790 (lvalue_p, case BIND_EXPR, RTL_EXPR): Return 1 if array.
From-SVN: r14626
1997-08-02 14:15:29 -04:00
Richard Kenner
a68b98cf6d (lookup_field): Don't recurse unless FIELD is a RECORD_TYPE or
UNION_TYPE.

From-SVN: r13870
1997-04-13 10:59:54 -04:00
Richard Kenner
ee2990e780 (process_init_element): Warn and truncate if upper bound of index is
out of range.

From-SVN: r13684
1997-03-02 13:25:40 -05:00
Richard Kenner
ec0bc8b600 (process_init_element): When popping levels, don't blow up if
constructor_max_index not set due to previous error.

From-SVN: r13582
1997-02-02 08:07:46 -05:00
Richard Kenner
bd5b5c8584 (build_indirect_ref): Don't give warning for dereferencing void * if
evaluation is being skipped.

From-SVN: r13235
1996-12-07 17:53:42 -05:00
Richard Kenner
47ee683790 (build_binary_op): Likewise.
(build_conditional_expr): op1 now always nonnull.

From-SVN: r13234
1996-12-07 17:51:45 -05:00
Richard Kenner
3c9675679a (signed_or_unsigned_type): If already right signedness, return.
From-SVN: r13055
1996-10-28 17:17:00 -05:00
Richard Kenner
f63f07520b ({un,}signed_type): If can't do anything, call
signed_or_unsigned_type.

From-SVN: r13051
1996-10-28 13:08:38 -05:00
Richard Kenner
aed1145228 (build_array_ref): If -Wchar-subscripts, also warn in case when
pointer is being indexed.

From-SVN: r12983
1996-10-21 07:59:10 -04:00
Doug Evans
a7c1916aea (decl_constant_value): Delete test for ! TREE_PUBLIC.
From-SVN: r12916
1996-10-08 20:01:15 +00:00
Michael Meissner
0404429725 Allow pointers to be short
From-SVN: r12855
1996-09-29 16:42:27 +00:00
Mike Stump
0f41302f47 formatting tweaks
From-SVN: r12390
1996-07-03 22:07:53 +00:00
Richard Kenner
9753f11368 (default_conversion): Add bitfield promotions.
From-SVN: r12389
1996-07-03 17:34:57 -04:00
Richard Kenner
489af5d14b (pointer_int_sum): Convert integer to both signedness and precision of
sizetype.

From-SVN: r12291
1996-06-18 06:32:43 -04:00
Jim Wilson
bdc49177fd (push_init_level): When output alignment for structure
field, add check to verify it is the next field to be output.

From-SVN: r11667
1996-04-04 09:46:09 -08:00
Richard Kenner
7b1d6e6e16 (set_init_index): Check for use outside an array initializer.
From-SVN: r11607
1996-03-23 19:52:37 -05:00
Richard Kenner
004252d713 (build_array_ref): Give error if subscripting a function.
From-SVN: r11598
1996-03-23 07:07:23 -05:00
Richard Kenner
4d4f21f36f (build_conditional_expr): If OP1 is null, set both OP1 and ORIG_OP1 to IFEXP.
From-SVN: r11558
1996-03-18 19:42:40 -05:00
Jim Wilson
24c032e981 (push_init_level): When output padding to align structure
field, set constructor_unfilled_fields.

From-SVN: r11391
1996-02-29 17:46:19 -08:00
Jeff Law
d6d22108ac c-typeck.c (initializer_constant_valid_p): Don't dereference a null pointer on partial structure initialization.
* c-typeck.c (initializer_constant_valid_p): Don't dereference
        a null pointer on partial structure initialization.

From-SVN: r11333
1996-02-21 10:44:20 -07:00
Jason Merrill
4ae27eb62f warn_sign_compare
From-SVN: r11299
1996-02-19 10:32:37 +00:00
Paul Eggert
7e842ef8c5 c-typeck.c (convert_for_assignment): Bring back conversion to union without a cast...
* c-typeck.c (convert_for_assignment):
Bring back conversion to union without a cast,
undoing the Jan 16 change, but with the following differences:

* The union must have the transparent_union attribute.
* The conversion must be for a function argument.
* Warn consistently about such conversions if pedantic.
* Do not warn about an assignment incompatibility for one union member
  if another union member is compatible with no warning.

From-SVN: r11290
1996-02-16 20:13:23 +00:00
Richard Kenner
9f6de2b92d (quality_type prototype): Typo, rename as qualify_type.
(build_binary_op): Fix precedence error.

From-SVN: r11250
1996-02-13 08:13:14 -05:00
Jim Wilson
b200d1aa65 (pointer_int_sum): Use TYPE_PRECISION (sizetype) not
POINTER_SIZE to agree with expr.c.

From-SVN: r11088
1996-01-24 11:31:38 -08:00
Richard Kenner
8ef376a9b5 (convert_for_assignment): Don't automatically convert from a union
member to the union.

From-SVN: r11015
1996-01-16 07:05:47 -05:00
Richard Kenner
ec9aa89501 (build_c_cast): Don't warn about alignment when we have an opaque type.
From-SVN: r10982
1996-01-15 07:36:59 -05:00