From 973838fdb39b9e8b41431189af47dcb422b7878b Mon Sep 17 00:00:00 2001 From: "Kaveh R. Ghazi" Date: Wed, 23 Dec 1998 07:09:01 +0000 Subject: 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 --- gcc/stor-layout.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'gcc/stor-layout.c') diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index a947447..1379811 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -283,7 +283,8 @@ layout_decl (decl, known_align) { DECL_BIT_FIELD_TYPE (decl) = DECL_BIT_FIELD (decl) ? type : 0; if (maximum_field_alignment != 0) - DECL_ALIGN (decl) = MIN (DECL_ALIGN (decl), maximum_field_alignment); + DECL_ALIGN (decl) = MIN (DECL_ALIGN (decl), + (unsigned)maximum_field_alignment); else if (DECL_PACKED (decl)) DECL_ALIGN (decl) = MIN (DECL_ALIGN (decl), BITS_PER_UNIT); } @@ -299,7 +300,7 @@ layout_decl (decl, known_align) if (xmode != BLKmode && known_align % GET_MODE_ALIGNMENT (xmode) == 0) { - DECL_ALIGN (decl) = MAX (GET_MODE_ALIGNMENT (xmode), + DECL_ALIGN (decl) = MAX ((unsigned) GET_MODE_ALIGNMENT (xmode), DECL_ALIGN (decl)); DECL_MODE (decl) = xmode; DECL_SIZE (decl) = size_int (GET_MODE_BITSIZE (xmode)); @@ -413,7 +414,7 @@ layout_record (rec) It does, however, affect the alignment of the next field within the structure. */ if (! integer_zerop (DECL_SIZE (field))) - record_align = MAX (record_align, desired_align); + record_align = MAX ((int)record_align, desired_align); else if (! DECL_PACKED (field)) desired_align = TYPE_ALIGN (TREE_TYPE (field)); /* A named bit field of declared type `int' @@ -426,11 +427,11 @@ layout_record (rec) else if (DECL_PACKED (field)) type_align = MIN (type_align, BITS_PER_UNIT); - record_align = MAX (record_align, type_align); + record_align = MAX ((int)record_align, type_align); } } else - record_align = MAX (record_align, desired_align); + record_align = MAX ((int)record_align, desired_align); #endif /* Does this field automatically have alignment it needs @@ -913,7 +914,7 @@ layout_type (type) MODE_INT, 1); if (STRICT_ALIGNMENT && TYPE_ALIGN (type) < BIGGEST_ALIGNMENT - && TYPE_ALIGN (type) < TREE_INT_CST_LOW (TYPE_SIZE (type)) + && (int)TYPE_ALIGN (type) < TREE_INT_CST_LOW (TYPE_SIZE (type)) && TYPE_MODE (type) != BLKmode) { TYPE_NO_FORCE_BLK (type) = 1; @@ -979,7 +980,7 @@ layout_type (type) then stick with BLKmode. */ if (STRICT_ALIGNMENT && ! (TYPE_ALIGN (type) >= BIGGEST_ALIGNMENT - || (TYPE_ALIGN (type) + || ((int)TYPE_ALIGN (type) >= TREE_INT_CST_LOW (TYPE_SIZE (type))))) { if (TYPE_MODE (type) != BLKmode) @@ -1011,7 +1012,7 @@ layout_type (type) then stick with BLKmode. */ && (! STRICT_ALIGNMENT || TYPE_ALIGN (type) >= BIGGEST_ALIGNMENT - || TYPE_ALIGN (type) >= TREE_INT_CST_LOW (TYPE_SIZE (type)))) + || (int)TYPE_ALIGN (type) >= TREE_INT_CST_LOW (TYPE_SIZE (type)))) { tree field; /* A union which has any BLKmode members must itself be BLKmode; -- cgit v1.1