[llvm-bugs] [Bug 33609] New: Incorrect error with -E -CC and comments in macro parameters

2017-06-27 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=33609

Bug ID: 33609
   Summary: Incorrect error with -E -CC and comments in macro
parameters
   Product: clang
   Version: 4.0
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: -New Bugs
  Assignee: unassignedclangb...@nondot.org
  Reporter: jonathanmueller@gmail.com
CC: llvm-bugs@lists.llvm.org

Given the following file:

#define FOO(a /* comment */)

Preprocessing it with `clang++ -E -CC file.cpp` yields the following error:

file.cpp:1:15: error: expected comma in macro parameter list

GCC with the same flags accepts the code.

The problem here seems to be that the -CC option doesn't skip any comments
which leads to this error while GCC does skip them.

-- 
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 26195] NestedNameSpecifierLoc has wrong source range

2017-06-27 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=26195

Alex Lorenz  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||arpha...@gmail.com
 Resolution|--- |FIXED

--- Comment #10 from Alex Lorenz  ---
Fixed in r306392

-- 
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 33610] New: Semantics of __attribute__((target("...")) on platforms without the feature

2017-06-27 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=33610

Bug ID: 33610
   Summary: Semantics of __attribute__((target("...")) on
platforms without the feature
   Product: clang
   Version: trunk
  Hardware: PC
OS: All
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Documentation
  Assignee: unassignedclangb...@nondot.org
  Reporter: gonzalob...@gmail.com
CC: llvm-bugs@lists.llvm.org

Intrinsics in the AVX headers are annotated with
__attribute__((__target__("avx"))) and have no preconditions. 

The documentation of the target attribute is here:
https://clang.llvm.org/docs/AttributeReference.html#target-gnu-target

It doesn't specify any pre/post conditions either.

What are the semantics of calling such a function on a target that does not
support the feature specified by the target attribute?

In practice I can get a SIGILL exception, but am I guaranteed to get one (and
can I reliably catch it?)? That is, is this defined or implementation defined
behavior? If is so, how and where is it defined? Otherwise, is this undefined
behavior? And if so, where is this undefined(clang, llvm, the assembler, the
cpu)?

-- 
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 33611] New: [SimplifyCFG] ValueTracking should support icmps fed by 'and'

2017-06-27 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=33611

Bug ID: 33611
   Summary: [SimplifyCFG] ValueTracking should support icmps fed
by 'and'
   Product: libraries
   Version: trunk
  Hardware: PC
OS: Windows NT
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Scalar Optimizations
  Assignee: unassignedb...@nondot.org
  Reporter: mcros...@codeaurora.org
CC: llvm-bugs@lists.llvm.org

--- C test case ---
void foo(void);
void bar(void);
void test(unsigned *a, unsigned *b) {
  if (a && b) {
bar();
if (a == 0)
  foo();
  }
}

--- IR test case ---
declare void @foo()
declare void @bar()

define void @test(i32* %a, i32* %b) local_unnamed_addr #0 {
entry:
  %tobool = icmp ne i32* %a, null
  %tobool1 = icmp ne i32* %b, null
  %or.cond = and i1 %tobool, %tobool1
  br i1 %or.cond, label %if.then, label %if.end3

if.then:  ; preds = %entry
  call void @bar() #2
  %cmp = icmp eq i32* %a, null
  br i1 %cmp, label %if.then2, label %if.end3

if.then2: ; preds = %if.then
  call void @foo() #2
  br label %if.end3

if.end3:  ; preds = %if.then,
%if.then2, %entry
  ret void
}


In the above test case, SimplifyCFG should be able to prove that '%cmp = icmp
eq i32* %a, null' is false based on a dominating condition and in turn convert
'br i1 %cmp, label %if.then2, label %if.end3' to an unconditional branch to
if.end3.

To catch this case, isImpliedCondition() in ValueTracking.cpp needs to support
icmps that are fed by 'and' instructions.  Something similar to:
-
  if (!InvertAPred && match(LHS, m_And(m_Value(ALHS), m_Value(ARHS {
if (Optional Implication = isImpliedCondition(ALHS, RHS, DL,
InvertAPred, Depth, AC, CxtI, DT))
  return Implication;
if (Optional Implication = isImpliedCondition(ARHS, RHS, DL,
InvertAPred, Depth, AC, CxtI, DT))
  return Implication;
return None;
  }
-

This case is handled in JumpThreading, but catching this case in SimplifyCFG
may reduce compile-time.

-- 
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 33580] Inconsistent Wunused-value warning with respect to macros

2017-06-27 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=33580

David Blaikie  changed:

   What|Removed |Added

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

--- Comment #1 from David Blaikie  ---
I believe this behavior is intentional as there are many macros that produce
values (as "return value"-like results) that would otherwise trigger the unused
value warning, so the warning is suppressed from a macro context like this.

-- 
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 33612] New: ARM: Add range thunk support to avoid relocation R_ARM_THM_CALL out of range

2017-06-27 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=33612

Bug ID: 33612
   Summary: ARM: Add range thunk support to avoid relocation
R_ARM_THM_CALL out of range
   Product: lld
   Version: unspecified
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: ELF
  Assignee: unassignedb...@nondot.org
  Reporter: peter.sm...@linaro.org
CC: llvm-bugs@lists.llvm.org

The range of ARM branch instructions is limited. The ABI allows object
producers to assume that a linker can extend the range of branches via the use
of range extension thunks/stubs/veneers. These are pieces of code that are
inserted between branches that turn a range limited direct call into (usually)
an indirect call via the register r12 (ABI reserved).

lld does not currently implement range extension thunks so we can quite easily
write a program that has a relocation out of range error.

.syntax unified
.thumb
.section .text.1 ,"ax", %progbits
.global low
.type low, %function
low:
bl high
bx lr
// Thumb2 branch range is 16Mb
.space 20 * 1024 * 1024

.section .text.2 ,"ax", %progbits
.global high
.type high, %function
high:
bl low
bx lr

llvm-mc -triple=armv7a-linux-gnueabihf long.s -filetype=obj -o long.o
ld.lld long.o -o long.axf
error: long.o:(.text.2+0x0): relocation R_ARM_THM_CALL out of range
error: long.o:(.text.1+0x0): relocation R_ARM_THM_CALL out of range


Range thunks are currently in review, this pr is here so that if people run
into the relocation R_ARM_THM_CALL they know that work is in progress to
support it.

Initial set of upstream Reviews:
D34035 [LLD][ELF] Introduce Thunk reuse compatibility (1/11).
D34037 [LLD][ELF] Allow multiple thunks to be added for a symbol. (2/11)
D34344 [LLD][ELF] Extract allocateHeaders() from assignAddresses() (3/11)
D34345 [LLD][ELF] Reset any accumulated state before calculating addresses
(4/11)
D34688 [LLD][ELF] Add call to assignAddresses() before createThunks() [NFC]
(5/11)
D34689 [LLD][ELF] Pre-create ThunkSections at Target specific intervals (6/11)
D34690 [LLD][ELF] Introduce target specific inBranchRange() function (7/11)
D34691 [LLD][ELF] Introduce range extension thunks for ARM (8/11)
D34692 [LLD][ELF] Add support for multiple passes to createThunks() (9/11)
D31666 [LLD][ELF] Add test cases for range extension thunks using linker
scripts (10/11)
D31665 [LLD][ELF] Add test cases for range extension thunks (no linkerscripts)
(11/11)

-- 
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 33602] c++ filt unable to demangle lambdas in destructors

2017-06-27 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=33602

Erik Pilkington  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #3 from Erik Pilkington  ---
Looks like this was fixed by r303737, guess it hasn't made its way into apple
llvm.

-- 
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 33613] New: Instruction does not dominate all uses on x86-64 while compiling 511.povray_r from SPEC CPU 2017

2017-06-27 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=33613

Bug ID: 33613
   Summary: Instruction does not dominate all uses on x86-64 while
compiling 511.povray_r from SPEC CPU 2017
   Product: new-bugs
   Version: unspecified
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: new bugs
  Assignee: unassignedb...@nondot.org
  Reporter: reg...@cs.utah.edu
CC: llvm-bugs@lists.llvm.org

regehr@john-home:~/reduce$ clang++ -v
clang version 5.0.0 (trunk 306414)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/regehr/llvm-install/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.4.0
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/6.0.0
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.5
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
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.0.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
Found CUDA installation: /usr/local/cuda, version 8.0
regehr@john-home:~/reduce$ cat small.cpp
typedef struct { double a[15]; } b;
b *c;
int d, e;
void g() {
  b h;
  int a;
  double f, i;
  for (; c <= &h; c++) {
f = c->a[d];
if (i * f)
  a++;
i = f;
  }
  e = a;
}
regehr@john-home:~/reduce$ clang++ -c -O -march=native small.cpp
Instruction does not dominate all uses!
  %74 = insertelement <4 x double> %73, double %42, i32 3
  %59 = shufflevector <4 x double> %vector.recur, <4 x double> %74, <4 x i32>

Instruction does not dominate all uses!
  %74 = insertelement <4 x double> %73, double %42, i32 3
  %60 = shufflevector <4 x double> %74, <4 x double> %70, <4 x i32> 
Instruction does not dominate all uses!
  %70 = insertelement <4 x double> %69, double %46, i32 3
  %60 = shufflevector <4 x double> %74, <4 x double> %70, <4 x i32> 
Instruction does not dominate all uses!
  %70 = insertelement <4 x double> %69, double %46, i32 3
  %61 = shufflevector <4 x double> %70, <4 x double> %66, <4 x i32> 
Instruction does not dominate all uses!
  %66 = insertelement <4 x double> %65, double %50, i32 3
  %61 = shufflevector <4 x double> %70, <4 x double> %66, <4 x i32> 
Instruction does not dominate all uses!
  %66 = insertelement <4 x double> %65, double %50, i32 3
  %62 = shufflevector <4 x double> %66, <4 x double> %58, <4 x i32> 
fatal error: error in backend: Broken function found, compilation aborted!
clang-5.0: error: clang frontend command failed with exit code 70 (use -v to
see invocation)
clang version 5.0.0 (trunk 306414)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/regehr/llvm-install/bin
clang-5.0: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
clang-5.0: note: diagnostic msg: 


PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-5.0: note: diagnostic msg: /tmp/small-fc3c0d.cpp
clang-5.0: note: diagnostic msg: /tmp/small-fc3c0d.sh
clang-5.0: note: diagnostic msg: 


regehr@john-home:~/reduce$

-- 
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 33614] New: [X86][SSE] Recognise v2i64 comparison patterns

2017-06-27 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=33614

Bug ID: 33614
   Summary: [X86][SSE] Recognise v2i64 comparison patterns
   Product: libraries
   Version: trunk
  Hardware: PC
OS: Windows NT
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Backend: X86
  Assignee: unassignedb...@nondot.org
  Reporter: llvm-...@redking.me.uk
CC: llvm-bugs@lists.llvm.org

Before SSE41/SSE42, the only way to compare eq/gt v2i64 vectors was to use the
v4i32 intrinsics:

__m128i alt_cmpeq_epi64(__m128i a, __m128i b) {
  __m128i c = _mm_cmpeq_epi32(a, b);
  return _mm_and_si128( c, _mm_shuffle_epi32( c, _MM_SHUFFLE(2,3,0,1) ) );
}

__m128i alt_cmpgt_epi64(__m128i a, __m128i b) {
  __m128i flip = _mm_setr_epi32( 0x8000,0x,0x8000,0x );
  a = _mm_xor_si128( a, flip );
  b = _mm_xor_si128( b, flip );
  __m128i gt = _mm_cmpgt_epi32( a, b );
  __m128i gt0 = _mm_shuffle_epi32( gt, _MM_SHUFFLE(2,2,0,0) );
  __m128i gt1 = _mm_shuffle_epi32( gt, _MM_SHUFFLE(3,3,1,1) );
  __m128i eq = _mm_cmpeq_epi32( a, b );
  __m128i eq0 = _mm_shuffle_epi32( eq, _MM_SHUFFLE(3,3,1,1) );
  return _mm_or_si128( _mm_and_si128( gt0, eq0 ), gt1 );
}


__m128i alt_cmpgt_epu64(__m128i a, __m128i b) {
  __m128i flip = _mm_set1_epi32( 0x8000 );
  a = _mm_xor_si128( a, flip );
  b = _mm_xor_si128( b, flip );
  __m128i gt = _mm_cmpgt_epi32( a, b );
  __m128i gt0 = _mm_shuffle_epi32( gt, _MM_SHUFFLE(2,2,0,0) );
  __m128i gt1 = _mm_shuffle_epi32( gt, _MM_SHUFFLE(3,3,1,1) );
  __m128i eq = _mm_cmpeq_epi32( a, b );
  __m128i eq0 = _mm_shuffle_epi32( eq, _MM_SHUFFLE(3,3,1,1) );
  return _mm_or_si128( _mm_and_si128( gt0, eq0 ), gt1 );
}

