Hi rafael,

r218141 "In the Itanium ABI, move stuff to the comdat of variables with static 
init." causes gnu as crash for ARM in some cases:

foo.s: Assembler messages:
foo.s:208: Internal error!
Assertion failure in get_line_subseg at 
crosstool_linaro/src/crosstool-ng-linaro-1.13.1-4.8-2014.01/builds/arm-linux-gnueabi-linux/.build/src/binutils-linaro-2.24-2013.12/gas/dwarf2dbg.c
 line 271.

r218141 handles the comdat of varialbes for Itanium ABI. However, the routine 
is shared by both ARM and Itanium. 
It seems the change should be guarded to Itanium only.

http://reviews.llvm.org/D6366

Files:
  lib/CodeGen/ItaniumCXXABI.cpp
  test/CodeGenCXX/static-data-member.cpp
Index: lib/CodeGen/ItaniumCXXABI.cpp
===================================================================
--- lib/CodeGen/ItaniumCXXABI.cpp
+++ lib/CodeGen/ItaniumCXXABI.cpp
@@ -1695,7 +1695,8 @@
 
     // The ABI says: It is suggested that it be emitted in the same COMDAT group
     // as the associated data object
-    if (!D.isLocalVarDecl() && var->isWeakForLinker() && CGM.supportsCOMDAT()) {
+    if (!UseARMGuardVarABI && !D.isLocalVarDecl() && var->isWeakForLinker()
+        && CGM.supportsCOMDAT()) {
       llvm::Comdat *C = CGM.getModule().getOrInsertComdat(var->getName());
       guard->setComdat(C);
       var->setComdat(C);
Index: test/CodeGenCXX/static-data-member.cpp
===================================================================
--- test/CodeGenCXX/static-data-member.cpp
+++ test/CodeGenCXX/static-data-member.cpp
@@ -1,6 +1,8 @@
 // RUN: %clang_cc1 -triple x86_64-pc-linux -emit-llvm -o - %s | FileCheck %s
 // RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -o - %s | \
 // RUN: FileCheck --check-prefix=MACHO %s
+// RUN: %clang_cc1 -triple arm-apple-darwin -emit-llvm -o - %s | \
+// RUN: FileCheck --check-prefix=ARM %s
 
 // CHECK: @_ZN5test11A1aE = constant i32 10, align 4
 // CHECK: @_ZN5test212_GLOBAL__N_11AIiE1xE = internal global i32 0, align 4
@@ -8,6 +10,7 @@
 // CHECK: @_ZGVN5test31AIiE1xE = weak_odr global i64 0, comdat $_ZN5test31AIiE1xE
 // MACHO: @_ZGVN5test31AIiE1xE = weak_odr global i64 0
 // MACHO-NOT: comdat
+// ARM-NOT: comdat
 
 // CHECK: _ZN5test51U2k0E = global i32 0
 // CHECK: _ZN5test51U2k1E = global i32 0
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to