llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

constant not unnamed_addr?

Open echristo opened this issue 15 years ago • 2 comments

Bugzilla Link 10416
Resolution INVALID
Resolved on Jul 25, 2011 06:56
Version trunk
OS All
CC @efriedma-quic

Extended Description

From 2006-03-03-MissingInitializer.c it looks like foo.nate should be able to be unnamed_addr and llvm-gcc does that

struct X { int *XX; int Y;};

void foo() { static int nate = 0; struct X bob = { &nate, 14 }; bar(&bob); }

echristo avatar Jul 20 '11 02:07 echristo

I can agree with that.

echristo avatar Jul 20 '11 03:07 echristo

IMO, clang is correct here... "nate" has a distinct address per the standard, and us defaulting to -fmerge-all-constants shouldn't have any effect on something that isn't a constant.

efriedma-quic avatar Jul 20 '11 02:07 efriedma-quic