Resulting in quite a bit of legacy code that still uses this (I've only seen
this in __m128i code). We should be trying to simplify this where possible.

-- 
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 33615] New: [inline asm; x86] regression in support of "A" constraint, selecting rax instead of eax

2017-06-27 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=33615

Bug ID: 33615
   Summary: [inline asm; x86] regression in support of "A"
constraint, selecting rax instead of eax
   Product: new-bugs
   Version: 4.0
  Hardware: PC
OS: Linux
Status: NEW
  Severity: normal
  Priority: P
 Component: new bugs
  Assignee: unassignedb...@nondot.org
  Reporter: eric.schwe...@pgroup.com
CC: llvm-bugs@lists.llvm.org

int a,b,x;

int test() {
asm ( 
"movl%1,%0;"
"addl   %2,%0"
: "=A" (x) : "D" (a), "S" (b) );
}

This compiles with clang 3.9, but not with clang 4.0.

foo.c:22:2: error: invalid operand for instruction
"movl%1,%0;"
^
:1:15: note: instantiated into assembly here
movl%edi,%rax;addl  %esi,%rax
 ^
foo.c:22:2: error: invalid operand for instruction
"movl%1,%0;"
^
:1:30: note: instantiated into assembly here
movl%edi,%rax;addl  %esi,%rax
 ^~~~
2 errors 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 33159] Assertion since [AMDGPU] Fix incorrect register pressure calculation

2017-06-27 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=33159

Stanislav Mekhanoshin  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #6 from Stanislav Mekhanoshin  ---
Fixed in https://reviews.llvm.org/rL306375

-- 
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 33603] lldb unable to demangle lambdas in destructors

2017-06-27 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=33603

Dave MacLachlan  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Dave MacLachlan  ---
Looks like it was fixed in r303737 but hasn't made it out to Xcode yet.

-- 
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 33616] New: MCJIT does not propagate errors from mprotect

2017-06-27 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=33616

Bug ID: 33616
   Summary: MCJIT does not propagate errors from mprotect
   Product: new-bugs
   Version: 3.8
  Hardware: PC
OS: Linux
Status: NEW
  Severity: normal
  Priority: P
 Component: new bugs
  Assignee: unassignedb...@nondot.org
  Reporter: tim.g.armstr...@gmail.com
CC: llvm-bugs@lists.llvm.org

MCJIT::finalizeLoadedModules() ignores the return value (and error argument)
from MemMgr->finalizeMemory(), which appears to be the only way that an error
code from mprotect() is propagated. mprotect() can fail for various reasons and
it would be good if clients of MCJIT could detect the problem and fail
gracefully.

Bug #6701 mentions this problem as well.

-- 
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 33617] New: clang (rev. 305643) crashes while building kwin 5.10.3

2017-06-27 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=33617

Bug ID: 33617
   Summary: clang (rev. 305643) crashes while building kwin 5.10.3
   Product: clang
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: -New Bugs
  Assignee: unassignedclangb...@nondot.org
  Reporter: b...@linaro.org
CC: llvm-bugs@lists.llvm.org

1.  ../logind.cpp:315:78 :
current parser token ')'
2.  ../logind.cpp:58:1: parsing namespace 'KWin'
3.  ../logind.cpp:305:1: parsing function body
'KWin::LogindIntegration::takeDevice'
4.  ../logind.cpp:305:1: in compound statement ('{}')
clang-5.0: error: unable to execute command: Aborted (core dumped)
clang-5.0: error: clang frontend command failed due to signal (use -v to see
invocation)

-- 
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 33618] New: wrong code at -Os on x86_64-linux-gnu with "-mllvm -enable-newgvn"

2017-06-27 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=33618

Bug ID: 33618
   Summary: wrong code at -Os on x86_64-linux-gnu with "-mllvm
-enable-newgvn"
   Product: libraries
   Version: trunk
  Hardware: PC
OS: All
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Scalar Optimizations
  Assignee: unassignedb...@nondot.org
  Reporter: s...@cs.ucdavis.edu
CC: llvm-bugs@lists.llvm.org

It might be a dupe of or related to PR 33305. 

