[llvm-commits] llvm-gcc4: resurrect fortran

Duncan Sands baldrick at free.fr
Wed Jan 17 13:10:38 PST 2007


Link with the common stub routines, and remove the partial set of
stubs that were defined in the front-end.  With this, the fortran
compiler builds, but dies when compiling libgfortran:

llvm-convert.cpp:4243: static llvm::Constant* TreeConstantToLLVM::Convert(tree_node*):
        Assertion `((__extension__ ({ const tree __t = (exp); char const __c = tree_code_type[(int)
        (((enum tree_code) (__t)->common.code))]; if (!((__c) != tcc_type)) tree_class_check_failed
        (__t, tcc_type, "../../gcc.llvm.master/gcc/llvm-convert.cpp", 4243, __FUNCTION__); __t; })
        ->common.constant_flag) || ((enum tree_code) (exp)->common.code) == STRING_CST) &&
        "Isn't a constant!"' failed.

libgfortran/intrinsics/selected_int_kind.f90: In function 'selected_int_kind':
libgfortran/intrinsics/selected_int_kind.f90:22: internal compiler error: Aborted


Index: gcc.llvm.master/gcc/fortran/Make-lang.in
===================================================================
--- gcc.llvm.master.orig/gcc/fortran/Make-lang.in	2007-01-17 21:41:50.000000000 +0100
+++ gcc.llvm.master/gcc/fortran/Make-lang.in	2007-01-17 21:47:04.000000000 +0100
@@ -103,12 +103,15 @@
 	-rm -f gfortran-cross$(exeext)
 	cp gfortran$(exeext) gfortran-cross$(exeext)
 
+# Language-independent object files.
+F95_BACKEND = $(BACKEND) attribs.o stub-objc.o stub-c.o
+
 # The compiler itself is called f951.
 f951$(exeext): $(F95_OBJS) \
-		$(BACKEND) $(LIBDEPS)
+		$(F95_BACKEND) $(LIBDEPS)
 	# APPLE LOCAL LLVM
 	$(LINKCC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
-		$(F95_OBJS) $(BACKEND) $(F95_LIBS)
+		$(F95_OBJS) $(F95_BACKEND) $(F95_LIBS) $(C_STUBS)
 
 gt-fortran-f95-lang.h gtype-fortran.h	      : s-gtype; @true
 gt-fortran-trans-decl.h gt-fortran-trans.h    : s-gtype; @true
Index: gcc.llvm.master/gcc/fortran/f95-lang.c
===================================================================
--- gcc.llvm.master.orig/gcc/fortran/f95-lang.c	2007-01-17 21:41:50.000000000 +0100
+++ gcc.llvm.master/gcc/fortran/f95-lang.c	2007-01-17 21:47:04.000000000 +0100
@@ -154,21 +154,6 @@
 /* APPLE LOCAL disable_typechecking_for_spec_flag */
 int disable_typechecking_for_spec_flag = 0;
 
-/* APPLE LOCAL begin CW asm blocks */
-/* Dummies needed because we use them from cpplib, yuck.  */
-int flag_iasm_blocks;
-int iasm_state;
-int iasm_in_operands;
-/* APPLE LOCAL end CW asm blocks */
-
-/* APPLE LOCAL begin 4174833 */
-tree
-objc_is_class_name (tree ARG_UNUSED (arg))
-{
-  return 0;
-}
-
-/* APPLE LOCAL end 4174833 */
 /* A list (chain of TREE_LIST nodes) of all LABEL_DECLs in the function
    that have names.  Here so we can clear out their names' definitions
    at the end of the function.  */
Index: gcc.llvm.master/gcc/fortran/trans-types.c
===================================================================
--- gcc.llvm.master.orig/gcc/fortran/trans-types.c	2007-01-17 21:41:50.000000000 +0100
+++ gcc.llvm.master/gcc/fortran/trans-types.c	2007-01-17 21:47:04.000000000 +0100
@@ -1752,18 +1752,4 @@
 /* APPLE LOCAL constant cfstrings */
 struct cpp_reader* parse_in;
 
-/* APPLE LOCAL begin AltiVec */
-tree
-build_stmt (enum tree_code code ATTRIBUTE_UNUSED, ...)
-{
-  gcc_assert(0);
-}
-
-void
-store_init_value (tree decl ATTRIBUTE_UNUSED, tree init ATTRIBUTE_UNUSED)
-{
-  gcc_assert(0);
-}
-/* APPLE LOCAL end AltiVec */
-
 #include "gt-fortran-trans-types.h"



More information about the llvm-commits mailing list