From 9fcdd8917caba77d188f6facf1623100318cba43 Mon Sep 17 00:00:00 2001
From: Joseph Myers <joseph@codesourcery.com>
Date: Sun, 23 Jan 2005 19:22:01 +0000
Subject: [PATCH] re PR bootstrap/18058 (Bootstrap fails with non-GCC
 compilers)

config:
	* warnings.m4 (ACX_PROG_CC_WARNING_ALMOST_PEDANTIC): Don't do
	anything for non-GCC compilers.

libcpp:
	* configure: Regenerate.

gcc:
	PR bootstrap/18058
	* recog.c (recog_memoized): Don't define if GENERATOR_FILE.
	* ggc-none.c (ggc_free): Define.

From-SVN: r94123
---
 config/ChangeLog   |  5 +++++
 config/warnings.m4 | 10 ++++++----
 gcc/ChangeLog      |  6 ++++++
 gcc/ggc-none.c     |  8 +++++++-
 gcc/recog.h        |  6 +++++-
 libcpp/ChangeLog   |  4 ++++
 libcpp/configure   |  6 +++++-
 7 files changed, 38 insertions(+), 7 deletions(-)

diff --git a/config/ChangeLog b/config/ChangeLog
index 49cbfdda4956..c6885d131dad 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,8 @@
+2005-01-23  Joseph S. Myers  <joseph@codesourcery.com>
+
+	* warnings.m4 (ACX_PROG_CC_WARNING_ALMOST_PEDANTIC): Don't do
+	anything for non-GCC compilers.
+
 2004-12-03  Richard Sandiford  <rsandifo@redhat.com>
 
 	* gxx-include-dir.m4: New file.
diff --git a/config/warnings.m4 b/config/warnings.m4
index 5501be920469..2f44c9222915 100644
--- a/config/warnings.m4
+++ b/config/warnings.m4
@@ -1,6 +1,6 @@
 # Autoconf include file defining macros related to compile-time warnings.
 
-# Copyright 2004 Free Software Foundation, Inc.
+# Copyright 2004, 2005 Free Software Foundation, Inc.
 
 #This file is part of GCC.
 
@@ -43,14 +43,15 @@ CFLAGS="$save_CFLAGS"
 ])# ACX_PROG_CC_WARNING_OPTS
 
 # ACX_PROG_CC_WARNING_ALMOST_PEDANTIC([-Wno-long-long ...])
