This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix dupplicate declaration of ggc_realloc in gencondmd PR63429
- From: tsaunders at mozilla dot com
- To: gcc-patches at gcc dot gnu dot org
- Cc: Trevor Saunders <trev dot saunders at gmail dot com>
- Date: Thu, 2 Oct 2014 21:53:28 -0400
- Subject: [PATCH] Fix dupplicate declaration of ggc_realloc in gencondmd PR63429
- Authentication-results: sourceware.org; auth=none
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(+)
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