$ clang -v
clang version 5.0.0 (trunk 306403)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/clang-trunk/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.4.0
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/6.0.0
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.4
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.5
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
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.0.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
$
$ clang -Os small.c; ./a.out
$
$ clang -Os -mllvm -enable-newgvn small.c
$ ./a.out
Aborted (core dumped)
$


--


int a, b, d, e, f, g, h, j, k;
volatile int c;

void fn1 ()
{ 
  int i = 0;
  for (; i < 3; i++)
while (g > 7)
  if (b)
goto L;
  for (; b < 1; b++)
{ 
  int *l = &h, *m;
  if (e)
goto L;
  for (; j < 1; j++)
{ 
  int **n = &m;
  if (a)
{ 
  l = &f;
L:
  if (d > 2)
{ 
  for (k = 1; k; k = k)
c;
  continue;
}
}
  *n = l;
  if (m != &h)
__builtin_abort ();
}
}
}

int main ()
{ 
  fn1 ();
  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


[llvm-bugs] [Bug 33619] New: wrong code at -O2 and -O3 on x86_64-linux-gnu (in 64-bit mode) with "-mllvm -enable-newgvn

2017-06-27 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=33619

Bug ID: 33619
   Summary: wrong code at -O2 and -O3 on x86_64-linux-gnu (in
64-bit mode) with "-mllvm -enable-newgvn
   Product: libraries
   Version: trunk
  Hardware: PC
OS: All
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Scalar Optimizations
  Assignee: unassignedb...@nondot.org
  Reporter: s...@cs.ucdavis.edu
CC: llvm-bugs@lists.llvm.org

$ clang -v
clang version 5.0.0 (trunk 306291)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/clang-trunk/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.4
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.3.0
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.5
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.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.3.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.2.0
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 -O2 -w small.c
$ ./a.out
$
$ clang -O2 -w -mllvm -enable-newgvn small.c
$ ./a.out
Floating point exception (core dumped)
$


-


int a, b, c, d, e, i, g, j = 1;
char f;

void fn1 ()
{ 
  if (c)
goto L5;
  for (; d < 2; d++)
i = 1;
  goto L3;
L1:
L2:
  if (e)
goto L4;
L3:;
  char h, k = d;
  if (j)
{ 
  b;
L4:
  if (!i)
goto L1;
}
  h = f = k;
  i = ~(f * -1 / ~1U);
  g = f & h;
L5:;
  short l = ~f;
  int m = 2 / ~a;
  if (m < l)
{ 
  a = -(~0 || 0);
  goto L2;
}
}

int main ()
{ 
  fn1 ();
  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


[llvm-bugs] [Bug 27551] Bitcode files should have a symbol table similar to object files

2017-06-27 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=27551

Peter Collingbourne  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||pe...@pcc.me.uk
 Resolution|--- |FIXED

--- Comment #3 from Peter Collingbourne  ---
This was fixed in a series of changes that ended in r306488.

-- 
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 33620] New: Assertion failed: (!SplitVirtReg->empty() && "expecting non-empty interval"), function allocatePhysRegs

2017-06-27 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=33620

Bug ID: 33620
   Summary: Assertion failed: (!SplitVirtReg->empty() &&
"expecting non-empty interval"), function
allocatePhysRegs
   Product: libraries
   Version: trunk
  Hardware: PC
OS: All
Status: NEW
  Severity: normal
  Priority: P
 Component: Register Allocator
  Assignee: unassignedb...@nondot.org
  Reporter: matthew.arsena...@amd.com
CC: llvm-bugs@lists.llvm.org

Created attachment 18724
  --> https://bugs.llvm.org/attachment.cgi?id=18724&action=edit
Testcase

-- 
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 33621] New: wrong code at -Os on x86_64-linux-gnu (in 64-bit mode only) with "-mllvm -enable-newgvn

2017-06-27 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=33621

Bug ID: 33621
   Summary: wrong code at -Os on x86_64-linux-gnu (in 64-bit mode
only) with "-mllvm -enable-newgvn
   Product: libraries
   Version: trunk
  Hardware: PC
OS: All
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Scalar Optimizations
  Assignee: unassignedb...@nondot.org
  Reporter: s...@cs.ucdavis.edu
CC: llvm-bugs@lists.llvm.org

It might be a(nother) dupe.  

