Patchwork : Guard the call to begin_epilogue

login
register
mail settings
Submitter Tristan Gingold
Date Dec. 13, 2011, 1:40 p.m.
Message ID <9C76E78B-829D-4B05-9A01-25A71BA6BBAE@adacore.com>
Download mbox | patch
Permalink /patch/131090/
State New
Headers show

Comments

Tristan Gingold - Dec. 13, 2011, 1:40 p.m.
Hi,

currently, the call to begin_epilogue debug hook in final_scan_insn is unconditional and therefore occurs even when DECL_IGNORED_P is true.  This is not what is done for other debug hooks, and leads to ICE on VMS (the only platform that defines the hook) as last_filename is NULL.

Tested on alpha64-dec-openvms,
committed to trunk as obvious.

Tristan.

2011-12-13  Tristan Gingold  <gingold@adacore.com>

	* final.c (final_scan_insn): Guard the call to begin_epilogue
	debug hook.

Patch

Index: final.c
===================================================================
--- final.c	(revision 182280)
+++ final.c	(working copy)
@@ -1973,7 +1973,8 @@ 
 	  break;
 
 	case NOTE_INSN_EPILOGUE_BEG:
-	  (*debug_hooks->begin_epilogue) (last_linenum, last_filename);
+          if (!DECL_IGNORED_P (current_function_decl))
+            (*debug_hooks->begin_epilogue) (last_linenum, last_filename);
 	  targetm.asm_out.function_begin_epilogue (file);
 	  break;