public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch] Deal with #ident without
@ 2012-06-06 22:32 Steven Bosscher
  2012-06-07  0:03 ` Michael Eager
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Steven Bosscher @ 2012-06-06 22:32 UTC (permalink / raw)
  To: Michael Eager
  Cc: Richard Guenther, GCC Patches, hp, rsandifo, Nick Clifton, Eric Botcazou

[-- Attachment #1: Type: text/plain, Size: 977 bytes --]

On Thu, Jun 7, 2012 at 12:00 AM, Michael Eager <eager@eagercon.com> wrote:
This is the patch to deal with #ident. It removes the ASM_OUTPUT_IDENT
and IDENT_ASM_OP target macros, and replaces them with a single target
hook. For targets that treat front-end #idents different from the GCC
version string .ident, the hooks can use cgraph_status to distinguish
them.

This patch was bootstrapped and tested on powerpc64-unknown-linux-gnu
with all languages enabled (c,c++,objc,obj-c++,fortran,java,ada), and
on x86_64-unknown-linux-gnu (c,c++,objc,fortran,ada). In addition, I
have built cross-tools in combined trees (src+gcc) from
powerpc64-unknown-linux-gnu to cris-elf, mips-elf, rx-elf, and
microblaze-elf, and verified that the differences in assembler output
are negligible (only #APP / #NO_APP, which is emitted for all
top-level asms, and an extra blank line). I have also tested mips-sim
and compared the test results without and with patch.

OK for trunk?

Ciao!
Steven

[-- Attachment #2: fe_no_output_h_ident_v1.diff.txt --]
[-- Type: text/plain, Size: 24881 bytes --]

gcc/
	* target.def (output_ident): New hook.
	* targhooks.h (default_asm_output_ident_directive): Add prototype.
	* varasm.c (assemble_asm): Only prefix a tab if the string does not
	already start with one.
	(default_asm_output_ident_directive): New function to emit
	.ident as a top-level asm node while parsing, or directly to
	asm_out_file after parsing.
	* toplev.c (compile_file): Print a GCC .ident with
	targetm.asm_out.output_ident.
	* doc/tm.texi.in (ASM_OUTPUT_IDENT): Remove documentation for macro.
	* doc/tm.texi: Update.

	* config/elfos.h (ASM_OUTPUT_IDENT, IDENT_ASM_OP): Remove.
	(TARGET_ASM_OUTPUT_IDENT): Define.
	* config/i386/djgpp.h (IDENT_ASM_OP): Remove.
	* config/i386/gas.h (ASM_OUTPUT_IDENT): Remove.
	* config/arm/aout.h (ASM_OUTPUT_IDENT): Remove.
	* config/sparc/sparc.h (IDENT_ASM_OP): Remove.
	(TARGET_ASM_OUTPUT_IDENT): Define.
	* config/picochip/picochip.h (IDENT_ASM_OP): Remove.
	(TARGET_ASM_OUTPUT_IDENT): Define.

	* config/cris/cris-protos.h (cris_asm_output_ident): Add prototype.
	* config/cris/cris.c (cris_asm_output_ident): New function.
	* config/cris/cris.h (ASM_OUTPUT_IDENT, IDENT_ASM_OP): Remove.

	* config/microblaze/microblaze-protos.h (microblaze_asm_output_ident):
	Add prototype.
	* config/microblaze/microblaze.c: Include cgraph.h for add_asm_node.
	(microblaze_asm_output_ident): Rewrite to work similar to
	default_asm_output_ident_directive for front-end .idents.
	* config/microblaze/microblaze.h (ASM_OUTPUT_IDENT): Remove.
	(TARGET_ASM_OUTPUT_IDENT): Define.

	* config/mips/mips-protos.h (mips_asm_output_ident): Add prototype.
	* config/mips/mips.c (mips_asm_output_ident): New function, similar to
	default_asm_output_ident_directive.
	* config/mips/mips.h (ASM_OUTPUT_IDENT): Remove.
	(TARGET_ASM_OUTPUT_IDENT): Define.
	* config/mips/sde.h (TARGET_ASM_OUTPUT_IDENT): Override mips.h default.

	* config/rx/rx.c: Include cgraph.h for add_asm_node.
	(rx_asm_output_ident): New function, similar to
	default_asm_output_ident_directive, but handle AS100 syntax also, so
	that #ident also works for rx in AS100 syntax.
	(TARGET_ASM_OUTPUT_IDENT): Define.
	* config/rx/rx.h (IDENT_ASM_OP): Remove.

c-family/
	* c-family/c-lex.c: Do not include output.h.
	(cb_ident): Try to put out .ident with targetm.asm_out.output_ident.
	Remove uses of ASM_OUTPUT_IDENT.

ada/
	* ada/gcc-interface/trans.c: Include target.h.
	(gigi): Try to put out .ident with targetm.asm_out.output_ident.
	Remove uses of ASM_OUTPUT_IDENT.

Index: target.def
===================================================================
--- target.def	(revision 188182)
+++ target.def	(working copy)
@@ -427,6 +427,15 @@ DEFHOOK
  void, (rtx x),
  default_asm_output_anchor)
 
+DEFHOOK
+(output_ident,
+ "Generate a string based on @var{name}, suitable for the @samp{#ident} \
+ directive, or the equivalent directive or pragma in non-C-family languages. \
+ If this hook is not defined, nothing is output for the @samp{#ident} \
+ directive.",
+ void, (const char *name),
+ hook_void_constcharptr)
+
 /* Output a DTP-relative reference to a TLS symbol.  */
 DEFHOOK
 (output_dwarf_dtprel,
Index: targhooks.h
===================================================================
--- targhooks.h	(revision 188182)
+++ targhooks.h	(working copy)
@@ -178,3 +178,6 @@ extern enum machine_mode default_get_reg_raw_mode(
 
 extern void *default_get_pch_validity (size_t *);
 extern const char *default_pch_valid_p (const void *, size_t);
+
+extern void default_asm_output_ident_directive (const char*);
+
Index: varasm.c
===================================================================
--- varasm.c	(revision 188182)
+++ varasm.c	(working copy)
@@ -1363,12 +1363,14 @@ make_decl_rtl_for_debug (tree decl)
 void
 assemble_asm (tree string)
 {
+  const char *p;
   app_enable ();
 
   if (TREE_CODE (string) == ADDR_EXPR)
     string = TREE_OPERAND (string, 0);
 
-  fprintf (asm_out_file, "\t%s\n", TREE_STRING_POINTER (string));
+  p = TREE_STRING_POINTER (string);
+  fprintf (asm_out_file, "%s%s\n", p[0] == '\t' ? "" : "\t", p);
 }
 
 /* Write the address of the entity given by SYMBOL to SEC.  */
@@ -7411,4 +7413,27 @@ default_elf_fini_array_asm_out_destructor (rtx sym
   assemble_addr_to_section (symbol, sec);
 }
 
+/* Default TARGET_ASM_OUTPUT_IDENT hook.
+
+   This is a bit of a cheat.  The real default is a no-op, but this
+   hook is the default for all targets with a .ident directive.  */
+
+void
+default_asm_output_ident_directive (const char *ident_str)
+{
+  const char *ident_asm_op = "\t.ident\t";
+
+  /* If we are still in the front end, do not write out the string
+     to asm_out_file.  Instead, add a fake top-level asm statement.
+     This allows the front ends to use this hook without actually
+     writing to asm_out_file, to handle #ident or Pragma Ident.  */
+  if (cgraph_state == CGRAPH_STATE_PARSING)
+    {
+      char *buf = ACONCAT ((ident_asm_op, "\"", ident_str, "\"\n", NULL));
+      add_asm_node (build_string (strlen (buf), buf));
+    }
+  else
+    fprintf (asm_out_file, "%s\"%s\"\n", ident_asm_op, ident_str);
+}
+
 #include "gt-varasm.h"
Index: toplev.c
===================================================================
--- toplev.c	(revision 188182)
+++ toplev.c	(working copy)
@@ -650,17 +650,17 @@ compile_file (void)
   /* Attach a special .ident directive to the end of the file to identify
      the version of GCC which compiled this code.  The format of the .ident
      string is patterned after the ones produced by native SVR4 compilers.  */
-#ifdef IDENT_ASM_OP
-  if (!flag_no_ident)
+  if (!flag_no_ident)
     {
       const char *pkg_version = "(GNU) ";
+      char *ident_str;
 
       if (strcmp ("(GCC) ", pkgversion_string))
 	pkg_version = pkgversion_string;
-      fprintf (asm_out_file, "%s\"GCC: %s%s\"\n",
-	       IDENT_ASM_OP, pkg_version, version_string);
+
+      ident_str = ACONCAT (("GCC: ", pkg_version, version_string, NULL));
+      targetm.asm_out.output_ident (ident_str);
     }
-#endif
 
   /* Invoke registered plugin callbacks.  */
   invoke_plugin_callbacks (PLUGIN_FINISH_UNIT, NULL);
Index: doc/tm.texi.in
===================================================================
--- doc/tm.texi.in	(revision 188182)
+++ doc/tm.texi.in	(working copy)
@@ -7308,12 +7308,6 @@ the assembler source.  So you can use it to canoni
 of the filename using this macro.
 @end defmac
 
-@defmac ASM_OUTPUT_IDENT (@var{stream}, @var{string})
-A C statement to output something to the assembler file to handle a
-@samp{#ident} directive containing the text @var{string}.  If this
-macro is not defined, nothing is output for a @samp{#ident} directive.
-@end defmac
-
 @hook TARGET_ASM_NAMED_SECTION
 Output assembly directives to switch to section @var{name}.  The section
 should have attributes as specified by @var{flags}, which is a bit mask
Index: doc/tm.texi
===================================================================
--- doc/tm.texi	(revision 188182)
+++ doc/tm.texi	(working copy)
@@ -5847,6 +5847,10 @@ value is 0.
 @end deftypevr
 
 @deftypefn {Target Hook} void TARGET_ASM_OUTPUT_ANCHOR (rtx @var{x})
+
+@deftypefn {Target Hook} void TARGET_ASM_OUTPUT_IDENT (const char *@var{name})
+Generate a string based on @var{name}, suitable for the @samp{#ident}  directive, or the equivalent directive or pragma in non-C-family languages.  If this hook is not defined, nothing is output for the @samp{#ident}  directive.
+@end deftypefn
 Write the assembly code to define section anchor @var{x}, which is a
 @code{SYMBOL_REF} for which @samp{SYMBOL_REF_ANCHOR_P (@var{x})} is true.
 The hook is called with the assembly output position set to the beginning
@@ -7398,12 +7402,6 @@ the assembler source.  So you can use it to canoni
 of the filename using this macro.
 @end defmac
 
-@defmac ASM_OUTPUT_IDENT (@var{stream}, @var{string})
-A C statement to output something to the assembler file to handle a
-@samp{#ident} directive containing the text @var{string}.  If this
-macro is not defined, nothing is output for a @samp{#ident} directive.
-@end defmac
-
 @deftypefn {Target Hook} void TARGET_ASM_NAMED_SECTION (const char *@var{name}, unsigned int @var{flags}, tree @var{decl})
 Output assembly directives to switch to section @var{name}.  The section
 should have attributes as specified by @var{flags}, which is a bit mask
Index: config/elfos.h
===================================================================
--- config/elfos.h	(revision 188182)
+++ config/elfos.h	(working copy)
@@ -83,11 +83,9 @@ see the files COPYING3 and COPYING.RUNTIME respect
 
 /* Output #ident as a .ident.  */
 
-#define ASM_OUTPUT_IDENT(FILE, NAME) \
-  fprintf (FILE, "%s\"%s\"\n", IDENT_ASM_OP, NAME);
+#undef TARGET_ASM_OUTPUT_IDENT
+#define TARGET_ASM_OUTPUT_IDENT default_asm_output_ident_directive
 
-#define IDENT_ASM_OP "\t.ident\t"
-
 #undef  SET_ASM_OP
 #define SET_ASM_OP	"\t.set\t"
 
Index: config/i386/djgpp.h
===================================================================
--- config/i386/djgpp.h	(revision 188182)
+++ config/i386/djgpp.h	(working copy)
@@ -31,10 +31,6 @@ along with GCC; see the file COPYING3.  If not see
 #undef DATA_SECTION_ASM_OP
 #define DATA_SECTION_ASM_OP "\t.section .data"
 
-/* Define the name of the .ident op.  */
-#undef IDENT_ASM_OP
-#define IDENT_ASM_OP "\t.ident\t"
-
 /* Enable alias attribute support.  */
 #ifndef SET_ASM_OP
 #define SET_ASM_OP "\t.set\t"
Index: config/i386/gas.h
===================================================================
--- config/i386/gas.h	(revision 188182)
+++ config/i386/gas.h	(working copy)
@@ -47,7 +47,8 @@ along with GCC; see the file COPYING3.  If not see
 
 /* Output #ident as a .ident.  */
 
-#define ASM_OUTPUT_IDENT(FILE, NAME) fprintf (FILE, "\t.ident \"%s\"\n", NAME);
+#undef TARGET_ASM_OUTPUT_IDENT
+#define TARGET_ASM_OUTPUT_IDENT default_asm_output_ident_directive
 
 /* In the past there was confusion as to what the argument to .align was
    in GAS.  For the last several years the rule has been this: for a.out
Index: config/arm/aout.h
===================================================================
--- config/arm/aout.h	(revision 188182)
+++ config/arm/aout.h	(working copy)
@@ -366,12 +366,6 @@
   asm_output_aligned_bss (STREAM, DECL, NAME, SIZE, ALIGN)
 #endif
 
-/* Output a #ident directive.  */
-#ifndef ASM_OUTPUT_IDENT
-#define ASM_OUTPUT_IDENT(STREAM,STRING)  \
-  asm_fprintf (STREAM, "%@ - - - ident %s\n", STRING)
-#endif
-     
 #ifndef ASM_COMMENT_START
 #define ASM_COMMENT_START 	"@"
 #endif
Index: config/sparc/sparc.h
===================================================================
--- config/sparc/sparc.h	(revision 188182)
+++ config/sparc/sparc.h	(working copy)
@@ -1709,12 +1709,10 @@ do {									\
     ASM_OUTPUT_ALIGNED_LOCAL (FILE, NAME, SIZE, ALIGN);		\
   } while (0)
 
-#define IDENT_ASM_OP "\t.ident\t"
-
 /* Output #ident as a .ident.  */
 
-#define ASM_OUTPUT_IDENT(FILE, NAME) \
-  fprintf (FILE, "%s\"%s\"\n", IDENT_ASM_OP, NAME);
+#undef TARGET_ASM_OUTPUT_IDENT
+#define TARGET_ASM_OUTPUT_IDENT default_asm_output_ident_directive
 
 /* Prettify the assembly.  */
 
Index: config/picochip/picochip.h
===================================================================
--- config/picochip/picochip.h	(revision 188182)
+++ config/picochip/picochip.h	(working copy)
@@ -488,7 +488,8 @@ do {
 #define ASM_APP_ON "// High-level ASM start\n"
 #define ASM_APP_OFF "// High-level ASM end\n"
 
-#define ASM_OUTPUT_IDENT(STREAM,STRING) fprintf(STREAM, ".ident %s\n", STRING)
+#undef TARGET_ASM_OUTPUT_IDENT
+#define TARGET_ASM_OUTPUT_IDENT default_asm_output_ident_directive
 
 /* Output of Data  */
 
Index: config/cris/cris.c
===================================================================
--- config/cris/cris.c	(revision 188182)
+++ config/cris/cris.c	(working copy)
@@ -47,6 +47,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "optabs.h"
 #include "df.h"
 #include "opts.h"
+#include "cgraph.h"
 
 /* Usable when we have an amount to add or subtract, and want the
    optimal size of the insn.  */
@@ -2480,6 +2481,22 @@ cris_legitimate_pic_operand (rtx x)
   return cris_valid_pic_const (x, true);
 }
 
+/* Queue an .ident string in the queue of top-level asm statements.
+   If the front-end is done, we must be being called from toplev.c.
+   In that case, do nothing.  */
+void 
+cris_asm_output_ident (const char *string)
+{
+  const char *section_asm_op;
+  int size;
+  char *buf;
+
+  if (cgraph_state != CGRAPH_STATE_PARSING)
+    return;
+
+  default_asm_output_ident_directive (string);
+}
+
 /* The ASM_OUTPUT_CASE_END worker.  */
 
 void
@@ -2530,6 +2547,10 @@ cris_asm_output_case_end (FILE *stream, int num, r
 static void
 cris_option_override (void)
 {
+  /* We don't want an .ident for gcc.
+     It isn't really clear anymore why not.  */
+  flag_no_gcc_ident = true;
+
   if (cris_max_stackframe_str)
     {
       cris_max_stackframe = atoi (cris_max_stackframe_str);
Index: config/cris/cris.h
===================================================================
--- config/cris/cris.h	(revision 188182)
+++ config/cris/cris.h	(working copy)
@@ -852,12 +852,11 @@ enum cris_pic_symbol_type
 /* Node: File Framework */
 
 /* We don't want an .ident for gcc.  To avoid that but still support
-   #ident, we override ASM_OUTPUT_IDENT and, since the gcc .ident is its
-   only use besides ASM_OUTPUT_IDENT, undef IDENT_ASM_OP from elfos.h.  */
-#undef IDENT_ASM_OP
-#undef ASM_OUTPUT_IDENT
-#define ASM_OUTPUT_IDENT(FILE, NAME) \
-  fprintf (FILE, "%s\"%s\"\n", "\t.ident\t", NAME);
+   #ident, we override TARGET_ASM_OUTPUT_IDENT and, since the gcc .ident
+   is its only use besides front-end .ident directives, we return if
+   the state if the cgraph is not CGRAPH_STATE_PARSING.  */
+#undef TARGET_ASM_OUTPUT_IDENT
+#define TARGET_ASM_OUTPUT_IDENT cris_asm_output_ident
 
 #define ASM_APP_ON "#APP\n"
 
Index: config/cris/cris-protos.h
===================================================================
--- config/cris/cris-protos.h	(revision 188182)
+++ config/cris/cris-protos.h	(working copy)
@@ -52,6 +52,7 @@ extern void cris_order_for_addsi3 (rtx *, int);
 extern void cris_emit_trap_for_misalignment (rtx);
 #endif /* RTX_CODE */
 extern void cris_asm_output_label_ref (FILE *, char *);
+extern void cris_asm_output_ident (const char *);
 extern void cris_target_asm_named_section (const char *, unsigned int, tree);
 extern void cris_expand_prologue (void);
 extern void cris_expand_epilogue (void);
Index: config/microblaze/microblaze-protos.h
===================================================================
--- config/microblaze/microblaze-protos.h	(revision 188182)
+++ config/microblaze/microblaze-protos.h	(working copy)
@@ -48,7 +48,7 @@ extern int microblaze_regno_ok_for_base_p (int, in
 extern HOST_WIDE_INT microblaze_initial_elimination_offset (int, int);
 extern void microblaze_declare_object (FILE *, const char *, const char *,
    const char *, int);
-extern void microblaze_asm_output_ident (FILE *, const char *);
+extern void microblaze_asm_output_ident (const char *);
 #endif  /* RTX_CODE */
 
 /* Declare functions in microblaze-c.c.  */
Index: config/microblaze/microblaze.c
===================================================================
--- config/microblaze/microblaze.c	(revision 188182)
+++ config/microblaze/microblaze.c	(working copy)
@@ -47,6 +47,7 @@
 #include "df.h"
 #include "optabs.h"
 #include "diagnostic-core.h"
+#include "cgraph.h"
 
 #define MICROBLAZE_VERSION_COMPARE(VA,VB) strcasecmp (VA, VB)
 
@@ -2736,16 +2737,28 @@ microblaze_return_addr (int count, rtx frame ATTRI
 		       GEN_INT (8));
 }
 
-/* Put string into .sdata2 if below threashold.  */
+/* Queue an .ident string in the queue of top-level asm statements.
+   If the string size is below the threshold, put it into .sdata2.
+   If the front-end is done, we must be being called from toplev.c.
+   In that case, do nothing.  */
 void 
-microblaze_asm_output_ident (FILE *file ATTRIBUTE_UNUSED, const char *string)
+microblaze_asm_output_ident (const char *string)
 {
-  int size = strlen (string) + 1;
+  const char *section_asm_op;
+  int size;
+  char *buf;
+
+  if (cgraph_state != CGRAPH_STATE_PARSING)
+    return;
+
+  size = strlen (string) + 1;
   if (size <= microblaze_section_threshold)
-    switch_to_section (sdata2_section);
+    section_asm_op = SDATA2_SECTION_ASM_OP;
   else
-    switch_to_section (readonly_data_section);
-  assemble_string (string, size);
+    section_asm_op = READONLY_DATA_SECTION_ASM_OP;
+
+  buf = ACONCAT ((section_asm_op, "\n\t.ascii \"", string, "\\0\"\n", NULL));
+  add_asm_node (build_string (strlen (buf), buf));
 }
 
 static void
Index: config/microblaze/microblaze.h
===================================================================
--- config/microblaze/microblaze.h	(revision 188182)
+++ config/microblaze/microblaze.h	(working copy)
@@ -696,8 +696,8 @@ do {									\
 #define ASCII_DATA_ASM_OP		"\t.ascii\t"
 #define STRING_ASM_OP			"\t.asciz\t"
 
-#define ASM_OUTPUT_IDENT(FILE, STRING)					\
-  microblaze_asm_output_ident (FILE, STRING)
+#undef TARGET_ASM_OUTPUT_IDENT
+#define TARGET_ASM_OUTPUT_IDENT microblaze_asm_output_ident
 
 /* Default to -G 8 */
 #ifndef MICROBLAZE_DEFAULT_GVALUE
Index: config/mips/mips-protos.h
===================================================================
--- config/mips/mips-protos.h	(revision 188182)
+++ config/mips/mips-protos.h	(working copy)
@@ -264,6 +264,8 @@ extern void mips_declare_object (FILE *, const cha
 extern void mips_declare_object_name (FILE *, const char *, tree);
 extern void mips_finish_declare_object (FILE *, tree, int, int);
 
+extern void mips_asm_output_ident (const char *);
+
 extern bool mips_small_data_pattern_p (rtx);
 extern rtx mips_rewrite_small_data (rtx);
 extern HOST_WIDE_INT mips_initial_elimination_offset (int, int);
Index: config/mips/mips.c
===================================================================
--- config/mips/mips.c	(revision 188182)
+++ config/mips/mips.c	(working copy)
@@ -58,6 +58,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "diagnostic.h"
 #include "target-globals.h"
 #include "opts.h"
+#include "cgraph.h"
 
 /* True if X is an UNSPEC wrapper around a SYMBOL_REF or LABEL_REF.  */
 #define UNSPEC_ADDRESS_P(X)					\
@@ -3098,6 +3099,23 @@ mips_legitimize_move (enum machine_mode mode, rtx
   return false;
 }
 \f
+/* Output #ident as a string in the read-only data section.
+   A user #ident goes into .rodata as ascii text.
+   The GCC version string goes out as .ident.  */
+void
+mips_asm_output_ident (const char *string)
+{
+  if (cgraph_state == CGRAPH_STATE_PARSING)
+    {
+      const char *section_asm_op = READONLY_DATA_SECTION_ASM_OP;
+      char *buf = ACONCAT ((section_asm_op, "\n\t.ascii \"", string, "\\000\"\n", NULL));
+      add_asm_node (build_string (strlen (buf), buf));
+    }
+  else
+    default_asm_output_ident_directive (string);
+}
+
+\f
 /* Return true if value X in context CONTEXT is a small-data address
    that can be rewritten as a LO_SUM.  */
 
Index: config/mips/mips.h
===================================================================
--- config/mips/mips.h	(revision 188182)
+++ config/mips/mips.h	(working copy)
@@ -2675,14 +2675,9 @@ do {									\
 #define ASM_OUTPUT_ASCII mips_output_ascii
 
 /* Output #ident as a in the read-only data section.  */
-#undef  ASM_OUTPUT_IDENT
-#define ASM_OUTPUT_IDENT(FILE, STRING)					\
-{									\
-  const char *p = STRING;						\
-  int size = strlen (p) + 1;						\
-  switch_to_section (readonly_data_section);				\
-  assemble_string (p, size);						\
-}
+#undef TARGET_ASM_OUTPUT_IDENT
+#define TARGET_ASM_OUTPUT_IDENT mips_asm_output_ident
+
 \f
 /* Default to -G 8 */
 #ifndef MIPS_DEFAULT_GVALUE
Index: config/mips/sde.h
===================================================================
--- config/mips/sde.h	(revision 188182)
+++ config/mips/sde.h	(working copy)
@@ -97,16 +97,10 @@ along with GCC; see the file COPYING3.  If not see
 /* Use periods rather than dollar signs in special g++ assembler names.  */
 #define NO_DOLLAR_IN_LABEL
 
-/* Attach a special .ident directive to the end of the file to identify
-   the version of GCC which compiled this code.  */
-#undef IDENT_ASM_OP
-#define IDENT_ASM_OP "\t.ident\t"
-
 /* Output #ident string into the ELF .comment section, so it doesn't
    form part of the load image, and so that it can be stripped.  */
-#undef ASM_OUTPUT_IDENT
-#define ASM_OUTPUT_IDENT(STREAM, STRING) \
-  fprintf (STREAM, "%s\"%s\"\n", IDENT_ASM_OP, STRING);
+#undef TARGET_ASM_OUTPUT_IDENT
+#define TARGET_ASM_OUTPUT_IDENT default_asm_output_ident_directive
 
 /* Currently we don't support 128bit long doubles, so for now we force
    n32 to be 64bit.  */
Index: config/rx/rx.c
===================================================================
--- config/rx/rx.c	(revision 188182)
+++ config/rx/rx.c	(working copy)
@@ -52,6 +52,7 @@
 #include "target-def.h"
 #include "langhooks.h"
 #include "opts.h"
+#include "cgraph.h"

 static unsigned int rx_gp_base_regnum_val = INVALID_REGNUM;
 static unsigned int rx_pid_base_regnum_val = INVALID_REGNUM;

@@ -1734,6 +1735,29 @@ rx_output_function_prologue (FILE * file,
     asm_fprintf (file, "\t; Note: Calls __builtin_eh_return.\n");
 }
 
+/* Output a string for the #ident directive.  */
+
+static void 
+rx_asm_output_ident (const char *string)
+{
+  const char *ident_asm_op;
+
+  if (TARGET_AS100_SYNTAX
+      && cgraph_state != CGRAPH_STATE_FINISHED)
+    ident_asm_op = ASM_COMMENT_START "\t.ident \t";
+  else if (TARGET_AS100_SYNTAX)
+    ident_asm_op = "\t.END\t; Built by: ";
+  else
+    ident_asm_op = "\t.ident\t";
+
+  buf = ACONCAT ((ident_asm_op, string, "\n", NULL));
+
+  if (cgraph_state == CGRAPH_STATE_PARSING)
+    add_asm_node (build_string (strlen (buf), buf));
+  else
+    assemble_string (buf, strlen (buf));
+}
+
 /* Generate a POPM or RTSD instruction that matches the given operands.  */
 
 void
@@ -3281,6 +3305,9 @@ rx_adjust_insn_length (rtx insn, int current_lengt
 #undef  TARGET_LEGITIMIZE_ADDRESS
 #define TARGET_LEGITIMIZE_ADDRESS		rx_legitimize_address
 
+#undef  TARGET_ASM_OUTPUT_IDENT
+#define TARGET_ASM_OUTPUT_IDENT			rx_asm_output_ident
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 
 #include "gt-rx.h"
Index: config/rx/rx.h
===================================================================
--- config/rx/rx.h	(revision 188182)
+++ config/rx/rx.h	(working copy)
@@ -602,10 +602,6 @@ typedef unsigned int CUMULATIVE_ARGS;
     }							\
   while (0)
 
-#undef  IDENT_ASM_OP
-#define IDENT_ASM_OP  (TARGET_AS100_SYNTAX \
-		       ? "\t.END\t; Built by: ": "\t.ident\t")
-
 /* For PIC put jump tables into the text section so that the offsets that
    they contain are always computed between two same-section symbols.  */
 #define JUMP_TABLES_IN_TEXT_SECTION	(TARGET_PID || flag_pic)
Index: c-family/c-lex.c
===================================================================
--- c-family/c-lex.c	(revision 188182)
+++ c-family/c-lex.c	(working copy)
@@ -26,7 +26,6 @@ along with GCC; see the file COPYING3.  If not see
 
 #include "tree.h"
 #include "input.h"
-#include "output.h" /* for asm_out_file */
 #include "c-common.h"
 #include "flags.h"
 #include "timevar.h"
@@ -165,18 +164,16 @@ cb_ident (cpp_reader * ARG_UNUSED (pfile),
 	  unsigned int ARG_UNUSED (line),
 	  const cpp_string * ARG_UNUSED (str))
 {
-#ifdef ASM_OUTPUT_IDENT
   if (!flag_no_ident)
     {
       /* Convert escapes in the string.  */
       cpp_string cstr = { 0, 0 };
       if (cpp_interpret_string (pfile, str, 1, &cstr, CPP_STRING))
 	{
-	  ASM_OUTPUT_IDENT (asm_out_file, (const char *) cstr.text);
+	  targetm.asm_out.output_ident ((const char *) cstr.text);
 	  free (CONST_CAST (unsigned char *, cstr.text));
 	}
     }
-#endif
 }
 
 /* Called at the start of every non-empty line.  TOKEN is the first
Index: ada/gcc-interface/trans.c
===================================================================
--- ada/gcc-interface/trans.c	(revision 188182)
+++ ada/gcc-interface/trans.c	(working copy)
@@ -36,6 +36,7 @@
 #include "gimple.h"
 #include "bitmap.h"
 #include "cgraph.h"
+#include "target.h"
 
 #include "ada.h"
 #include "adadecode.h"
@@ -647,12 +648,9 @@ gigi (Node_Id gnat_root, int max_gnat_node, int nu
   VEC_safe_push (tree, gc, gnu_program_error_label_stack, NULL_TREE);
 
   /* Process any Pragma Ident for the main unit.  */
-#ifdef ASM_OUTPUT_IDENT
   if (Present (Ident_String (Main_Unit)))
-    ASM_OUTPUT_IDENT
-      (asm_out_file,
-       TREE_STRING_POINTER (gnat_to_gnu (Ident_String (Main_Unit))));
-#endif
+    targetm.asm_out.output_ident
+      (TREE_STRING_POINTER (gnat_to_gnu (Ident_String (Main_Unit))));
 
   /* If we are using the GCC exception mechanism, let GCC know.  */
   if (Exception_Mechanism == Back_End_Exceptions)

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [patch] Deal with #ident without
  2012-06-06 22:32 [patch] Deal with #ident without Steven Bosscher
@ 2012-06-07  0:03 ` Michael Eager
  2012-06-07  6:22 ` Andreas Schwab
  2012-06-07 10:09 ` [patch] Deal with #ident without nick clifton
  2 siblings, 0 replies; 12+ messages in thread
