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 to fix bootstrap on hppa64-hp-hpux11.23 with HP compiler


This patch fixes bootstrap on hppa64-hp-hpux11.23 with HP's 64-bit
compiler (cc +DD64).  The following issues apply with this compiler:

* It appears to interpret -pedantic as -p (profiling), leading to an
  undefined reference to _mcount when linking makedepend.  Fixed by
  only testing -pedantic when bootstrapping with GCC.

* It doesn't understand inline, and expects extern functions called
  from unused static (inline) functions to be defined (at least at -O0
  which is used for bootstrapping), yielding link errors in generator
  programs where they are not.  Fixed in the case of recog.h by not
  defining the inline function if GENERATOR_FILE, in the case of vec.h
  and bitmap.h by including the corresponding source files in the
  generator programs rather than trying to specify exactly which
  inline functions could be used in generator programs and
  conditioning out the rest.  In turn this requires a definition of
  ggc_free in ggc-none.c.

This patch fixes bootstrap on hppa64-hp-hpux11.23 with HP's 64-bit
compiler.  OK to commit?

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
    jsm@polyomino.org.uk (personal mail)
    joseph@codesourcery.com (CodeSourcery mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)

config:
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.

libcpp:
2005-01-23  Joseph S. Myers  <joseph@codesourcery.com>

	* configure: Regenerate.

gcc:
2005-01-23  Joseph S. Myers  <joseph@codesourcery.com>

	* Makefile.in (BUILD_RTL): Add build/bitmap.o and build/vec.o.
	(genobjnames): Add bitmap.o and vec.o.
	(build/bitmap.o, build/vec.o): Add dependencies.
	* bitmap.c, vec.c: Include "bconfig.h" instead of "config.h" if
	GENERATOR_FILE.
	* recog.c (recog_memoized): Don't define if GENERATOR_FILE.
	* ggc-none.c (ggc_free): Define.

Index: config/warnings.m4
===================================================================
RCS file: /cvs/gcc/gcc/config/warnings.m4,v
retrieving revision 1.1
diff -u -r1.1 warnings.m4
--- config/warnings.m4	24 Sep 2004 21:39:06 -0000	1.1
+++ config/warnings.m4	23 Jan 2005 14:37:00 -0000
@@ -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 @@
 ])# 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 @@
 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
 
Index: libcpp/configure
===================================================================
RCS file: /cvs/gcc/gcc/libcpp/configure,v
retrieving revision 1.11
diff -u -r1.11 configure
--- libcpp/configure	24 Nov 2004 14:00:38 -0000	1.11
+++ libcpp/configure	23 Jan 2005 14:37:01 -0000
@@ -2757,7 +2757,8 @@
 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 @@
 fi
 
 
+fi
+
+
 
 # Only enable with --enable-werror-always until existing warnings are
 # corrected.
Index: gcc/Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Makefile.in,v
retrieving revision 1.1443
diff -u -r1.1443 Makefile.in
--- gcc/Makefile.in	19 Jan 2005 09:31:04 -0000	1.1443
+++ gcc/Makefile.in	23 Jan 2005 14:37:03 -0000
@@ -781,7 +781,7 @@
 BUILD_LIBS = $(BUILD_LIBIBERTY)
 
 BUILD_RTL = build/rtl.o build/read-rtl.o build/ggc-none.o \
-	    build/min-insn-modes.o
+	    build/min-insn-modes.o build/bitmap.o build/vec.o
 BUILD_SUPPORT = build/gensupport.o build/insn-conditions.o
 BUILD_EARLY_SUPPORT = build/gensupport.o build/dummy-conditions.o
 
@@ -2506,7 +2506,8 @@
 	genconstants.o gen-protos.o scan.o fix-header.o scan-decls.o \
 	gencheck.o dummy-conditions.o genconditions.o errors.o ggc-none.o \
 	min-insn-modes.o rtl.o print-rtl.o varray.o gcov-iov.o \
