clean up for Xtensa GAS port

Bob Wilson bwilson@tensilica.com
Tue Apr 5 21:33:00 GMT 2005
This patch fixes warnings from GCC 4 and fixes up some types that I did not 
think were being used appropriately.  There are no functional changes here.

Ironically, most of the warnings were caused by Alan's warning fixes for the 
Xtensa files in BFD -- the BFD files often refer to memory as "bfd_byte *" 
(which is unsigned char *"), but GAS often uses "char *", e.g., for fr_opcode 
and fr_literal fields of struct frag.  Alan changed some argument types to match 
BFD and its use of bfd_byte, and that caused new warnings in GAS.  Oh well.  I 
just added a bunch of casts in the GAS code to fix these.

As for the type cleanups: I found a number of places where "size_t" was being 
used for things that weren't even sizes.  For simple counts, etc. I changed 
these to "int" or "unsigned".  In other cases, "addressT", "offsetT", or 
"bfd_size_type" was more appropriate.  While fixing these, I discovered a few 
other instances where "addressT" and "offsetT" types could be better used, and I 
fixed those as well.

I've committed this on the mainline.  I'm going to also put it on the branch 
just to keep the code consistent while I continue fixing some open issues.


2005-04-05  Bob Wilson  <bob.wilson@acm.org>

	* config/tc-xtensa.c: Warning fixes throughout.
	(xtensa_fetch_width): Change to unsigned.
	(assemble_nop, xtensa_find_unaligned_branch_targets,
	xtensa_find_unaligned_loops, xg_assemble_vliw_tokens,
	is_narrow_branch_guaranteed_in_range, xtensa_fix_close_loop_end_frags,
	min_bytes_to_other_loop_end, unrelaxed_frag_min_size,
	unrelaxed_frag_max_size, xtensa_fix_short_loop_frags,
	count_insns_to_loop_end, unrelaxed_frag_min_insn_count,
	get_text_align_max_fill_size, get_text_align_nop_count,
	get_text_align_nth_nop_size, get_noop_aligned_address,
	get_aligned_diff, convert_frag_align_next_opcode,
	convert_frag_immed_finish_loop, xtensa_create_property_segments,
	xtensa_create_xproperty_segments, xt_block_aligned_size): Clean up
	types, avoiding size_t and using offsetT and addressT appropriately.
	(get_text_align_power): Clean up types.  Avoid incorrect bound.
	(get_text_align_fill_size): Clean up types.  Restructure for clarity.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: xtensa-gas-cleanup.diff
Type: text/x-patch
Size: 28579 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20050405/772b3932/attachment.bin>


More information about the Binutils mailing list