diff mbox

Fix dupplicate declaration of ggc_realloc in gencondmd PR63429

Message ID 1412301208-32726-1-git-send-email-tsaunders@mozilla.com
State New
Headers show

Commit Message

Trevor Saunders Oct. 3, 2014, 1:53 a.m. UTC
From: Trevor Saunders <trev.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  <tsaunders@mozilla.com>

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

Comments

Jeff Law Oct. 3, 2014, 4:02 p.m. UTC | #1
On 10/02/14 19:53, tsaunders@mozilla.com wrote:
> From: Trevor Saunders <trev.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  <tsaunders@mozilla.com>
>
> 	* genconditions.c: Directly include ggc.h before rtl.h.
OK.
jeff
diff mbox

Patch

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\