[LLVMdev] llvm-gcc fortran bootstrap broken
Duncan Sands
baldrick at free.fr
Wed Jul 30 12:35:31 PDT 2008
And how about this one so as not to include a C specific
header in llvm-backend (!!!) and not to have llvm-backend
use a C specific flag (flag_no_builtin)?
Index: gcc-4.2.llvm/gcc/c-opts.c
===================================================================
--- gcc-4.2.llvm.orig/gcc/c-opts.c 2008-07-30 21:25:28.000000000 +0200
+++ gcc-4.2.llvm/gcc/c-opts.c 2008-07-30 21:26:17.000000000 +0200
@@ -660,6 +660,9 @@
case OPT_fbuiltin:
flag_no_builtin = !value;
+#ifdef LLVM
+ flag_no_simplify_libcalls = !value;
+#endif
break;
case OPT_fbuiltin_:
@@ -685,6 +688,9 @@
case OPT_fhosted:
flag_hosted = value;
flag_no_builtin = !value;
+#ifdef LLVM
+ flag_no_simplify_libcalls = !value;
+#endif
/* warn_main will be 2 if set by -Wall, 1 if set by -Wmain */
if (!value && warn_main == 2)
warn_main = 0;
Index: gcc-4.2.llvm/gcc/flags.h
===================================================================
--- gcc-4.2.llvm.orig/gcc/flags.h 2008-07-30 21:22:44.000000000 +0200
+++ gcc-4.2.llvm/gcc/flags.h 2008-07-30 21:24:50.000000000 +0200
@@ -391,6 +391,7 @@
/* LLVM LOCAL begin */
#ifdef ENABLE_LLVM
extern int flag_llvm_pch_read;
+extern int flag_no_simplify_libcalls;
#endif
/* LLVM LOCAL end */
Index: gcc-4.2.llvm/gcc/llvm-backend.cpp
===================================================================
--- gcc-4.2.llvm.orig/gcc/llvm-backend.cpp 2008-07-30 21:17:36.000000000 +0200
+++ gcc-4.2.llvm/gcc/llvm-backend.cpp 2008-07-30 21:24:42.000000000 +0200
@@ -70,12 +70,14 @@
#include "tree-inline.h"
#include "langhooks.h"
#include "cgraph.h"
-#include "c-common.h"
}
// Non-zero if bytecode from PCH is successfully read.
int flag_llvm_pch_read;
+// Non-zero if libcalls should not be simplified.
+int flag_no_simplify_libcalls;
+
// Global state for the LLVM backend.
Module *TheModule = 0;
DebugInfo *TheDebugInfo = 0;
@@ -381,7 +383,7 @@
PM->add(createFunctionInliningPass()); // Inline small functions
if (optimize > 2)
PM->add(createArgumentPromotionPass()); // Scalarize uninlined fn args
- if (!flag_no_builtin)
+ if (!flag_no_simplify_libcalls)
PM->add(createSimplifyLibCallsPass()); // Library Call Optimizations
PM->add(createInstructionCombiningPass()); // Cleanup for scalarrepl.
PM->add(createJumpThreadingPass()); // Thread jumps.
More information about the llvm-dev
mailing list