Patchwork [committed] : vms/ia64: avoid a crash if -mdebug-main is used without -g

login
register
mail settings
Submitter Tristan Gingold
Date April 21, 2011, 12:44 p.m.
Message ID <1C32864C-0B82-4358-9E1C-5DF5AC072F37@adacore.com>
Download mbox | patch
Permalink /patch/92407/
State New
Headers show

Comments

Tristan Gingold - April 21, 2011, 12:44 p.m.
Hi,

this simple patch adds a guard to avoid a crash.  As -mdebug-main directly calls dwarf2out, debug_info_level should be checked before.

Committed on trunk.

Tristan.

2011-04-21  Tristan Gingold  <gingold@adacore.com>

	* config/ia64/ia64.c (ia64_start_function): Add a guard.

Patch

--- gcc/config/ia64/ia64.c	(revision 172821)
+++ gcc/config/ia64/ia64.c	(working copy)
@@ -3542,6 +3542,7 @@ 
 {
 #if VMS_DEBUGGING_INFO
   if (vms_debug_main
+      && debug_info_level > DINFO_LEVEL_NONE
       && strncmp (vms_debug_main, fnname, strlen (vms_debug_main)) == 0)
     {
       targetm.asm_out.globalize_label (asm_out_file, VMS_DEBUG_MAIN_POINTER);