$ clang -v
clang version 5.0.0 (trunk 306403)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/clang-trunk/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.4.0
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/6.0.0
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.4
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.5
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
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.0.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
$ 
$ clang -Os small.c; ./a.out
$ 
$ clang -Os -mllvm -enable-newgvn small.c
$ timeout -s 9 5 ./a.out
Killed
$ 


-


int a, b, c, d = 1, e;

void fn1 ()
{
  int g;
  if (!a)
goto L1;
  int i = ~a;
  if (i)
{
  i = a;
L2:
  c = 0;
L1:
  g = ~(a | i);
  if (!g)
goto L2;
}
  c = e = b = i;
  g = a && g;
  c = -((e || b) + g - d);
  int k = ~(c | e);
  while (k)
;
}

int main ()
{
  a = 1;
  fn1 ();
  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


[llvm-bugs] [Bug 33622] New: llvm-objdump fails on llvm/ADT/SmallVector.h:153: const_reference llvm::SmallVectorTemplateCommon::operator[](size_type) const [T = llvm::MCOperand]

2017-06-27 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=33622

Bug ID: 33622
   Summary: llvm-objdump fails on llvm/ADT/SmallVector.h:153:
const_reference
llvm::SmallVectorTemplateCommon::operator[](size_type) const [T =
llvm::MCOperand]: Assertion `idx < size()' failed
   Product: libraries
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: normal
  Priority: P
 Component: MC
  Assignee: unassignedb...@nondot.org
  Reporter: lesliez...@llvm.org.cn
CC: llvm-bugs@lists.llvm.org

Created attachment 18726
  --> https://bugs.llvm.org/attachment.cgi?id=18726&action=edit
basic-avr.s

Hi LLVM developers,

basic-avr.s attached.
$ llvm-mc -filetype=obj -triple=avr-unknown-linux -mcpu=atmega328p basic-avr.s
-o /tmp/basic-avr.o
$ ld.lld /tmp/basic-avr.o -o /tmp/basic-avr.o -Ttext=0


$ lldb /data/project/llvm/debug-build/bin/llvm-objdump
(lldb) target create "/data/project/llvm/debug-build/bin/llvm-objdump"
Current executable set to '/data/project/llvm/debug-build/bin/llvm-objdump'
(x86_64).
(lldb) r -d /tmp/basic-avr
Process 8788 launched: '/data/project/llvm/debug-build/bin/llvm-objdump'
(x86_64)

/tmp/basic-avr: file format ELF32-avr

Disassembly of section .text:
main:
   11000:   0e 94 02 88  

foo:
   11004:   c3 94   inc llvm-objdump:
/data/project/llvm/include/llvm/ADT/SmallVector.h:153: const_reference
llvm::SmallVectorTemplateCommon::operator[](size_type)
const [T = llvm::MCOperand]: Assertion `idx < size()' failed.
Process 8788 stopped
* thread #1: tid = 8788, 0x7fffeffaa8df libc.so.6`__GI_raise + 159, name =
'llvm-objdump', stop reason = signal SIGABRT
frame #0: 0x7fffeffaa8df libc.so.6`__GI_raise + 159
libc.so.6`__GI_raise:
->  0x7fffeffaa8df <+159>: movl   %r8d, %eax
0x7fffeffaa8e2 <+162>: addq   $0x90, %rsp
0x7fffeffaa8e9 <+169>: retq   
0x7fffeffaa8ea <+170>: nopw   (%rax,%rax)


(lldb) bt
* thread #1: tid = 8788, 0x7fffeffaa8df libc.so.6`__GI_raise + 159, name =
'llvm-objdump', stop reason = signal SIGABRT
  * frame #0: 0x7fffeffaa8df libc.so.6`__GI_raise + 159
frame #1: 0x7fffeffac4da libc.so.6`__GI_abort + 362
frame #2: 0x7fffeffa2d67 libc.so.6`__assert_fail_base + 279
frame #3: 0x7fffeffa2e12 libc.so.6`__GI___assert_fail + 66
frame #4: 0x7394bf6e
libLLVM-5.0svn.so`llvm::MCInst::getOperand(unsigned int) const [inlined]
llvm::SmallVectorTemplateCommon::operator[](this=0x7fffbf60, idx=0) const + 86 at
SmallVector.h:153
frame #5: 0x7394bf18
libLLVM-5.0svn.so`llvm::MCInst::getOperand(this=0x7fffbf50, i=0) const
+ 40 at MCInst.h:173
frame #6: 0x747fbe0e
libLLVM-5.0svn.so`llvm::AVRInstPrinter::printOperand(this=0x00770aa0,
MI=0x7fffbf50, OpNo=0, O=0x77d73ac0) + 46 at
AVRInstPrinter.cpp:103
frame #7: 0x747fbaf9
libLLVM-5.0svn.so`llvm::AVRInstPrinter::printInstruction(this=0x00770aa0,
MI=0x7fffbf50, O=0x77d73ac0) + 313 at AVRGenAsmWriter.inc:727
frame #8: 0x747fd3f3
libLLVM-5.0svn.so`llvm::AVRInstPrinter::printInst(this=0x00770aa0,
MI=0x7fffbf50, O=0x77d73ac0, Annot=(Data = "", Length = 0),
STI=0x00767660) + 579 at AVRInstPrinter.cpp:82
frame #9: 0x00425aa8 llvm-objdump`(anonymous
namespace)::PrettyPrinter::printInst(this=0x00720b30,
IP=0x00770aa0, MI=0x7fffbf50, Bytes=(Data =
"Ô\f\x94\x02\x88Linker: LLD 5.0.0 (trunk 306352)", Length = 2), Address=69636,
OS=0x77d73ac0, Annot=(Data = "", Length = 0), STI=0x00767660,
SP=0x7fffc898)::SourcePrinter*) + 728 at llvm-objdump.cpp:525
frame #10: 0x004341ff
llvm-objdump`DisassembleObject(Obj=0x007672f0, InlineRelocs=false) +
19727 at llvm-objdump.cpp:1583
frame #11: 0x0042ef08 llvm-objdump`DumpObject(o=0x007672f0,
a=0x) + 616 at llvm-objdump.cpp:2037
frame #12: 0x00425728 llvm-objdump`DumpInput(file=(Data =
"/tmp/basic-avr", Length = 14)) + 440 at llvm-objdump.cpp:2129
frame #13: 0x0043cb92 llvm-objdump`void
(__first=__normal_iterator *,
std::vector,
std::allocator > > > @ 0x7fffdb28,
__last=__normal_iterator *,
std::vector,
std::allocator > > > @ 0x7fffdb20,
__f=(llvm-objdump`DumpInput(llvm::StringRef) at
llvm-objdump.cpp:2110))(llvm::StringRef)>(__gnu_cxx::__normal_iterator, std::allocator >*,
std::vector,
std::allocator >, std::allocator, std::allocator > > > >,
__gnu_cxx::__normal_iterator, std::allocator >*,
std::vector,
std::allocator >, std::allocator, std::allocator > > > >, void
(*)(llvm::StringRef)))(llvm::StringRef) + 130 at stl_algo.h:3769
frame #14: 0x00425509 llvm-objdump`main(argc=3,
argv=0x7fffde48) + 3065 at llvm-objdump.cpp:2189
frame #15: 0x7fffeff95401 libc.so.6`_

[llvm-bugs] [Bug 33623] New: llvm-diff finds differences in the same code

2017-06-27 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=33623

Bug ID: 33623
   Summary: llvm-diff finds differences in the same code
   Product: new-bugs
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: new bugs
  Assignee: unassignedb...@nondot.org
  Reporter: yonghyun@sf.snu.ac.kr
CC: llvm-bugs@lists.llvm.org

Created attachment 18727
  --> https://bugs.llvm.org/attachment.cgi?id=18727&action=edit
naive.ll in comment

```
$ ./llvm-diff -version
LLVM (http://llvm.org/):
  LLVM version 5.0.0svn
  DEBUG build with assertions.
  Default target: x86_64-unknown-linux-gnu
  Host CPU: ivybridge
```

```
$ ./llvm-diff naive.ll naive.ll
in function foo:
  in block %entry:
>   store <2 x i64*> , <2 x i64*>* %tmp0, align 8
<   store <2 x i64*> , <2 x i64*>* %tmp0, align 8
```

```
$ cat naive.ll
%struct.it = type { i64, i64* }

@a_vector = internal global [2 x i64] zeroinitializer, align 16

define i32 @foo(%struct.it* %it) {

entry:
  %a = getelementptr inbounds %struct.it, %struct.it* %it, i64 0, i32 1
  %tmp0 = bitcast i64** %a to <2 x i64*>*
  store <2 x i64*> , <2 x i64*>* %tmp0, align 8

  ret i32 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