[cfe-commits] r138418 - in /cfe/trunk: lib/CodeGen/CGDecl.cpp test/CodeGen/2005-02-27-MarkGlobalConstant.c test/CodeGen/decl.c test/CodeGen/string-literal-short-wstring.c test/CodeGen/string-literal.c

Nico Weber thakis at chromium.org
Sat Aug 27 17:45:53 PDT 2011


Hi Eric,

with this change, ld crashes on our buildbots when linking chromium's
unit_tests binary. The bots are using the ld that comes with Xcode
3.2.2 (BuildVersion: 20m2148):

  @(#)PROGRAM:ld  PROJECT:ld64-97.2
  llvm version 2.6svn,  Apple Build #2207-05

I can't reproduce this locally, but I'm using Xcode 3.2.3
(BuildVersion: 10M2262):

  @(#)PROGRAM:ld  PROJECT:ld64-97.14
  llvm version 2.7svn,  Apple Build #2326-10

When a change in clang makes ld crash when linking the code produced
by clang, is this something you care about? (We essentially use trunk
clang with the Xcode 3.2 toolchain.)

Nico

On Wed, Aug 24, 2011 at 12:33 AM, Eric Christopher <echristo at apple.com> wrote:
> Author: echristo
> Date: Tue Aug 23 19:33:55 2011
> New Revision: 138418
>
> URL: http://llvm.org/viewvc/llvm-project?rev=138418&view=rev
> Log:
> Make constant aggregate constant initializers private linkage.
> After talking with John making this the case for all of these is
> the right way to go.
>
> Fixes rdar://9804564 and PR10414
>
> Modified:
>    cfe/trunk/lib/CodeGen/CGDecl.cpp
>    cfe/trunk/test/CodeGen/2005-02-27-MarkGlobalConstant.c
>    cfe/trunk/test/CodeGen/decl.c
>    cfe/trunk/test/CodeGen/string-literal-short-wstring.c
>    cfe/trunk/test/CodeGen/string-literal.c
>
> Modified: cfe/trunk/lib/CodeGen/CGDecl.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDecl.cpp?rev=138418&r1=138417&r2=138418&view=diff
> ==============================================================================
> --- cfe/trunk/lib/CodeGen/CGDecl.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGDecl.cpp Tue Aug 23 19:33:55 2011
> @@ -982,7 +982,7 @@
>     std::string Name = GetStaticDeclName(*this, D, ".");
>     llvm::GlobalVariable *GV =
>       new llvm::GlobalVariable(CGM.getModule(), constant->getType(), true,
> -                               llvm::GlobalValue::InternalLinkage,
> +                               llvm::GlobalValue::PrivateLinkage,
>                                constant, Name, 0, false, 0);
>     GV->setAlignment(alignment.getQuantity());
>     GV->setUnnamedAddr(true);
>
> Modified: cfe/trunk/test/CodeGen/2005-02-27-MarkGlobalConstant.c
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2005-02-27-MarkGlobalConstant.c?rev=138418&r1=138417&r2=138418&view=diff
> ==============================================================================
> --- cfe/trunk/test/CodeGen/2005-02-27-MarkGlobalConstant.c (original)
> +++ cfe/trunk/test/CodeGen/2005-02-27-MarkGlobalConstant.c Tue Aug 23 19:33:55 2011
> @@ -1,5 +1,4 @@
>  // RUN: %clang_cc1  %s -emit-llvm -o - | FileCheck %s
> -// XFAIL: *
>  // PR10414
>
>  // The synthetic global made by the CFE for big initializer should be marked
>
> Modified: cfe/trunk/test/CodeGen/decl.c
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/decl.c?rev=138418&r1=138417&r2=138418&view=diff
> ==============================================================================
> --- cfe/trunk/test/CodeGen/decl.c (original)
> +++ cfe/trunk/test/CodeGen/decl.c Tue Aug 23 19:33:55 2011
> @@ -1,11 +1,11 @@
>  // RUN: %clang_cc1 -w -emit-llvm < %s | FileCheck %s
>
>  // CHECK: @test1.x = internal constant [12 x i32] [i32 1
> -// CHECK: @test2.x = internal unnamed_addr constant [13 x i32] [i32 1,
> +// CHECK: @test2.x = private unnamed_addr constant [13 x i32] [i32 1,
>  // CHECK: @test5w = global { i32, [4 x i8] } { i32 2, [4 x i8] undef }
>  // CHECK: @test5y = global { double } { double 7.300000e+0{{[0]*}}1 }
>
> -// CHECK: @test6.x = internal unnamed_addr constant %struct.SelectDest { i8 1, i8 2, i32 3, i32 0 }
> +// CHECK: @test6.x = private unnamed_addr constant %struct.SelectDest { i8 1, i8 2, i32 3, i32 0 }
>
>  // CHECK: @test7 = global [2 x %struct.test7s] [%struct.test7s { i32 1, i32 2 }, %struct.test7s { i32 4, i32 0 }]
>
> @@ -24,7 +24,7 @@
>   // This should codegen as a "@test2.x" global + memcpy.
>   int x[] = { 1, 2, 3, 4, 6, 8, 9, 10, 123, 231, 123,23, 24 };
>   foo(x);
> -
> +
>   // CHECK: @test2()
>   // CHECK: %x = alloca [13 x i32]
>   // CHECK: call void @llvm.memcpy
> @@ -36,7 +36,7 @@
>   // This should codegen as a memset.
>   int x[100] = { 0 };
>   foo(x);
> -
> +
>   // CHECK: @test3()
>   // CHECK: %x = alloca [100 x i32]
>   // CHECK: call void @llvm.memset
>
> Modified: cfe/trunk/test/CodeGen/string-literal-short-wstring.c
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/string-literal-short-wstring.c?rev=138418&r1=138417&r2=138418&view=diff
> ==============================================================================
> --- cfe/trunk/test/CodeGen/string-literal-short-wstring.c (original)
> +++ cfe/trunk/test/CodeGen/string-literal-short-wstring.c Tue Aug 23 19:33:55 2011
> @@ -3,7 +3,7 @@
>
>  int main() {
>   // This should convert to utf8.
> -  // CHECK: internal unnamed_addr constant [10 x i8] c"\E1\84\A0\C8\A0\F4\82\80\B0\00", align 1
> +  // CHECK: private unnamed_addr constant [10 x i8] c"\E1\84\A0\C8\A0\F4\82\80\B0\00", align 1
>   char b[10] = "\u1120\u0220\U00102030";
>
>   // CHECK: private unnamed_addr constant [6 x i8] c"A\00B\00\00\00"
>
> Modified: cfe/trunk/test/CodeGen/string-literal.c
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/string-literal.c?rev=138418&r1=138417&r2=138418&view=diff
> ==============================================================================
> --- cfe/trunk/test/CodeGen/string-literal.c (original)
> +++ cfe/trunk/test/CodeGen/string-literal.c Tue Aug 23 19:33:55 2011
> @@ -5,13 +5,13 @@
>  #include <stddef.h>
>
>  int main() {
> -  // CHECK-C: internal unnamed_addr constant [10 x i8] c"abc\00\00\00\00\00\00\00", align 1
> -  // CHECK-CPP0X: internal unnamed_addr constant [10 x i8] c"abc\00\00\00\00\00\00\00", align 1
> +  // CHECK-C: private unnamed_addr constant [10 x i8] c"abc\00\00\00\00\00\00\00", align 1
> +  // CHECK-CPP0X: private unnamed_addr constant [10 x i8] c"abc\00\00\00\00\00\00\00", align 1
>   char a[10] = "abc";
>
>   // This should convert to utf8.
> -  // CHECK-C: internal unnamed_addr constant [10 x i8] c"\E1\84\A0\C8\A0\F4\82\80\B0\00", align 1
> -  // CHECK-CPP0X: internal unnamed_addr constant [10 x i8] c"\E1\84\A0\C8\A0\F4\82\80\B0\00", align 1
> +  // CHECK-C: private unnamed_addr constant [10 x i8] c"\E1\84\A0\C8\A0\F4\82\80\B0\00", align 1
> +  // CHECK-CPP0X: private unnamed_addr constant [10 x i8] c"\E1\84\A0\C8\A0\F4\82\80\B0\00", align 1
>   char b[10] = "\u1120\u0220\U00102030";
>
>   // CHECK-C: private unnamed_addr constant [12 x i8] c"A\00\00\00B\00\00\00\00\00\00\00", align 4
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>




More information about the cfe-commits mailing list