--- 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);
