The variable expansion part of EmitBIND_EXPR is clearly based on
expand_var in expr.c, however unlike expand_var it doesn't check
for VAR_DECL before calling rest_of_decl_compilation.  This patch
adds the check.  Without it, the Ada run-time fails to build due to
rest_of_decl_compilation getting called for a static CONSTANT_DECL.

Ciao,

Duncan.
Index: gcc.llvm.master/gcc/llvm-convert.cpp
===================================================================
--- gcc.llvm.master.orig/gcc/llvm-convert.cpp	2007-02-28 11:52:22.000000000 +0100
+++ gcc.llvm.master/gcc/llvm-convert.cpp	2007-02-28 12:01:19.000000000 +0100
@@ -1399,7 +1399,8 @@
       tree RealVar = DECL_ORIGIN(Var);
       
       // If we haven't already emitted the var, do so now.
-      if (!TREE_ASM_WRITTEN(RealVar) && !lang_hooks.expand_decl(RealVar))
+      if (!TREE_ASM_WRITTEN(RealVar) && !lang_hooks.expand_decl(RealVar) &&
+	  TREE_CODE (Var) == VAR_DECL)
         rest_of_decl_compilation(RealVar, 0, 0);
       continue;
     }
_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to