Patchwork Some minor issues with vmsdbgout.c

login
register
mail settings
Submitter Douglas B Rupp
Date June 26, 2010, 7:34 p.m.
Message ID <4C265642.2070200@gnat.com>
Download mbox | patch
Permalink /patch/57063/
State New
Headers show

Comments

Douglas B Rupp - June 26, 2010, 7:34 p.m.
This patch fixes some warnings and does some minor reformatting of 
vmsdbgout.c

For future reference would this patch be considered "commit as obvious"?

OK to commit?
2010-06-26  Douglas B Rupp  <rupp@gnat.com>

	* vmsdbg.h (DST_K_TBG): New DST constant.
	* vmsdbgout.c (addr_const_to_string): Removed, not referenced.
	(write_modbeg): Cast module_language to avoid warning.
	(write_rtnbeg): Use DST_K_TBG vice magic mystery number.
	Minor reformatting.
	(vmsdbgout_source_line): Minor reformatting.
Richard Henderson - June 28, 2010, 4:58 p.m.
On 06/26/2010 12:34 PM, Douglas B Rupp wrote:
> This patch fixes some warnings and does some minor reformatting of
> vmsdbgout.c

> @@ -1528,7 +1414,7 @@ vmsdbgout_source_line (register unsigned
>        dst_line_info_ref line_info;
>  
>        targetm.asm_out.internal_label (asm_out_file, LINE_CODE_LABEL,
> -				      line_info_table_in_use);
> +				 line_info_table_in_use);

Does this really line up after the reformatting?
If so, this patch is ok.


r~
Douglas B Rupp - June 29, 2010, 6:57 p.m.
Richard Henderson wrote:
> On 06/26/2010 12:34 PM, Douglas B Rupp wrote:
>> This patch fixes some warnings and does some minor reformatting of
>> vmsdbgout.c
> 
>> @@ -1528,7 +1414,7 @@ vmsdbgout_source_line (register unsigned
>>        dst_line_info_ref line_info;
>>  
>>        targetm.asm_out.internal_label (asm_out_file, LINE_CODE_LABEL,
>> -				      line_info_table_in_use);
>> +				 line_info_table_in_use);
> 
> Does this really line up after the reformatting?
> If so, this patch is ok.
> 
> 
> r~
> 

You were right, it didn't line up. Sorry for being sloppy.
Committed without this hunk.

Patch

--- gcc/vmsdbg.h	2007-07-26 18:44:42.000000000 -0700
+++ gcc/vmsdbg.h	2010-06-25 19:43:39.000000000 -0700
@@ -28,7 +28,8 @@  along with GCC; see the file COPYING3.  
     size of the struct.  */
 
 /* Header type codes.  */