-#   Sets WARN_PEDANTIC to "-pedantic" + the argument, if the compiler
-#   accepts all of those options simultaneously, otherwise to nothing.
+#   Sets WARN_PEDANTIC to "-pedantic" + the argument, if the compiler is GCC
+#   and accepts all of those options simultaneously, otherwise to nothing.
 AC_DEFUN([ACX_PROG_CC_WARNING_ALMOST_PEDANTIC],
 [AC_REQUIRE([AC_PROG_CC])dnl
 AC_SUBST([WARN_PEDANTIC])dnl
 AS_VAR_PUSHDEF([acx_Pedantic], [acx_cv_prog_cc_pedantic_$1])dnl
 WARN_PEDANTIC=
-AC_CACHE_CHECK([whether $CC supports -pedantic $1], acx_Pedantic,
+AS_IF([test $GCC = yes],
+[AC_CACHE_CHECK([whether $CC supports -pedantic $1], acx_Pedantic,
 [save_CFLAGS="$CFLAGS"
 CFLAGS="-pedantic $1"
 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
@@ -59,6 +60,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
 CFLAGS="$save_CFLAGS"])
 AS_IF([test AS_VAR_GET(acx_Pedantic) = yes],
       [WARN_PEDANTIC="-pedantic $1"])
+])
 AS_VAR_POPDEF([acx_Pedantic])dnl
 ])# ACX_PROG_CC_WARNING_ALMOST_PEDANTIC
 
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 73d25102a933..b8e4a1647155 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2005-01-23  Joseph S. Myers  <joseph@codesourcery.com>
+
+	PR bootstrap/18058
+	* recog.c (recog_memoized): Don't define if GENERATOR_FILE.
+	* ggc-none.c (ggc_free): Define.
+
 2005-01-23  Kazu Hirata  <kazu@cs.umass.edu>
 
 	* cse.c (max_reg, max_insn_uid): Remove.
diff --git a/gcc/ggc-none.c b/gcc/ggc-none.c
index 0cc0c4af33eb..54b7d1507934 100644
--- a/gcc/ggc-none.c
+++ b/gcc/ggc-none.c
@@ -1,5 +1,5 @@
 /* Null garbage collection for the GNU compiler.
-   Copyright (C) 1998, 1999, 2000, 2003, 2004
+   Copyright (C) 1998, 1999, 2000, 2003, 2004, 2005
    Free Software Foundation, Inc.
 
    This file is part of GCC.
@@ -67,3 +67,9 @@ ggc_realloc_stat (void *x, size_t size MEM_STAT_DECL)
 {
   return xrealloc (x, size);
 }
+
+void
+ggc_free (void *p)
+{
+  free (p);
+}
diff --git a/gcc/recog.h b/gcc/recog.h
index 3e88fad58cd5..0c340cc35a08 100644
--- a/gcc/recog.h
+++ b/gcc/recog.h
@@ -1,5 +1,5 @@
 /* Declarations for interface to insn recognizer and insn-output.c.
-   Copyright (C) 1987, 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004
+   Copyright (C) 1987, 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -99,7 +99,9 @@ extern int offsettable_address_p (int, enum machine_mode, rtx);
 extern int mode_dependent_address_p (rtx);
 
 extern int recog (rtx, rtx, int *);
+#ifndef GENERATOR_FILE
 static inline int recog_memoized (rtx insn);
+#endif
 extern void add_clobbers (rtx, int);
 extern int added_clobbers_hard_reg_p (int);
 extern void insn_extract (rtx);
@@ -120,6 +122,7 @@ extern rtx peephole2_insns (rtx, rtx, int *);
 extern int store_data_bypass_p (rtx, rtx);
 extern int if_test_bypass_p (rtx, rtx);
 
+#ifndef GENERATOR_FILE
 /* Try recognizing the instruction INSN,
    and return the code number that results.
    Remember the code so that repeated calls do not
@@ -136,6 +139,7 @@ recog_memoized (rtx insn)
     INSN_CODE (insn) = recog (PATTERN (insn), insn, 0);
   return INSN_CODE (insn);
 }
+#endif
 
 /* Nonzero means volatile operands are recognized.  */
 extern int volatile_ok;
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index d028e664e58d..49055bd51bd3 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,7 @@
+2005-01-23  Joseph S. Myers  <joseph@codesourcery.com>
+
+	* configure: Regenerate.
+
 2005-01-11  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>
 
 	* include/cpplib.h (c_lang): Fix comment to say cpp_create_reader.
diff --git a/libcpp/configure b/libcpp/configure
index 274fb0130e63..604ed847d6f2 100755
--- a/libcpp/configure
+++ b/libcpp/configure
@@ -2757,7 +2757,8 @@ fi
 CFLAGS="$save_CFLAGS"
 
 WARN_PEDANTIC=
-echo "$as_me:$LINENO: checking whether $CC supports -pedantic -Wno-long-long" >&5
+if test $GCC = yes; then
+  echo "$as_me:$LINENO: checking whether $CC supports -pedantic -Wno-long-long" >&5
 echo $ECHO_N "checking whether $CC supports -pedantic -Wno-long-long... $ECHO_C" >&6
 if test "${acx_cv_prog_cc_pedantic__Wno_long_long+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2818,6 +2819,9 @@ if test $acx_cv_prog_cc_pedantic__Wno_long_long = yes; then
 fi
 
 
+fi
+
+
 
 # Only enable with --enable-werror-always until existing warnings are
 # corrected.
-- 
GitLab