Fix PR rtl-optimization/88390

Eric Botcazou ebotcazou@adacore.com
Sat Dec 8 11:08:00 GMT 2018


This is the failure of g++.dg/tree-prof/pr57451.C on the SPARC, caused by the 
-freorder-blocks-and-partition RTL optimization.  The optimization splits the 
getData function into hold and cold parts, with the cold part throwing an 
exception.  Now the CFI for the cold part is emitted as a second, independent 
FDE, although there is still a single function for the RTL machinery, so there 
is specific code in dwarf2cfi to patch things up.

The problem is that it doesn't take into account the DW_CFA_GNU_window_save 
operation used on the SPARC so the second FDE lacks it entirely.  That's fixed 
by adding a flag to dw_cfi_row to record whether the operation has been seen.

Tested on SPARC/Solaris 11, applied on the mainline.


2018-12-08  Eric Botcazou  <ebotcazou@adacore.com>

	PR rtl-optimization/88390
	* dwarf2cfi.c (struct dw_cfi_row): Add window_save field.
	(cfi_row_equal_p): Compare it.
	(dwarf2out_frame_debug_cfa_window_save): Add FAKE parameter.
	If FAKE is false, set window_save of the current row.
	(dwarf2out_frame_debug) <REG_CFA_TOGGLE_RA_MANGLE>: Call above
	function with FAKE parameter set to true.
	<REG_CFA_WINDOW_SAVE>: Likewise but with FAKE parameter set to false.
	(change_cfi_row): Emit a DW_CFA_GNU_window_save if necessary.

-- 
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr88390.diff
Type: text/x-patch
Size: 2311 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20181208/39621a9a/attachment.bin>


More information about the Gcc-patches mailing list