[llvm-bugs] [Bug 26006] New: Undefined references to static const members of class templates (but not when const is omitted)

2016-01-03 Thread via llvm-bugs
https://llvm.org/bugs/show_bug.cgi?id=26006

Bug ID: 26006
   Summary: Undefined references to static const members of class
templates (but not when const is omitted)
   Product: clang
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: normal
  Priority: P
 Component: C++
  Assignee: unassignedclangb...@nondot.org
  Reporter: sisnk...@gmail.com
CC: dgre...@apple.com, llvm-bugs@lists.llvm.org
Classification: Unclassified

Created attachment 15547
  --> https://llvm.org/bugs/attachment.cgi?id=15547&action=edit
Test program to reproduce

The below program (also attached) produces an undefined reference to
Foo::Bar::m when m is declared as const. Just compile it with clang++
test.cpp. It does not compile with the latest clang from the trunk, nor with
clang 3.5.

However, when m does not have any additional qualifiers or when m is declared
as const volatile, then the program compiles, links, and runs. You can verify
this by defining QUALS as empty or as "const volatile".

GCC compiles and links the program fine.

This code was distilled from xulrunner 24.8.0.

#define QUALSconst
//#define QUALSconst volatile
//#define QUALS

class Foo {
public:
template 
struct Bar {
static QUALS long m;
};

static QUALS long& getter() { return Bar::m; }

static int f();
};

template 
QUALS long Foo::Bar::m = 1;

int Foo::f()
{
return getter();
}

int main()
{
return Foo::f();
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 26007] New: Clang-cl checks on copy-constructor on during initialization

2016-01-03 Thread via llvm-bugs
https://llvm.org/bugs/show_bug.cgi?id=26007

Bug ID: 26007
   Summary: Clang-cl checks on copy-constructor on during
initialization
   Product: clang
   Version: trunk
  Hardware: PC
OS: Windows NT
Status: NEW
  Severity: normal
  Priority: P
 Component: -New Bugs
  Assignee: unassignedclangb...@nondot.org
  Reporter: jva...@gmail.com
CC: llvm-bugs@lists.llvm.org
Classification: Unclassified

Hi,

I'm trying to get some existing MSVC code compiled with clang-cl.
Apparently one of the 'features' of MSVC is that it optimizes initialization
assignment, without checking copy constructor...

Clang correctly checks on this, though clang-cl does this too, which is
unfortunate for existing MSVC code bases.

Following code compiles with MSVC2013 and MSVC2015 and fails with both clang-cl
as clang+c2 (provided by MS)



Code


#include 

int main()
{
std::atomic b = true;
return static_cast(b.load());
}


Generated error

1>MoveSemantics.cpp(10,22): error : copying variable of type
'std::atomic' invokes deleted constructor
1> std::atomic b = true;
1>   ^   
1>  C:\Program Files (x86)\Microsoft Visual Studio
14.0\VC\include\xxatomic(188,2) :  note: 'atomic' has been explicitly marked
deleted here
1>  atomic(const atomic&) = delete;
1>  ^
1>  1 error generated.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 26008] New: Sparc ELF relocations are not supported in RuntimeDyld

2016-01-03 Thread via llvm-bugs
https://llvm.org/bugs/show_bug.cgi?id=26008

Bug ID: 26008
   Summary: Sparc ELF relocations are not supported in RuntimeDyld
   Product: libraries
   Version: trunk
  Hardware: Sun
OS: Linux
Status: NEW
  Severity: normal
  Priority: P
 Component: Backend: Sparc
  Assignee: unassignedb...@nondot.org
  Reporter: gillingham@gmail.com
CC: llvm-bugs@lists.llvm.org
Classification: Unclassified

RuntimeDyldELF.cpp does not support Sparc at all causing jitting to fail.

The relevant code is in lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 26000] [WinEH] asserting loop optimizations with captured variables

2016-01-03 Thread via llvm-bugs
https://llvm.org/bugs/show_bug.cgi?id=26000

David Majnemer  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
   Assignee|unassignedb...@nondot.org   |david.majne...@gmail.com

--- Comment #3 from David Majnemer  ---
Fixed in r256728.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 26007] Clang-cl checks on copy-constructor on during initialization

2016-01-03 Thread via llvm-bugs
https://llvm.org/bugs/show_bug.cgi?id=26007

David Majnemer  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||david.majne...@gmail.com
 Resolution|--- |INVALID

--- Comment #1 from David Majnemer  ---
This is not a bug because clang's compatibility with MSVC stops at the water's
edge.  Our compatibility story is built around making clang acceptable with
Microsoft's header files (the Windows SDK, Direct X SDK, VC++ headers, etc.)
but our compatibility is less strong with user-written code because such code
can easily work with standards conforming compilers like clang and other, less
conforming, compilers.

In this case, the code can be written as:
std::atomic b(true);

Unless you can demonstrate how something like "std::atomic b = true;"
occurs in Microsoft's headers, then I am afraid this bug must be closed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 26009] New: wrong code (that hangs) at -Os and above on x86_64-linux-gnu in 32-bit mode

2016-01-03 Thread via llvm-bugs
https://llvm.org/bugs/show_bug.cgi?id=26009

Bug ID: 26009
   Summary: wrong code (that hangs) at -Os and above on
x86_64-linux-gnu in 32-bit mode
   Product: clang
   Version: trunk
  Hardware: PC
OS: All
Status: NEW
  Severity: normal
  Priority: P
 Component: -New Bugs
  Assignee: unassignedclangb...@nondot.org
  Reporter: s...@cs.ucdavis.edu
CC: llvm-bugs@lists.llvm.org
Classification: Unclassified

The following code is miscompiled by the current clang trunk on
x86_64-linux-gnu at -Os and above in 32-bit mode (but not in 64-bit mode). 

This is a regression from 3.7.x.


$ clang-trunk -v
clang version 3.8.0 (trunk 256693)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/tools/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9.3
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.2.1
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.2.1
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
$ 
$ clang-trunk -m32 -O1 small.c; ./a.out
$ clang-trunk -m64 -Os small.c; ./a.out
$ clang-3.7.0 -m32 -Os small.c; ./a.out
$ 
$ clang-trunk -m32 -Os small.c
$ timeout -s 9 10 ./a.out
Killed
$ clang-trunk -m32 -O2 small.c
$ timeout -s 9 10 ./a.out
Killed
$ clang-trunk -m32 -O3 small.c
$ timeout -s 9 10 ./a.out
Killed
$ 


-


unsigned char a, d, g;
static unsigned char *b = &a, *e = &d;
short c;
int f;

void
fn1 (int p1)
{
  short *h = &c;
  ++*h;
  *e = --*b >> 6 | (g != 0);
  if (a < 240 && c)
for (;;)
  ;
}

int
main ()
{
  fn1 (f);
  return 0;
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs