Commit Graph

85 Commits

Author SHA1 Message Date
Richard Henderson
27922c1362 machmode.h (smallest_mode_for_size): Prototype.
* machmode.h (smallest_mode_for_size): Prototype.
        * stor-layout.c (smallest_mode_for_size): Remove static.

From-SVN: r25703
1999-03-11 05:56:20 -08:00
Vladimir N. Makarov
0003feb203 varasm.c (output_constant_pool): Use floor_log2 instead of exact_log2 for ASM_OUTPUT_ALIGN.
Thu Jan 21 14:13:31 1999  Vladimir N. Makarov  <vmakarov@cygnus.com>
        * varasm.c (output_constant_pool): Use floor_log2 instead of
	exact_log2 for ASM_OUTPUT_ALIGN.
	* stor-layout.c (layout_type): Do machine-dependent extra alignment.
	* emit-rtl.c (operand_subword): Handle case when a subword outside
	the operand.
	* tm.texi (ROUND_TYPE_{SIZE,ALIGN}): More accurate descriptions of
	the macros.

From-SVN: r24800
1999-01-21 11:20:09 +00:00
Kaveh R. Ghazi
973838fdb3 Warning fixes:
* alias.c (record_alias_subset): Remove ignored `&'.
        (init_alias_once): Likewise.
        * c-lex.c (UNGETC): Cast first argument of comma expression to void.
        * config/mips/mips.c (mips_asm_file_end): Cast the result of
        fwrite to `int' when comparing against one.
        * config/mips/mips.h (CAN_ELIMINATE): Add parens around && within ||.
        (INITIAL_ELIMINATION_OFFSET): Add braces to avoid ambiguous `else'.
        * cse.c (rehash_using_reg): Change type of variable `i' to
        unsigned int.
        * dwarf2out.c (initial_return_save): Cast -1 to unsigned before
        assigning it to one.
        * except.c (duplicate_eh_handlers): Remove unused variable `tmp'.
        * final.c (final_scan_insn): Likewise for variable `i'.
        (output_asm_insn): Cast a char to unsigned char when used as an
        array index.
        * gcse.c (compute_pre_ppinout): Cast -1 to SBITMAP_ELT_TYPE when
        assigning it to one.
        * loop.c (strength_reduce): Remove unused variables `count' and `temp'.
        * recog.c (preprocess_constraints): Cast a char to unsigned char
        when used as an array index.
        * regmove.c (find_matches): Likewise.
        * reload1.c (calculate_needs): Add default case in switch.
        (eliminate_regs_in_insn): Initialize variable `offset'.
        (set_offsets_for_label): Change type of variable `i' to unsigned.
        (reload_as_needed): Wrap variable `i' in macro check on
        AUTO_INC_DEC || INSN_CLOBBERS_REGNO_P.
        * scan-decls.c (scan_decls): Mark parameters `argc' and `argv'
        with ATTRIBUTE_UNUSED.  Cast variable `start_written' to size_t
        when comparing against one.
        * stor-layout.c (layout_decl): Cast maximum_field_alignment to
        unsigned when comparing against one.  Likewise for
        GET_MODE_ALIGNMENT().
        (layout_record): Cast record_align to int when comparing against a
        signed value.
        (layout_type): Cast TYPE_ALIGN() to int when comparing against a
        signed value.
        * tree.c (get_identifier): Cast variable `len' to unsigned when
        comparing against one.
        (maybe_get_identifier): Likewise

From-SVN: r24403
1998-12-23 07:09:01 +00:00
Kaveh R. Ghazi
c84e271261 Warning fixes:
* Makefile.in (gencheck.o): Depend on gansidecl.h.
	* c-common.c (print_char_table): Add missing initializers.
	(scan_char_table): Likewise.
	(time_char_table): Likewise.
	* c-decl.c (c_decode_option): Mark parameter `argc' with
	ATTRIBUTE_UNUSED.
	(declare_parm_level): Mark parameter `definition_flag' with
	ATTRIBUTE_UNUSED.
	* c-lex.c (readescape): Use `(unsigned)1' in shift.
	(yylex): Likewise.  Cast `sizeof' to an (int) when comparing
	against one.
	* calls.c (store_one_arg): Remove unused parameter `fndecl'.  All
	callers changed.
	(emit_call_1): Mark parameters `fndecl' and `funtype' with
	ATTRIBUTE_UNUSED.
	(expand_call): Cast result of MIN() to (unsigned int) when
	comparing against an unsigned value.
	* cccp.c (pcfinclude): Remove unused parameter `limit'.  All
	callers changed.
	(make_definition): Remove unused parameter `op'.  All callers
	changed.
	(create_definition): Cast REST_EXTENSION_LENGTH to (long) when
	comparing against the result of pointer arithmetic.
	* config/mips/mips.h (FUNCTION_ARG_BOUNDARY): Cast to (unsigned)
	when comparing against one.
	* dwarf2out.c (dwarf2out_frame_debug): Cast REGNO() and
 	HARD_FRAME_POINTER_REGNUM to (unsigned) when comparing against
 	one.
	(output_die): Move variable `i' into the scope in which it is
	used.  Change its type to `unsigned'.
	(output_die): Cast the result of `strlen' to (int) when passing it
	to ASM_OUTPUT_ASCII().
	(output_pubnames): Likewise.
	(output_line_info): Likewise.
	* emit-rtl.c (global_rtl): Add missing initializers.
	* explow.c (promote_mode): Mark parameter `for_call' with
	ATTRIBUTE_UNUSED.
	* expmed.c (expand_shift): Cast the result of GET_MODE_BITSIZE to
 	`unsigned HOST_WIDE_INT' when comparing against one.
	(synth_mult): Change type of variable `cost' to int.
	(emit_store_flag): Use `(unsigned HOST_WIDE_INT) 1' in shift.
	* expr.c (copy_blkmode_from_reg): Cast BITS_PER_WORD to (unsigned)
	when comparing against one.
	(get_inner_reference): Change variable `alignment' to unsigned.
	(expand_expr): Cast the result of GET_MODE_ALIGNMENT to (unsigned
	int) when comparing against one.
	(expand_builtin_setjmp): Change type of variable `i' to size_t.
	* fold-const.c (div_and_round_double): Cast BASE to
	(HOST_WIDE_INT) when comparing against one.
	* gencheck.c: Include gansidecl.h.
	(main): Mark parameter `argv' with ATTRIBUTE_UNUSED.
	* optabs.c (gen_cond_trap): Mark parameters `code', `op2' and
	`tcode' with ATTRIBUTE_UNUSED.
	* real.c (edivm): Cast constant value to (unsigned long) in
	expression compared against an unsigned value.
	* stmt.c (expand_return): Cast BITS_PER_WORD to (unsigned) when
	comparing against one.
	(expand_end_case): Cast CASE_VALUES_THRESHOLD to (unsigned int)
	when comparing against one.
	* stor-layout.c (mode_for_size): Cast MAX_FIXED_MODE_SIZE to
	(unsigned int) when comparing against one.  Likewise for
	GET_MODE_BITSIZE.
	(smallest_mode_for_size): Likewise.
	(save_storage_status): Mark parameter `p' with ATTRIBUTE_UNUSED.
	(restore_storage_status): Likewise.
	* toplev.c (debug_args): Add missing initializer.
	(f_options): Spelling correction.  Add missing initializers.
	(documented_lang_options): Likewise.
	(debug_end_source_file): Mark parameter `lineno' with
	ATTRIBUTE_UNUSED.
	* tree.c (valid_machine_attribute): Mark parameters `attr_args',
	`decl' and `type' with ATTRIBUTE_UNUSED.
	* varasm.c (decode_reg_name): Cast `sizeof' expression to (int)
	when comparing against one.
	(assemble_variable): Mark parameter `top_level' with
	ATTRIBUTE_UNUSED.
	(assemble_external_libcall): Mark parameter `fun' with
	ATTRIBUTE_UNUSED.
	(output_constant_pool): Mark parameters `fnname' and `fndecl' with
	ATTRIBUTE_UNUSED.

From-SVN: r23054
1998-10-13 15:25:25 +00:00
Richard Henderson
d006aa54ba expmed.c (store_bit_field): Pun non-integral str_rtx modes.
* expmed.c (store_bit_field): Pun non-integral str_rtx modes.
        Take extra care for op0 now possibly being a subreg.
        (extract_bit_field): Likewise.
        * function.c (purge_addressof_1): Revert Oct 4 change.  Drop
        the reg to memory if there is no equal sized integral mode.
        * stor-layout.c (int_mode_for_mode): New function.
        * machmode.h: Prototype it.

From-SVN: r22962
1998-10-09 08:50:25 -07:00
Dave Brolley
7771032e79 stor-layout.c (layout_type): Compute TYPE_SIZE_UNIT correctly for arrays of bits.
Thu Aug 20 13:15:11 1998  Dave Brolley  <brolley@cygnus.com>
	* stor-layout.c (layout_type): Compute TYPE_SIZE_UNIT correctly for
	arrays of bits.
	* cpplib.c (cpp_define): Handle macros with parameters.

From-SVN: r21872
1998-08-20 06:29:22 -04:00
Dave Brolley
74a4fbfcc8 stor-layout.c (layout_type): Handle arrays of bits, for Chill.
Mon Jul 27 17:18:52 1998  Dave Brolley  <brolley@cygnus.com>
	* stor-layout.c (layout_type): Handle arrays of bits, for Chill.
	* expr.c (get_inner_reference): Handle zero-based, unsigned, array
	index conversion.

From-SVN: r21416
1998-07-27 10:37:00 -04:00
Michael Meissner
d05a5492a5 Make rtx, tree types type correct if the appropriate include files was not included
From-SVN: r20114
1998-05-28 06:47:21 +00:00
Richard Henderson
ead1705900 tree.h (TYPE_SIZE_UNIT): New.
* tree.h (TYPE_SIZE_UNIT): New.
(struct tree_type): Add size_unit member.
* stor-layout.c (layout_type): Initialize it.
* expr.c (get_inner_reference) [ARRAY_REF]: Use it.
* tree.c (size_in_bytes, int_size_in_bytes): Likewise.

From-SVN: r19853
1998-05-18 06:21:14 -07:00
Richard Earnshaw
069b95ce6d stor-layout.c (layout_record): Fix off-by-one error when checking length of the TYPE_BINFO vector.
* stor-layout.c (layout_record): Fix off-by-one error when checking
	length of the TYPE_BINFO vector.

From-SVN: r19850
1998-05-18 08:08:10 -04:00
Jason Merrill
bbc0e64172 tree.h (BINFO_SIZE, [...]): New macros.
* tree.h (BINFO_SIZE, TYPE_BINFO_SIZE): New macros.
	* stor-layout.c (layout_record): Set it.
	* toplev.c (rest_of_compilation): Don't defer nested functions.

From-SVN: r19781
1998-05-15 14:56:11 -04:00
Benjamin Kosnik
c1465d2147 stor-layout.c (set_sizetype): Set TYPE_NAME on bitsizetype.
`
Fri May 15 12:44:57 1998  Benjamin Kosnik  <bkoz@rhino.cygnus.com>
	* stor-layout.c (set_sizetype): Set TYPE_NAME on bitsizetype.
fixes g++/15561

From-SVN: r19777
1998-05-15 12:50:30 +00:00
Robert Lipe
10f0ad3d49 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: r19564
1998-05-06 04:54:01 +00:00
Richard Henderson
896cced482 tree.h (sizetype_tab[2], [...]): Merge all of these into a single struct, with additional [us]sizetype entries.
* tree.h (sizetype_tab[2], sbitsizetype, ubitsizetype): Merge all
of these into a single struct, with additional [us]sizetype entries.
* stor-layout.c (set_sizetype): Initialize [us]sizetype.
* fold-const.c (size_int_wide): Don't rely on sizetype_tab being
an array.

From-SVN: r18994
1998-04-04 09:46:06 -08:00
Jeffrey A Law
4e86caed7d fold-const.c (optimze_bit_field_compare): Initialize rnbitpos, rnbitsize, rnmode and rinner.
* fold-const.c optimze_bit_field_compare): Initialize rnbitpos,
        rnbitsize, rnmode and rinner.
        (make_range): Initialize type.
        (fold): Initialize arg0, arg1 and varop.
        * function.c (instantiate_virtual_regs_1): Initialize offset, regnoi
        and regnor.
        (expand_function_start): Initialize last_ptr.
        * stor-layout.c (layout_record): Initialize desired_align.
        (get_best_mode): Initialize unit.
        * tree.c (copy_node): Initialize length.

From-SVN: r18943
1998-04-01 16:35:51 -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
Richard Henderson
a2d53b285d stor-layout.c (layout_type): Do upper - lower in the native type, so as to properly handle negative indices.
* stor-layout.c (layout_type): Do upper - lower in the native type,
        so as to properly handle negative indices.

From-SVN: r17846
1998-02-10 17:43:32 -07: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
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
Mike Stump
5c19a35643 c-decl.c (start_struct): Ensure that structs with forward declarations are in fact packed when...
* c-decl.c (start_struct): Ensure that structs with forward
        declarations are in fact packed when -fpack-struct is given.

        * stor-layout.c (layout_record): Ignore STRUCTURE_SIZE_BOUNDARY if
        we are packing a structure.  This allows a structure with only
        bytes to be aligned on a byte boundary and have no padding on a
        m68k.

From-SVN: r15939
1997-10-16 15:45:24 -06:00
Jason Merrill
429baef53a x
From-SVN: r14542
1997-07-28 17:42:09 +00:00
Richard Kenner
9a9b232af8 (layout_record, PCC_BITFIELD_TYPE_MATTERS): Round up when calculating
possible end address.

From-SVN: r14326
1997-06-27 10:36:37 -04:00
Mike Stump
db3cf6fb33 reformat a little to match GNU coding standards.
From-SVN: r14024
1997-05-06 23:05:54 +00:00
Richard Kenner
d9d08379df (layout_record, PCC_BITFIELD_TYPE_MATTERS): Fix sign bug in last change.
From-SVN: r13892
1997-04-13 15:20:03 -04:00
Richard Kenner
0b364e61d3 (layout_record...
(layout_record, PCC_BITFIELD_TYPE_MATTERS): Only add padding if a bit
field would otherwise span more units of alignment than its base type.

From-SVN: r13727
1997-03-17 17:13:37 -05:00
Doug Evans
b5fa331476 stor-layout.c (layout_record): Correct test for whether field spans its unit of alignment in case where...
* stor-layout.c (layout_record): Correct test for whether
	field spans its unit of alignment in case where
	field_size == type_align.

From-SVN: r13540
1997-01-21 18:21:05 +00:00
Jason Merrill
a082c85a43 x
From-SVN: r13116
1996-11-09 01:32:56 +00:00
Richard Kenner
1d58084ae0 (layout_record): Treat constant size as variable if it overflows.
From-SVN: r13105
1996-11-07 07:39:55 -05:00
Richard Kenner
505d6e2b92 (layout_record): Use HOST_WIDE_INT for size.
From-SVN: r13078
1996-10-30 15:53:58 -05:00
Richard Kenner
70e7fabe9e (GET_MODE_ALIGNMENT): Delete definition; duplicate.
From-SVN: r13026
1996-10-24 07:41:09 -04:00
Richard Kenner
1fdae49c42 (layout_decl): Don't turn off DECL_BIT_FIELD if DECL's alignment is
less than its type.

From-SVN: r12896
1996-10-04 07:01:47 -04:00
Doug Evans
a5049cf050 (layout_record): Correct overflow test for 0 sized fields.
From-SVN: r12593
1996-08-05 20:53:26 +00:00
Mike Stump
1ef08c6373 install EH code
From-SVN: r12550
1996-07-23 20:09:26 +00:00
Mike Stump
0f41302f47 formatting tweaks
From-SVN: r12390
1996-07-03 22:07:53 +00:00
Richard Kenner
3a369acd31 (layout_decl): Test DECL_PACKED and TYPE_PACKED instead of
flag_pack_struct.

From-SVN: r12141
1996-06-03 07:57:30 -04:00
Richard Kenner
977a7752c7 (layout_decl): Turn off DECL_BIT_FIELD for BLKmode that's properly
aligned and a multiple of a byte.

From-SVN: r11892
1996-04-26 06:38:48 -04:00
Richard Kenner
d42d380a16 (layout_record): Use ADJUST_FIELD_ALIGN to modify alignment of fields
within records.

From-SVN: r11859
1996-04-20 21:22:14 -04:00
Richard Kenner
5bb3d1dded (layout_decl): Don't make a bitfield an integral mode if the mode of
the field type is not MODE_INT.

From-SVN: r11647
1996-03-31 06:18:58 -05:00
Per Bothner
fc69eca06e stor-layout.c (layout_type): Use same code to layout CHAR_TYPE as for INTEGER_TYPE (instead of hard-wiring...
* stor-layout.c (layout_type):  Use same code to layout CHAR_TYPE
as for INTEGER_TYPE (instead of hard-wiring in QImode).

From-SVN: r11177
1996-02-06 12:30:34 -08:00
Richard Kenner
e08e713766 (layout_record): When PCC_BITFIELD_TYPE_MATTERS, compute bitpos using
field_size % type_align instead of field_size.

From-SVN: r10778
1995-12-16 07:35:45 -05:00
Richard Kenner
e24ff97333 (layout_type...
(layout_type, case ARRAY_TYPE): Strip MAX_EXPR from upper bound when
computing length if it just protects against negative length.

From-SVN: r10430
1995-10-03 19:15:52 -04:00
Richard Kenner
1fd7c4ac66 (put_pending_sizes): New function.
From-SVN: r10398
1995-09-25 17:50:02 -04:00
Richard Kenner
abc95ed36d Fix spelling errors.
From-SVN: r10289
1995-08-28 06:54:22 -04:00
Richard Kenner
e9fa0c7c6f Update FSF address.
From-SVN: r9966
1995-06-15 08:29:51 -04:00
Richard Kenner
76ffb3a0be (variable_size): Do nothing if SIZE is constant.
From-SVN: r9925
1995-06-11 13:59:56 -04:00
Richard Kenner
9faa82d8c0 Fix typos in comments.
From-SVN: r9712
1995-05-16 08:39:54 -04:00
Richard Kenner
36427b78ad (layout_type...
(layout_type, case ARRAY_TYPE): Compute length using MAX of length and
zero if sizetype signed and neither bound constant.

From-SVN: r9668
1995-05-12 18:31:57 -04:00
Michael Meissner
566cdc73b6 Add -fpack-struct.
From-SVN: r9275
1995-03-31 14:35:03 +00:00