-	insn-conditions.o gengtype-lex.o gengtype-yacc.o genmddeps.o
+	insn-conditions.o gengtype-lex.o gengtype-yacc.o genmddeps.o \
+	bitmap.o vec.o
 
 genobjs=$(genobjnames:%=build/%)
 
@@ -2643,6 +2644,8 @@
 build/genconditions.o : genconditions.c $(RTL_BASE_H) $(BCONFIG_H) \
   $(SYSTEM_H) coretypes.h $(GTM_H) errors.h
 
+build/bitmap.o : bitmap.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) \
+  $(RTL_BASE_H) $(FLAGS_H) $(BASIC_BLOCK_H) $(REGS_H) $(GGC_H) gt-bitmap.h
 build/errors.o : errors.c $(BCONFIG_H) $(SYSTEM_H) errors.h
 build/ggc-none.o : ggc-none.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GGC_H)
 build/min-insn-modes.o : min-insn-modes.c $(BCONFIG_H) system.h $(MACHMODE_H)
@@ -2652,6 +2655,8 @@
   $(RTL_BASE_H)
 build/varray.o: varray.c $(BCONFIG_H) coretypes.h $(GTM_H) $(SYSTEM_H) \
   varray.h $(RTL_BASE_H) $(GGC_H) $(TREE_H) bitmap.h errors.h
+build/vec.o : vec.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h vec.h $(GGC_H) \
+  $(TREE_H) errors.h
 
 #
 # Remake internationalization support.
Index: gcc/bitmap.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/bitmap.c,v
retrieving revision 1.65
diff -u -r1.65 bitmap.c
--- gcc/bitmap.c	26 Nov 2004 07:07:00 -0000	1.65
+++ gcc/bitmap.c	23 Jan 2005 14:37:03 -0000
@@ -1,5 +1,5 @@
 /* Functions to support general ended bitmaps.
-   Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004
+   Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -19,7 +19,11 @@
 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 02111-1307, USA.  */
 
+#ifdef GENERATOR_FILE
+#include "bconfig.h"
+#else
 #include "config.h"
+#endif
 #include "system.h"
 #include "coretypes.h"
 #include "tm.h"
Index: gcc/ggc-none.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ggc-none.c,v
retrieving revision 1.20
diff -u -r1.20 ggc-none.c
--- gcc/ggc-none.c	11 Sep 2004 19:03:23 -0000	1.20
+++ gcc/ggc-none.c	23 Jan 2005 14:37:03 -0000
@@ -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 @@
 {
   return xrealloc (x, size);
 }
+
+void
+ggc_free (void *p)
+{
+  free (p);
+}
Index: gcc/recog.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/recog.h,v
retrieving revision 1.52
diff -u -r1.52 recog.h
--- gcc/recog.h	24 Nov 2004 18:22:27 -0000	1.52
+++ gcc/recog.h	23 Jan 2005 14:37:03 -0000
@@ -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 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 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 @@
     INSN_CODE (insn) = recog (PATTERN (insn), insn, 0);
   return INSN_CODE (insn);
 }
+#endif
 
 /* Nonzero means volatile operands are recognized.  */
 extern int volatile_ok;
Index: gcc/vec.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/vec.c,v
retrieving revision 2.8
diff -u -r2.8 vec.c
--- gcc/vec.c	8 Sep 2004 08:08:55 -0000	2.8
+++ gcc/vec.c	23 Jan 2005 14:37:03 -0000
@@ -1,5 +1,5 @@
 /* Vector API for GNU compiler.
-   Copyright (C) 2004 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
    Contributed by Nathan Sidwell <nathan@codesourcery.com>
 
 This file is part of GCC.
@@ -19,7 +19,11 @@
 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 02111-1307, USA.  */
 
+#ifdef GENERATOR_FILE
+#include "bconfig.h"
+#else
 #include "config.h"
+#endif
 #include "system.h"
 #include "ggc.h"
 #include "vec.h"


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