From: Michael Eager @ 2012-06-07  0:03 UTC (permalink / raw)
  To: Steven Bosscher
  Cc: Michael Eager, Richard Guenther, GCC Patches, hp, rsandifo,
	Nick Clifton, Eric Botcazou

On 06/06/2012 03:31 PM, Steven Bosscher wrote:
> On Thu, Jun 7, 2012 at 12:00 AM, Michael Eager<eager@eagercon.com>  wrote:
> This is the patch to deal with #ident. It removes the ASM_OUTPUT_IDENT
> and IDENT_ASM_OP target macros, and replaces them with a single target
> hook. For targets that treat front-end #idents different from the GCC
> version string .ident, the hooks can use cgraph_status to distinguish
> them.
>
> This patch was bootstrapped and tested on powerpc64-unknown-linux-gnu
> with all languages enabled (c,c++,objc,obj-c++,fortran,java,ada), and
> on x86_64-unknown-linux-gnu (c,c++,objc,fortran,ada). In addition, I
> have built cross-tools in combined trees (src+gcc) from
> powerpc64-unknown-linux-gnu to cris-elf, mips-elf, rx-elf, and
> microblaze-elf, and verified that the differences in assembler output
> are negligible (only #APP / #NO_APP, which is emitted for all
> top-level asms, and an extra blank line). I have also tested mips-sim
> and compared the test results without and with patch.
>
> OK for trunk?