-typedef enum _DST_TYPE {DST_K_SOURCE = 155, DST_K_PROLOG = 162,
+typedef enum _DST_TYPE {DST_K_TBG = 0x17,
+			DST_K_SOURCE = 155, DST_K_PROLOG = 162,
 			DST_K_BLKBEG = 176, DST_K_BLKEND = 177,
 			DST_K_LINE_NUM = 185, DST_K_MODBEG = 188,
 			DST_K_MODEND = 189, DST_K_RTNBEG = 190,
--- gcc/vmsdbgout.c	2010-06-16 12:40:46.000000000 -0700
+++ gcc/vmsdbgout.c	2010-06-25 23:25:23.000000000 -0700
@@ -149,7 +135,6 @@  static unsigned int line_info_table_in_u
 /* Forward declarations for functions defined in this file.  */
 static char *full_name (const char *);
 static unsigned int lookup_filename (const char *);
-static void addr_const_to_string (char *, rtx);
 static int write_debug_header (DST_HEADER *, const char *, int);
 static int write_debug_addr (const char *, const char *, int);
 static int write_debug_data1 (unsigned int, const char *, int);
@@ -425,136 +415,6 @@  static char text_end_label[MAX_ARTIFICIA
 #endif
 
 
-/* General utility functions.  */
-
-/* Convert an integer constant expression into assembler syntax.  Addition and
-   subtraction are the only arithmetic that may appear in these expressions.
-   This is an adaptation of output_addr_const in final.c.  Here, the target
-   of the conversion is a string buffer.  We can't use output_addr_const
-   directly, because it writes to a file.  */
-
-static void
-addr_const_to_string (char *str, rtx x)
-{
-  char buf1[256];
-  char buf2[256];
-
- restart:
-  str[0] = '\0';
-  switch (GET_CODE (x))
-    {
-    case PC:
-      gcc_assert (flag_pic);
-      strcat (str, ",");
-      break;
-
-    case SYMBOL_REF:
-      ASM_NAME_TO_STRING (buf1, XSTR (x, 0));
-      strcat (str, buf1);
-      break;
-
-    case LABEL_REF:
-      ASM_GENERATE_INTERNAL_LABEL (buf1, "L", CODE_LABEL_NUMBER (XEXP (x, 0)));
-      ASM_NAME_TO_STRING (buf2, buf1);
-      strcat (str, buf2);
-      break;
-
-    case CODE_LABEL:
-      ASM_GENERATE_INTERNAL_LABEL (buf1, "L", CODE_LABEL_NUMBER (x));
-      ASM_NAME_TO_STRING (buf2, buf1);
-      strcat (str, buf2);
-      break;
-
-    case CONST_INT:
-      sprintf (buf1, HOST_WIDE_INT_PRINT_DEC, INTVAL (x));
-      strcat (str, buf1);
-      break;
-
-    case CONST:
-      /* This used to output parentheses around the expression, but that does
-         not work on the 386 (either ATT or BSD assembler).  */
-      addr_const_to_string (buf1, XEXP (x, 0));
-      strcat (str, buf1);
-      break;
-
-    case CONST_DOUBLE:
-      if (GET_MODE (x) == VOIDmode)
-	{
-	  /* We can use %d if the number is one word and positive.  */
-	  if (CONST_DOUBLE_HIGH (x))
-	    sprintf (buf1, HOST_WIDE_INT_PRINT_DOUBLE_HEX,
-		     CONST_DOUBLE_HIGH (x), CONST_DOUBLE_LOW (x));
-	  else if (CONST_DOUBLE_LOW (x) < 0)
-	    sprintf (buf1, HOST_WIDE_INT_PRINT_HEX, CONST_DOUBLE_LOW (x));
-	  else
-	    sprintf (buf1, HOST_WIDE_INT_PRINT_DEC,
-		     CONST_DOUBLE_LOW (x));
-	  strcat (str, buf1);
-	}
-      else
-	/* We can't handle floating point constants;
-	   TARGET_PRINT_OPERAND must handle them.  */
-	output_operand_lossage ("floating constant misused");
-      break;
-
-    case PLUS:
-      /* Some assemblers need integer constants to appear last (eg masm).  */
-      if (CONST_INT_P (XEXP (x, 0)))
-	{
-	  addr_const_to_string (buf1, XEXP (x, 1));
-	  strcat (str, buf1);
-	  if (INTVAL (XEXP (x, 0)) >= 0)
-	    strcat (str, "+");
-	  addr_const_to_string (buf1, XEXP (x, 0));
-	  strcat (str, buf1);
-	}
-      else
-	{
-	  addr_const_to_string (buf1, XEXP (x, 0));
-	  strcat (str, buf1);
-	  if (INTVAL (XEXP (x, 1)) >= 0)
-	    strcat (str, "+");
-	  addr_const_to_string (buf1, XEXP (x, 1));
-	  strcat (str, buf1);
-	}
-      break;
-
-    case MINUS:
-      /* Avoid outputting things like x-x or x+5-x, since some assemblers
-         can't handle that.  */
-      x = simplify_subtraction (x);
-      if (GET_CODE (x) != MINUS)
-	goto restart;
-
-      addr_const_to_string (buf1, XEXP (x, 0));
-      strcat (str, buf1);
-      strcat (str, "-");
-      if (CONST_INT_P (XEXP (x, 1))
-	  && INTVAL (XEXP (x, 1)) < 0)
-	{
-	  strcat (str, "(");
-	  addr_const_to_string (buf1, XEXP (x, 1));
-	  strcat (str, buf1);
-	  strcat (str, ")");
-	}
-      else
-	{
-	  addr_const_to_string (buf1, XEXP (x, 1));
-	  strcat (str, buf1);
-	}
-      break;
-
-    case ZERO_EXTEND:
-    case SIGN_EXTEND:
-      addr_const_to_string (buf1, XEXP (x, 0));
-      strcat (str, buf1);
-      break;
-
-    default:
-      output_operand_lossage ("invalid expression as operand");
-    }
-}
-
 /* Output the debug header HEADER.  Also output COMMENT if flag_verbose_asm is
    set.  Return the header size.  Just return the size if DOSIZEONLY is
    nonzero.  */
@@ -744,7 +604,7 @@  write_modbeg (int dosizeonly)
   modbeg.dst_b_modbeg_flags.dst_v_modbeg_version = 1;
   modbeg.dst_b_modbeg_flags.dst_v_modbeg_unused = 0;
   modbeg.dst_b_modbeg_unused = 0;
-  modbeg.dst_l_modbeg_language = module_language;
+  modbeg.dst_l_modbeg_language = (DST_LANGUAGE) module_language;
   modbeg.dst_w_version_major = DST_K_VERSION_MAJOR;
   modbeg.dst_w_version_minor = DST_K_VERSION_MINOR;
   modbeg.dst_b_modbeg_name = strlen (module_name);
@@ -823,7 +682,7 @@  write_rtnbeg (int rtnnum, int dosizeonly
 	 + string count byte + string length */
       header.dst__header_length.dst_w_length
 	= DST_K_DST_HEADER_SIZE - 1 + 1 + 4 + 1 + strlen (go);
-      header.dst__header_type.dst_w_type = 0x17;
+      header.dst__header_type.dst_w_type = DST_K_TBG;
 
       totsize += write_debug_header (&header, "transfer", dosizeonly);
 
@@ -1528,7 +1414,7 @@  vmsdbgout_source_line (register unsigned
       dst_line_info_ref line_info;
 
       targetm.asm_out.internal_label (asm_out_file, LINE_CODE_LABEL,
-				      line_info_table_in_use);
+				 line_info_table_in_use);
 
       /* Expand the line info table if necessary.  */
       if (line_info_table_in_use == line_info_table_allocated)