Closed nenadv closed 10 years ago
It is caused by the following code in lib/CodeGen/CGExprAgg.cpp:
1135 if (Dest.isShared()) {
1136 // This shouldn't be reachable. It's just here
1137 // to catch any changes.
1138 llvm_unreachable("Can't initialize a shared array here.");
1139 return;
1140 }
llvm_unreachable() is an exception and will abort the compilation. Maybe that was not the case in 3.3 (llvm_unreachable just returned a warning) and we were able to simple return without the abort (which is collaborated by the presence of the above string in the expected result for our clang-upc test suite). If I remove the call to llvm_unreachable call everything works.
I am thinking of changing the code:
diff --git a/lib/CodeGen/CGExprAgg.cpp b/lib/CodeGen/CGExprAgg.cpp
index 988ac6b..2ab6263 100644
--- a/lib/CodeGen/CGExprAgg.cpp
+++ b/lib/CodeGen/CGExprAgg.cpp
@@ -1133,9 +1133,8 @@ void AggExprEmitter::VisitInitListExpr(InitListExpr *E) {
return Visit(E->getInit(0));
if (Dest.isShared()) {
- // This shouldn't be reachable. It's just here
- // to catch any changes.
- llvm_unreachable("Can't initialize a shared array here.");
+ // We do not handle shared array initialization.
+ // Error was already reported.
return;
}
With this patch we just report an error. This will require for the test suite to change the expected output as the above llvm_unreachable() string is not available any more.
After upgrade to 3.4 this test crashes the compiler.