OK for MicroBlaze.

-- 
Michael Eager	 eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [patch] Deal with #ident without
  2012-06-06 22:32 [patch] Deal with #ident without Steven Bosscher
  2012-06-07  0:03 ` Michael Eager
@ 2012-06-07  6:22 ` Andreas Schwab
  2012-06-07  9:23   ` Richard Guenther
  2012-06-07 10:15   ` Steven Bosscher
  2012-06-07 10:09 ` [patch] Deal with #ident without nick clifton
  2 siblings, 2 replies; 12+ messages in thread
From: Andreas Schwab @ 2012-06-07  6:22 UTC (permalink / raw)
  To: Steven Bosscher
  Cc: Michael Eager, Richard Guenther, GCC Patches, hp, rsandifo,
	Nick Clifton, Eric Botcazou

Steven Bosscher <stevenb.gcc@gmail.com> writes:

> Index: doc/tm.texi
> ===================================================================
> --- doc/tm.texi	(revision 188182)
> +++ doc/tm.texi	(working copy)
> @@ -5847,6 +5847,10 @@ value is 0.
>  @end deftypevr
>  
>  @deftypefn {Target Hook} void TARGET_ASM_OUTPUT_ANCHOR (rtx @var{x})
> +
> +@deftypefn {Target Hook} void TARGET_ASM_OUTPUT_IDENT (const char *@var{name})
> +Generate a string based on @var{name}, suitable for the @samp{#ident}  directive, or the equivalent directive or pragma in non-C-family languages.  If this hook is not defined, nothing is output for the @samp{#ident}  directive.
> +@end deftypefn

That looks misplaced.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [patch] Deal with #ident without
  2012-06-07  6:22 ` Andreas Schwab
