Patchwork un-#ifdef GATHER_STATISTICS

login
register
mail settings
Submitter Jason Merrill
Date July 24, 2012, 5:53 p.m.
Message ID <500EE116.5060002@redhat.com>
Download mbox | patch
Permalink /patch/172985/
State New
Headers show

Comments

Jason Merrill - July 24, 2012, 5:53 p.m.
On 07/23/2012 01:01 PM, Steven Bosscher wrote:
> This large patch makes GATHER_STATISTICS always take a value, 0
> (disabled) or 1 (enabled), and turns all related #ifdef code into
> conditional branches.

Did you test this with --enable-gather-detailed-mem-stats?  It didn't 
build for me, so I fixed it with this change:
Steven Bosscher - July 24, 2012, 6:02 p.m.
On Tue, Jul 24, 2012 at 7:53 PM, Jason Merrill <jason@redhat.com> wrote:
> On 07/23/2012 01:01 PM, Steven Bosscher wrote:
>>
>> This large patch makes GATHER_STATISTICS always take a value, 0
>> (disabled) or 1 (enabled), and turns all related #ifdef code into
>> conditional branches.
>
>
> Did you test this with --enable-gather-detailed-mem-stats?

Yes, of course.

>  It didn't build
> for me, so I fixed it with this change:

Yes, the patch caused some more breakage elsewhere
(--enable-checking=release, which I also tested).

It turns out I had not updated the patch for the breakage I
encountered. Sorry for the mess, and thanks for helping fix it!

Ciao!
Steven

Patch

commit f5585674f40450e840dc9b756fd31810926e7c09
Author: Jason Merrill <jason@redhat.com>
Date:   Tue Jul 24 12:11:00 2012 -0400

    	* bitmap.c (bitmap_descriptor): Adjust order of parameters to
    	match MEM_STAT_DECL.
    	* statistics.h (ALONE_FINAL_MEM_STAT_DECL): Correct typo.

diff --git a/gcc/bitmap.c b/gcc/bitmap.c
index 2b77967..4ac129f 100644
--- a/gcc/bitmap.c
+++ b/gcc/bitmap.c
@@ -68,7 +68,7 @@  eq_descriptor (const void *p1, const void *p2)
 
 /* For given file and line, return descriptor, create new if needed.  */
 static struct bitmap_descriptor *
-bitmap_descriptor (const char *file, const char *function, int line)
+bitmap_descriptor (const char *file, int line, const char *function)
 {
   struct bitmap_descriptor **slot;
   struct loc loc;
diff --git a/gcc/statistics.h b/gcc/statistics.h
index 60fd68a..8ec0a99 100644
--- a/gcc/statistics.h
+++ b/gcc/statistics.h
@@ -29,7 +29,7 @@ 
 #define GCC_MEM_STAT_ARGUMENTS const char * ARG_UNUSED (_loc_name), int ARG_UNUSED (_loc_line), const char * ARG_UNUSED (_loc_function)
 #if GATHER_STATISTICS
 #define ALONE_MEM_STAT_DECL GCC_MEM_STAT_ARGUMENTS
-#define ALONE_FINAL_MEM_STAT_DECL ALONE_MEM_STAT_INFO
+#define ALONE_FINAL_MEM_STAT_DECL ALONE_MEM_STAT_DECL
 #define ALONE_PASS_MEM_STAT _loc_name, _loc_line,  _loc_function
 #define ALONE_FINAL_PASS_MEM_STAT ALONE_PASS_MEM_STAT
 #define ALONE_MEM_STAT_INFO __FILE__, __LINE__, __FUNCTION__