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]

[PATCH] Fix dupplicate declaration of ggc_realloc in gencondmd PR63429


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


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