[PATCH] ia64: unwind directive handling

Jan Beulich JBeulich@novell.com
Mon May 23 10:19:00 GMT 2005


The main purpose of this patch is to add parser level support for the
optional tags various of the unwind directives permit and to make '}' a
statement separator as is done in ias. Along with that it consolidates
some redundant functionality, tightens operand checking for many unwind
directives, and fixes some other bugs.

Separating these into distinct patches would be very cumbersome, so I hope
applying this in one piece is acceptable (various pieces have already been
broken out and submitted previously).

There is one slightly odd thing in here: .prologue doesn't (as per the Intel
spec) allow an immediate as the second operand, but gcc for whatever reason
uses exactly that non-standard form. Thus the warning of this form being
deprecated had to be masked by an option not on by default; I chose 
unwind_check_error here rather than adding yet another controlling command
line option.

The actual handling of tags used with unwind directives still needs to be
implemented. Similarly, proper handling of .save.x directives with more
than one bit set in their operands needs to be done.

Built and tested on ia64-unknown-linux-gnu.

Jan

binutils/
2005-05-23  Jan Beulich  <jbeulich@novell.com>

	* unwind-ia64.c (unw_decode_p7_p10): Add psp_psprel to P8 handling.

gas/
2005-05-23  Jan Beulich  <jbeulich@novell.com>

	* config/tc-ia64.h (unw_record_type): Add psp_psprel.
	* config/tc-ia64.c (line_separator_chars): Add '}'.
	(output_P8_format): Handle psp_psprel.
	(output_psp_psprel): New.
	(output_spill_psprel, output_spill_psprel_p): Combine.
	(output_spill_sprel, output_spill_sprel_p): Combine.
	(output_spill_reg, output_spill_regp_p): Combine.
	(process_one_record): Handle psp_psprel.
	(parse_predicate_and_operand): New.
	(convert_expr_to_ab_reg): Two new parameters. Return void. Always
	initialize output values. Emit diagnostic case here.
	(convert_expr_to_xy_reg): Likewise. Don't allow r0, f0, and f1.
	(add_unwind_entry): New second parameter. Parse optional tag, emit
	warning about further support for it otherwise being missing. Check
	end-of-line when requested.
	(dot_fframe): Clear operand when wrong. Allow tag.
	(dot_vframe): Likewise.
	(dot_vframesp): Likewise.
	(dot_vframepsp): Likewise.
	(dot_altrp): Likewise.
	(dot_save): Likewise. Let default case fall through to also go
	through add_unwind_entry.
	(dot_savemem): Likewise.
	(dot_restore): Don't return when wrong operand. Allow tag.
	(dot_spillreg, dot_spillreg_p): Combine. Simplify by using
	parse_predicate_and_operand and the new arguments to
	convert_expr_to_ab_reg and convert_expr_to_xy_reg. Don't return
	when wrong operand. Allow tag.
	(dot_restorereg, dot_restorereg_p): Likewise.
	(dot_spillmem, dot_spillmem_p): Likewise.
	(dot_saveg): Clear operand when wrong. Perform tighter operand
	checks. Allow tag.
	(dot_savef): Likewise.
	(dot_saveb): Likewise.
	(dot_savegf): Likewise.
	(dot_spill): Remove end-of-line check. 	Combine. Simplify by using
	parse_predicate_and_operand and the new arguments to
	convert_expr_to_ab_reg and convert_expr_to_xy_reg. Don't return
	when wrong operand. Allow tag.
	(popcount): New.
	(dot_label_state): Don't return when wrong operand.
	(dot_copy_state): Likewise.
	(dot_unwabi): Likewise. Check if in prologue.
	(dot_body): Don't call demand_empty_rest_of_line.
	(dot_prologue): Type of mask and grsave is unsigned. Perform tighter
	operand checks.
	(md_pseudo_table): Also use dot_restorereg for .restorereg.p. Also
	use dot_spillreg for .spillreg.p. Also use dot_spillmem for
	.spillpsp.p and .spillsp.p.
	(parse_operand): New second parameter. Don't deal with '}' here
	anymore. Don't advance past end-of-line.
	(parse_operands): Pass second argument to parse_operand.
	(ia64_start_line): Prevent out-of-bounds access through
	input_line_pointer. Deal with '}' here.
	(ia64_unrecognized_line): Don't deal with '}' here.
	(dot_alias): Use ignore_rest_of_line not its deprecated alias
	discard_rest_of_line.

gas/testsuite/
2005-05-23  Jan Beulich  <jbeulich@novell.com>

	* gas/ia64/group-2.s: Use register as second operand of .prologue.
	* gas/ia64/unwind-err.s: Add check for .vframesp and .vframepsp.
	* gas/ia64/unwind-err.l: Adjust.
	* gas/ia64/strange.[sd]: New.
	* gas/ia64/unwind-bad.[sl]: New.
	* gas/ia64/unwind-ok.[sd]: New.
	* gas/ia64/ia64.exp: Run new tests.

(actual patch too large for inlining; attached)
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: binutils-mainline-ia64-unwind.patch
URL: <https://sourceware.org/pipermail/binutils/attachments/20050523/7e42fc28/attachment.ksh>


More information about the Binutils mailing list