@ 2012-06-07  9:23   ` Richard Guenther
  2012-06-19 20:46     ` Steven Bosscher
  2012-06-07 10:15   ` Steven Bosscher
  1 sibling, 1 reply; 12+ messages in thread
From: Richard Guenther @ 2012-06-07  9:23 UTC (permalink / raw)
  To: Andreas Schwab
  Cc: Steven Bosscher, Michael Eager, GCC Patches, hp, rsandifo,
	Nick Clifton, Eric Botcazou

On Thu, Jun 7, 2012 at 8:16 AM, Andreas Schwab <schwab@linux-m68k.org> wrote:
> Steven Bosscher <stevenb.gcc@gmail.com> writes:
>
>> Index: doc/tm.texi
>> ===================================================================
>> --- doc/tm.texi       (revision 188182)
>> +++ doc/tm.texi       (working copy)
>> @@ -5847,6 +5847,10 @@ value is 0.
>>  @end deftypevr
>>
>>  @deftypefn {Target Hook} void TARGET_ASM_OUTPUT_ANCHOR (rtx @var{x})
>> +
>> +@deftypefn {Target Hook} void TARGET_ASM_OUTPUT_IDENT (const char *@var{name})
>> +Generate a string based on @var{name}, suitable for the @samp{#ident}  directive, or the equivalent directive or pragma in non-C-family languages.  If this hook is not defined, nothing is output for the @samp{#ident}  directive.
>> +@end deftypefn
>
> That looks misplaced.

Ok after double-checking the above.

Thanks,
Richard.

> Andreas.
>
> --
> Andreas Schwab, schwab@linux-m68k.org
> GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
> "And now for something completely different."

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [patch] Deal with #ident without
  2012-06-06 22:32 [patch] Deal with #ident without Steven Bosscher
  2012-06-07  0:03 ` Michael Eager
  2012-06-07  6:22 ` Andreas Schwab
@ 2012-06-07 10:09 ` nick clifton
  2 siblings, 0 replies; 12+ messages in thread
