This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [vta,vta4.3,trunk?] don't compute DECL_ASSEMBLER_NAME because of debugging dumps


On Sep 17, 2008, Ian Lance Taylor <iant@google.com> wrote:

> Alexandre Oliva <aoliva@redhat.com> writes:
>> fprintf (dump_orig, " (%s)\n",
>> -	       IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (fndecl)));
>> +	       !DECL_ASSEMBLER_NAME_SET_P (fndecl) ? NULL
>> +	       : IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (fndecl)));

> Don't pass NULL to fprintf for a %s argument.

> Use parentheses around the multi-line ternary expression.

> A patch to pass "null", or similar, instead is OK.

Thanks, sorry about the delay.

I'm installing the first patch below to fix the VTA branch, and the
second to bring in both changes into the trunk.  Tested on
x86_64-linux-gnu.

for  gcc/ChangeLog.vta
from  Alexandre Oliva  <aoliva@redhat.com>

	* c-gimplify.c (c_genericize): Don't pass NULL to printf %s.
	Enclose multi-line ternary expression in parentheses.

Index: gcc/c-gimplify.c
===================================================================
--- gcc/c-gimplify.c.orig	2008-10-07 15:52:03.000000000 -0300
+++ gcc/c-gimplify.c	2008-10-07 15:52:49.000000000 -0300
@@ -88,8 +88,8 @@ c_genericize (tree fndecl)
       fprintf (dump_orig, "\n;; Function %s",
 	       lang_hooks.decl_printable_name (fndecl, 2));
       fprintf (dump_orig, " (%s)\n",
-	       !DECL_ASSEMBLER_NAME_SET_P (fndecl) ? NULL
-	       : IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (fndecl)));
+	       (!DECL_ASSEMBLER_NAME_SET_P (fndecl) ? "null"
+		: IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (fndecl))));
       fprintf (dump_orig, ";; enabled by -%s\n", dump_flag_name (TDI_original));
       fprintf (dump_orig, "\n");
 
for  gcc/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* c-gimplify.c (c_genericize): Don't refer to DECL_ASSEMBLER_NAME
	before ensuring it's already computed.

Index: gcc/c-gimplify.c
===================================================================
--- gcc/c-gimplify.c.orig	2008-07-31 03:19:59.000000000 -0300
+++ gcc/c-gimplify.c	2008-10-07 16:38:50.000000000 -0300
@@ -2,7 +2,8 @@
    by the C-based front ends.  The structure of gimplified, or
    language-independent, trees is dictated by the grammar described in this
    file.
-   Copyright (C) 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008
+   Free Software Foundation, Inc.
    Lowering of expressions contributed by Sebastian Pop <s.pop@laposte.net>
    Re-written to support lowering of whole function trees, documentation
    and miscellaneous cleanups by Diego Novillo <dnovillo@redhat.com>
@@ -87,7 +88,8 @@ c_genericize (tree fndecl)
       fprintf (dump_orig, "\n;; Function %s",
 	       lang_hooks.decl_printable_name (fndecl, 2));
       fprintf (dump_orig, " (%s)\n",
-	       IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (fndecl)));
+	       (!DECL_ASSEMBLER_NAME_SET_P (fndecl) ? "null"
+		: IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (fndecl))));
       fprintf (dump_orig, ";; enabled by -%s\n", dump_flag_name (TDI_original));
       fprintf (dump_orig, "\n");
 

-- 
Alexandre Oliva         http://www.lsd.ic.unicamp.br/~oliva/
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}
FSFLA Board Member       ÂSÃ Libre! => http://www.fsfla.org/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]