Discussion:
[PATCH] Fix dupplicate declaration of ggc_realloc in gencondmd PR63429
t***@mozilla.com
2014-10-03 01:53:28 UTC
Permalink
From: Trevor Saunders <***@gmail.com>

Hi,

If vec.h is included before ggc.h it forward declares ggc_realloc with
defaulted arguments. This means ggc.h can not be included later because
it would lead to a second declaration of ggc_realloc with defaulted
arguments. In generator programs vec.h can not include ggc.h because it
may not exist yet. So generator programs must make sure they include
ggc.h before anything that includes vec.h.

bootstrapped + regtested x86_64-unknown-linux-gnu, and bootstrapped with
--enable-gather-detailed-mem-stats, ok?

Trev

gcc/ChangeLog:

2014-10-02 Trevor Saunders <***@mozilla.com>

* genconditions.c: Directly include ggc.h before rtl.h.
---
gcc/genconditions.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/gcc/genconditions.c b/gcc/genconditions.c
index 8390797..048a992 100644
--- a/gcc/genconditions.c
+++ b/gcc/genconditions.c
@@ -70,6 +70,7 @@ write_header (void)
#include \"coretypes.h\"\n\
#include \"tm.h\"\n\
#include \"insn-constants.h\"\n\
+#include \"ggc.h\"\n\
#include \"rtl.h\"\n\
#include \"tm_p.h\"\n\
#include \"function.h\"\n\
--
2.1.1
Jeff Law
2014-10-03 16:02:50 UTC
Permalink
Post by t***@mozilla.com
Hi,
If vec.h is included before ggc.h it forward declares ggc_realloc with
defaulted arguments. This means ggc.h can not be included later because
it would lead to a second declaration of ggc_realloc with defaulted
arguments. In generator programs vec.h can not include ggc.h because it
may not exist yet. So generator programs must make sure they include
ggc.h before anything that includes vec.h.
bootstrapped + regtested x86_64-unknown-linux-gnu, and bootstrapped with
--enable-gather-detailed-mem-stats, ok?
Trev
* genconditions.c: Directly include ggc.h before rtl.h.
OK.
jeff

Loading...