From: nick clifton @ 2012-06-07 10:09 UTC (permalink / raw)
  To: Steven Bosscher
  Cc: Michael Eager, Richard Guenther, GCC Patches, hp, rsandifo,
	Eric Botcazou

Hi Steven,

> This is the patch to deal with #ident. It removes the ASM_OUTPUT_IDENT
> and IDENT_ASM_OP target macros, and replaces them with a single target
> hook.

The RX parts of this patch are approved.

Cheers
   Nick

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [patch] Deal with #ident without
  2012-06-07  6:22 ` Andreas Schwab
  2012-06-07  9:23   ` Richard Guenther
@ 2012-06-07 10:15   ` Steven Bosscher
  2012-06-07 11:07     ` Andreas Schwab
  1 sibling, 1 reply; 12+ messages in thread
From: Steven Bosscher @ 2012-06-07 10:15 UTC (permalink / raw)
  To: Andreas Schwab
  Cc: Michael Eager, Richard Guenther, GCC Patches, hp, rsandifo,
	Nick Clifton, Eric Botcazou

On Thu, Jun 7, 2012 at 8:16 AM, Andreas Schwab <schwab@linux-m68k.org> wrote:
> Steven Bosscher <stevenb.gcc@gmail.com> writes:
>
>> Index: doc/tm.texi
>> ===================================================================
>> --- doc/tm.texi       (revision 188182)
>> +++ doc/tm.texi       (working copy)
>> @@ -5847,6 +5847,10 @@ value is 0.
>>  @end deftypevr
>>
>>  @deftypefn {Target Hook} void TARGET_ASM_OUTPUT_ANCHOR (rtx @var{x})
>> +
>> +@deftypefn {Target Hook} void TARGET_ASM_OUTPUT_IDENT (const char *@var{name})
>> +Generate a string based on @var{name}, suitable for the @samp{#ident}  directive, or the equivalent directive or pragma in non-C-family languages.  If this hook is not defined, nothing is output for the @samp{#ident}  directive.
>> +@end deftypefn
>
> That looks misplaced.

Hello,

I am not sure what you mean with misplaced. If you mean the position
in the file: Can't help that, it comes out of target.def that way. If
you mean the text itself, yes, that looks like something I tried in an
older iteration of this patch (target hook returning a .ident string).
In the following documentation, the "Generate a string" is replaced by
"Output a string". Is that better? Otherwise, can you please clarify
what you would like to see different here?

Thanks,

Ciao!
Steven

Index: doc/tm.texi
===================================================================
--- doc/tm.texi (revision 188182)
+++ doc/tm.texi (working copy)
@@ -5847,6 +5847,10 @@
 @end deftypevr

 @deftypefn {Target Hook} void TARGET_ASM_OUTPUT_ANCHOR (rtx @var{x})
+
+@deftypefn {Target Hook} void TARGET_ASM_OUTPUT_IDENT (const char *@var{name})
+Output a string based on @var{name}, suitable for the @samp{#ident}
directive, or the equivalent directive or pragma in non-C-family
languages.  If this hook is not defined, nothing is output for the
@samp{#ident}  directive.
+@end deftypefn
 Write the assembly code to define section anchor @var{x}, which is a
 @code{SYMBOL_REF} for which @samp{SYMBOL_REF_ANCHOR_P (@var{x})} is true.
 The hook is called with the assembly output position set to the beginning
@@ -7398,12 +7402,6 @@
 of the filename using this macro.
 @end defmac

-@defmac ASM_OUTPUT_IDENT (@var{stream}, @var{string})
-A C statement to output something to the assembler file to handle a
-@samp{#ident} directive containing the text @var{string}.  If this
-macro is not defined, nothing is output for a @samp{#ident} directive.
-@end defmac
-
 @deftypefn {Target Hook} void TARGET_ASM_NAMED_SECTION (const char
*@var{name}, unsigned int @var{flags}, tree @var{decl})
 Output assembly directives to switch to section @var{name}.  The section
 should have attributes as specified by @var{flags}, which is a bit mask

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [patch] Deal with #ident without
  2012-06-07 10:15   ` Steven Bosscher
@ 2012-06-07 11:07     ` Andreas Schwab
  2012-06-07 11:34       ` Steven Bosscher
  0 siblings, 1 reply; 12+ messages in thread
From: Andreas Schwab @ 2012-06-07 11:07 UTC (permalink / raw)
  To: Steven Bosscher
  Cc: Michael Eager, Richard Guenther, GCC Patches, hp, rsandifo,
	Nick Clifton, Eric Botcazou

Steven Bosscher <stevenb.gcc@gmail.com> writes:

> I am not sure what you mean with misplaced.

A nested @deftypefn doesn't look right.  Try make info.  You need to add
a @hook in tm.texi.in at the right place (output_ident has nothing to do
with anchors).

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [patch] Deal with #ident without
  2012-06-07 11:07     ` Andreas Schwab
@ 2012-06-07 11:34       ` Steven Bosscher
  2012-06-07 13:30         ` [PATCH] genhooks: always bail out if tm.texi lacks place for hook Andreas Schwab
  0 siblings, 1 reply; 12+ messages in thread
From: Steven Bosscher @ 2012-06-07 11:34 UTC (permalink / raw)
  To: Andreas Schwab
  Cc: Michael Eager, Richard Guenther, GCC Patches, hp, rsandifo,
	Nick Clifton, Eric Botcazou

[-- Attachment #1: Type: text/plain, Size: 469 bytes --]

On Thu, Jun 7, 2012 at 12:42 PM, Andreas Schwab <schwab@linux-m68k.org> wrote:
> Steven Bosscher <stevenb.gcc@gmail.com> writes:
>
>> I am not sure what you mean with misplaced.
>
> A nested @deftypefn doesn't look right.  Try make info.  You need to add
> a @hook in tm.texi.in at the right place (output_ident has nothing to do
> with anchors).

Ah, I see. So it should be something like the attached. I'll test
this. Thanks for the help!

Ciao!
Steven

[-- Attachment #2: tm_texi.diff --]
[-- Type: application/octet-stream, Size: 2651 bytes --]

Index: doc/tm.texi
===================================================================
--- doc/tm.texi	(revision 188182)
+++ doc/tm.texi	(working copy)
@@ -7390,6 +7390,10 @@ Output COFF information or DWARF debugging informa
  This target hook need not be defined if the standard form of output for the file format in use is appropriate.
 @end deftypefn
 
+@deftypefn {Target Hook} void TARGET_ASM_OUTPUT_IDENT (const char *@var{name})
+Output a string based on @var{name}, suitable for the @samp{#ident}  directive, or the equivalent directive or pragma in non-C-family languages.  If this hook is not defined, nothing is output for the @samp{#ident}  directive.
+@end deftypefn
+
 @defmac OUTPUT_QUOTED_STRING (@var{stream}, @var{string})
 A C statement to output the string @var{string} to the stdio stream
 @var{stream}.  If you do not call the function @code{output_quoted_string}
@@ -7398,12 +7402,6 @@ the assembler source.  So you can use it to canoni
 of the filename using this macro.
 @end defmac
 
-@defmac ASM_OUTPUT_IDENT (@var{stream}, @var{string})
-A C statement to output something to the assembler file to handle a
-@samp{#ident} directive containing the text @var{string}.  If this
-macro is not defined, nothing is output for a @samp{#ident} directive.
-@end defmac
-
 @deftypefn {Target Hook} void TARGET_ASM_NAMED_SECTION (const char *@var{name}, unsigned int @var{flags}, tree @var{decl})
 Output assembly directives to switch to section @var{name}.  The section
 should have attributes as specified by @var{flags}, which is a bit mask
Index: doc/tm.texi.in
===================================================================
--- doc/tm.texi.in	(revision 188182)
+++ doc/tm.texi.in	(working copy)
@@ -7300,6 +7300,8 @@ for the file format in use is appropriate.
 
 @hook TARGET_ASM_OUTPUT_SOURCE_FILENAME
 
+@hook TARGET_ASM_OUTPUT_IDENT
+
 @defmac OUTPUT_QUOTED_STRING (@var{stream}, @var{string})
 A C statement to output the string @var{string} to the stdio stream
 @var{stream}.  If you do not call the function @code{output_quoted_string}
@@ -7308,12 +7310,6 @@ the assembler source.  So you can use it to canoni
 of the filename using this macro.
 @end defmac
 
-@defmac ASM_OUTPUT_IDENT (@var{stream}, @var{string})
-A C statement to output something to the assembler file to handle a
-@samp{#ident} directive containing the text @var{string}.  If this
-macro is not defined, nothing is output for a @samp{#ident} directive.
-@end defmac
-
 @hook TARGET_ASM_NAMED_SECTION
 Output assembly directives to switch to section @var{name}.  The section
 should have attributes as specified by @var{flags}, which is a bit mask

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH] genhooks: always bail out if tm.texi lacks place for hook
  2012-06-07 11:34       ` Steven Bosscher
@ 2012-06-07 13:30         ` Andreas Schwab
  0 siblings, 0 replies; 12+ messages in thread
From: Andreas Schwab @ 2012-06-07 13:30 UTC (permalink / raw)
  To: GCC Patches

So that it doesn't happen again.  Committed as obvious.

Andreas.

	* genhooks.c (main): Set progname.
	(emit_documentation): Remove variable found_start, always bail out
	when a place is missing.
	* doc/tm.texi.in (C++ ABI): Add @hook
	TARGET_CXX_DECL_MANGLING_CONTEXT.

diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in
index 31dedad..79b9e6e 100644
--- a/gcc/doc/tm.texi.in
+++ b/gcc/doc/tm.texi.in
@@ -10077,6 +10077,8 @@ unloaded. The default is to return false.
 
 @hook TARGET_CXX_ADJUST_CLASS_AT_DEFINITION
 
+@hook TARGET_CXX_DECL_MANGLING_CONTEXT
+
 @node Named Address Spaces
 @section Adding support for named address spaces
 @cindex named address spaces
diff --git a/gcc/genhooks.c b/gcc/genhooks.c
index fc48e45..19bfb5a 100644
--- a/gcc/genhooks.c
+++ b/gcc/genhooks.c
@@ -1,6 +1,6 @@
 /* Process target.def to create initialization macros definition in
    target-hooks-def.h and documentation in target-hooks.texi.
-   Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
+   Copyright (C) 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -120,7 +120,6 @@ emit_documentation (const char *in_fname)
   char buf[1000];
   htab_t start_hooks = htab_create (99, s_hook_hash, s_hook_eq_p, (htab_del) 0);
   FILE *f;
-  bool found_start = false;
 
   /* Enter all the start hooks in start_hooks.  */
   f = fopen (in_fname, "r");
@@ -164,9 +163,8 @@ emit_documentation (const char *in_fname)
 	  if (shp->pos >= 0)
 	    fatal ("Duplicate hook %s\n", sh.name);
 	  shp->pos = i;
-	  found_start = true;
 	}
-      else if (!found_start)
+      else
 	fatal ("No place specified to document hook %s\n", sh.name);
       free (sh.name);
     }
@@ -341,6 +339,8 @@ emit_init_macros (const char *docname)
 int
 main (int argc, char **argv)
 {
+  progname = "genhooks";
+
   if (argc >= 3)
     emit_documentation (argv[2]);
   else
-- 
1.7.10.4

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [patch] Deal with #ident without
  2012-06-07  9:23   ` Richard Guenther
@ 2012-06-19 20:46     ` Steven Bosscher
  2012-06-20  0:51       ` Hans-Peter Nilsson
  0 siblings, 1 reply; 12+ messages in thread
From: Steven Bosscher @ 2012-06-19 20:46 UTC (permalink / raw)
  To: Richard Guenther
  Cc: Andreas Schwab, Michael Eager, GCC Patches, hp, rsandifo,
	Nick Clifton, Eric Botcazou

On Thu, Jun 7, 2012 at 11:22 AM, Richard Guenther
<richard.guenther@gmail.com> wrote:
> On Thu, Jun 7, 2012 at 8:16 AM, Andreas Schwab <schwab@linux-m68k.org> wrote:
>> Steven Bosscher <stevenb.gcc@gmail.com> writes:
>>
>>> Index: doc/tm.texi
>>> ===================================================================
>>> --- doc/tm.texi       (revision 188182)
>>> +++ doc/tm.texi       (working copy)
>>> @@ -5847,6 +5847,10 @@ value is 0.
>>>  @end deftypevr
>>>
>>>  @deftypefn {Target Hook} void TARGET_ASM_OUTPUT_ANCHOR (rtx @var{x})
>>> +
>>> +@deftypefn {Target Hook} void TARGET_ASM_OUTPUT_IDENT (const char *@var{name})
>>> +Generate a string based on @var{name}, suitable for the @samp{#ident}  directive, or the equivalent directive or pragma in non-C-family languages.  If this hook is not defined, nothing is output for the @samp{#ident}  directive.
>>> +@end deftypefn
>>
>> That looks misplaced.
>
> Ok after double-checking the above.

I've now committed this, see r188791.

Ciao!
Steven

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [patch] Deal with #ident without
  2012-06-19 20:46     ` Steven Bosscher
@ 2012-06-20  0:51       ` Hans-Peter Nilsson
  2012-06-20  7:27         ` Steven Bosscher
  0 siblings, 1 reply; 12+ messages in thread
From: Hans-Peter Nilsson @ 2012-06-20  0:51 UTC (permalink / raw)
  To: Steven Bosscher; +Cc: GCC Patches

On Tue, 19 Jun 2012, Steven Bosscher wrote:
> I've now committed this, see r188791.

Breaking cris-elf.  Just try rebuilding cc1:
...../gcc/gcc/../libdecnumber/dpd -I../libdecnumber    \
                /tmp/hpautotest-gcc1/gcc/gcc/config/cris/cris.c -o cris.o
/tmp/hpautotest-gcc1/gcc/gcc/config/cris/cris.c: In function 'cris_asm_output_ident':
/tmp/hpautotest-gcc1/gcc/gcc/config/cris/cris.c:2480: error: 'cgraph_state' undeclared (first use in this function)
/tmp/hpautotest-gcc1/gcc/gcc/config/cris/cris.c:2480: error: (Each undeclared identifier is reported only once
/tmp/hpautotest-gcc1/gcc/gcc/config/cris/cris.c:2480: error: for each function it appears in.)
/tmp/hpautotest-gcc1/gcc/gcc/config/cris/cris.c:2480: error: 'CGRAPH_STATE_PARSING' undeclared (first use in this funct\
ion)
/tmp/hpautotest-gcc1/gcc/gcc/config/cris/cris.c:2478: warning: unused variable 'buf'
/tmp/hpautotest-gcc1/gcc/gcc/config/cris/cris.c:2477: warning: unused variable 'size'
/tmp/hpautotest-gcc1/gcc/gcc/config/cris/cris.c:2476: warning: unused variable 'section_asm_op'
/tmp/hpautotest-gcc1/gcc/gcc/config/cris/cris.c: In function 'cris_option_override':
/tmp/hpautotest-gcc1/gcc/gcc/config/cris/cris.c:2538: error: 'flag_no_gcc_ident' undeclared (first use in this function\
)
make[2]: *** [cris.o] Error 1

brgds, H-P

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [patch] Deal with #ident without
  2012-06-20  0:51       ` Hans-Peter Nilsson
@ 2012-06-20  7:27         ` Steven Bosscher
  0 siblings, 0 replies; 12+ messages in thread
From: Steven Bosscher @ 2012-06-20  7:27 UTC (permalink / raw)
  To: Hans-Peter Nilsson; +Cc: GCC Patches

On Wed, Jun 20, 2012 at 2:21 AM, Hans-Peter Nilsson <hp@bitrange.com> wrote:
> On Tue, 19 Jun 2012, Steven Bosscher wrote:
>> I've now committed this, see r188791.
>
> Breaking cris-elf.  Just try rebuilding cc1:
> ...../gcc/gcc/../libdecnumber/dpd -I../libdecnumber    \
>                /tmp/hpautotest-gcc1/gcc/gcc/config/cris/cris.c -o cris.o
> /tmp/hpautotest-gcc1/gcc/gcc/config/cris/cris.c: In function 'cris_asm_output_ident':
> /tmp/hpautotest-gcc1/gcc/gcc/config/cris/cris.c:2480: error: 'cgraph_state' undeclared (first use in this function)
> /tmp/hpautotest-gcc1/gcc/gcc/config/cris/cris.c:2480: error: (Each undeclared identifier is reported only once
> /tmp/hpautotest-gcc1/gcc/gcc/config/cris/cris.c:2480: error: for each function it appears in.)
> /tmp/hpautotest-gcc1/gcc/gcc/config/cris/cris.c:2480: error: 'CGRAPH_STATE_PARSING' undeclared (first use in this funct\
> ion)
> /tmp/hpautotest-gcc1/gcc/gcc/config/cris/cris.c:2478: warning: unused variable 'buf'
> /tmp/hpautotest-gcc1/gcc/gcc/config/cris/cris.c:2477: warning: unused variable 'size'
> /tmp/hpautotest-gcc1/gcc/gcc/config/cris/cris.c:2476: warning: unused variable 'section_asm_op'
> /tmp/hpautotest-gcc1/gcc/gcc/config/cris/cris.c: In function 'cris_option_override':
> /tmp/hpautotest-gcc1/gcc/gcc/config/cris/cris.c:2538: error: 'flag_no_gcc_ident' undeclared (first use in this function\
> )
> make[2]: *** [cris.o] Error 1

Grr. A merge f*ck-up. This was in my testing tree on the compile farm
but not in the patch I committed:

Index: config/cris/cris.c
===================================================================
--- config/cris/cris.c	(revision 188808)
+++ config/cris/cris.c	(working copy)
@@ -47,6 +47,7 @@ along with GCC; see the file COPYING3.
 #include "optabs.h"
 #include "df.h"
 #include "opts.h"
+#include "cgraph.h"

 /* Usable when we have an amount to add or subtract, and want the
    optimal size of the insn.  */
@@ -2533,10 +2534,6 @@ cris_asm_output_case_end (FILE *stream,
 static void
 cris_option_override (void)
 {
-  /* We don't want an .ident for gcc.
-     It isn't really clear anymore why not.  */
-  flag_no_gcc_ident = true;
-
   if (cris_max_stackframe_str)
     {
       cris_max_stackframe = atoi (cris_max_stackframe_str);

I'm building a cross to cris-elf now, to be sure, and I'll commit this
ASAP after that.

Sorry for this...

Ciao!
Steven

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2012-06-20  7:09 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-06 22:32 [patch] Deal with #ident without Steven Bosscher
2012-06-07  0:03 ` Michael Eager
2012-06-07  6:22 ` Andreas Schwab
2012-06-07  9:23   ` Richard Guenther
2012-06-19 20:46     ` Steven Bosscher
2012-06-20  0:51       ` Hans-Peter Nilsson
2012-06-20  7:27         ` Steven Bosscher
2012-06-07 10:15   ` Steven Bosscher
2012-06-07 11:07     ` Andreas Schwab
2012-06-07 11:34       ` Steven Bosscher
2012-06-07 13:30         ` [PATCH] genhooks: always bail out if tm.texi lacks place for hook Andreas Schwab
2012-06-07 10:09 ` [patch] Deal with #ident without nick clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).