[llvm-bugs] [Bug 47573] New: [AVX512] Supoptimal mask operation

2020-09-18 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=47573

Bug ID: 47573
   Summary: [AVX512] Supoptimal mask operation
   Product: libraries
   Version: trunk
  Hardware: PC
OS: Windows NT
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Backend: X86
  Assignee: unassignedb...@nondot.org
  Reporter: david.bolvan...@gmail.com
CC: craig.top...@gmail.com, llvm-bugs@lists.llvm.org,
llvm-...@redking.me.uk, spatel+l...@rotateright.com

-Ofast -mavx512bw -mno-avx512dq -mno-avx512vl -mno-xop
-mprefer-vector-width=512

Clang:
f1(char*, char*, char*):# @f1(char*, char*, char*)
vmovdqu64   zmm0, zmmword ptr [rsi]
vpcmpltbk1, zmm0, zmmword ptr [rdx]
vmovdqu8zmm1 {k1} {z}, zmmword ptr [rdi]
vmovdqu8zmm0 {k1}, zmm1
vmovdqu64   zmmword ptr [rdi], zmm0
vzeroupper
ret
f2(unsigned char*, unsigned char*, unsigned char*):   
# @f2(unsigned char*, unsigned char*, unsigned char*)
vmovdqu64   zmm0, zmmword ptr [rsi]
vpcmpltub   k1, zmm0, zmmword ptr [rdx]
vmovdqu8zmm1 {k1} {z}, zmmword ptr [rdi]
vmovdqu8zmm0 {k1}, zmm1
vmovdqu64   zmmword ptr [rdi], zmm0
vzeroupper
ret
f3(char*, char*, char*):# @f3(char*, char*, char*)
vmovdqu64   zmm0, zmmword ptr [rsi]
vpcmpgtbk1, zmm0, zmmword ptr [rdx]
vmovdqu8zmm1 {k1} {z}, zmmword ptr [rdi]
vmovdqu8zmm0 {k1}, zmm1
vmovdqu64   zmmword ptr [rdi], zmm0
vzeroupper
ret


GCC:
f1(char*, char*, char*):
vmovdqu8zmm0, ZMMWORD PTR [rsi]
vpcmpb  k1, zmm0, ZMMWORD PTR [rdx], 5
vmovdqu8ZMMWORD PTR [rdi]{k1}, zmm0
vzeroupper
ret
f2(unsigned char*, unsigned char*, unsigned char*):
vmovdqu8zmm0, ZMMWORD PTR [rsi]
vpcmpub k1, zmm0, ZMMWORD PTR [rdx], 5
vmovdqu8ZMMWORD PTR [rdi]{k1}, zmm0
vzeroupper
ret
f3(char*, char*, char*):
vmovdqu8zmm0, ZMMWORD PTR [rsi]
vpcmpb  k1, zmm0, ZMMWORD PTR [rdx], 2
vmovdqu8ZMMWORD PTR [rdi]{k1}, zmm0
vzeroupper
ret

More examples: https://godbolt.org/z/MjaKeE

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


[llvm-bugs] [Bug 47574] New: Improve codegen for struct init

2020-09-18 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=47574

Bug ID: 47574
   Summary: Improve codegen for struct init
   Product: libraries
   Version: trunk
  Hardware: PC
OS: Windows NT
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Backend: WebAssembly
  Assignee: unassignedb...@nondot.org
  Reporter: david.bolvan...@gmail.com
CC: llvm-bugs@lists.llvm.org

#include 
#include 

struct X
{
  char mem0[10];
  char mem1[10];
};


void bar (struct X);


void
foo1()
{
  struct X x = { };
  bar (x);
}

void
foo2 ()
{
  struct X x;
  memset (&x, 0, sizeof x);
  bar (x);
}

void
foo3 ()
{
  struct X *x = calloc (sizeof (struct X), 1);
  bar (*x);
}

Clang -O3:

foo1:   # @foo1
sub rsp, 56
xorps   xmm0, xmm0
movaps  xmmword ptr [rsp + 32], xmm0
mov dword ptr [rsp + 48], 0
mov eax, dword ptr [rsp + 48]
mov dword ptr [rsp + 16], eax
movaps  xmm0, xmmword ptr [rsp + 32]
movups  xmmword ptr [rsp], xmm0
callbar
add rsp, 56
ret
foo2:   # @foo2
sub rsp, 56
xorps   xmm0, xmm0
movaps  xmmword ptr [rsp + 32], xmm0
mov dword ptr [rsp + 48], 0
mov eax, dword ptr [rsp + 48]
mov dword ptr [rsp + 16], eax
movaps  xmm0, xmmword ptr [rsp + 32]
movups  xmmword ptr [rsp], xmm0
callbar
add rsp, 56
ret
foo3:   # @foo3
sub rsp, 56
mov edi, 20
mov esi, 1
callcalloc
mov ecx, dword ptr [rax + 16]
mov dword ptr [rsp + 48], ecx
movups  xmm0, xmmword ptr [rax]
movaps  xmmword ptr [rsp + 32], xmm0
mov eax, dword ptr [rsp + 48]
mov dword ptr [rsp + 16], eax
movaps  xmm0, xmmword ptr [rsp + 32]
movups  xmmword ptr [rsp], xmm0
callbar
add rsp, 56
ret


GCC -O3:

foo1:
sub rsp, 72
pxorxmm0, xmm0
mov DWORD PTR [rsp+16], 0
movups  XMMWORD PTR [rsp], xmm0
callbar
add rsp, 72
ret
foo2:
sub rsp, 72
pxorxmm0, xmm0
mov DWORD PTR [rsp+48], 0
mov DWORD PTR [rsp+16], 0
movaps  XMMWORD PTR [rsp+32], xmm0
movups  XMMWORD PTR [rsp], xmm0
callbar
add rsp, 72
ret
foo3:
sub rsp, 8
mov esi, 1
mov edi, 20
callcalloc
sub rsp, 32
movdqu  xmm0, XMMWORD PTR [rax]
movups  XMMWORD PTR [rsp], xmm0
mov eax, DWORD PTR [rax+16]
mov DWORD PTR [rsp+16], eax
callbar
add rsp, 40
ret

https://godbolt.org/z/WEEdzs

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


[llvm-bugs] Issue 25767 in oss-fuzz: llvm:clang-objc-fuzzer: Stack-overflow in processTypeAttrs

2020-09-18 Thread ClusterFuzz-External via monorail via llvm-bugs
Status: New
Owner: 
CC: k...@google.com, masc...@google.com, jdevlieg...@apple.com, 
igm...@gmail.com, d...@google.com, mit...@google.com, bigchees...@gmail.com, 
eney...@google.com, llvm-b...@lists.llvm.org, j...@chromium.org, 
v...@apple.com, mitchphi...@outlook.com, xpl...@gmail.com, akils...@apple.com 
Labels: ClusterFuzz Stability-Memory-AddressSanitizer Reproducible 
Engine-libfuzzer OS-Linux Proj-llvm Reported-2020-09-18
Type: Bug

New issue 25767 by ClusterFuzz-External: llvm:clang-objc-fuzzer: Stack-overflow 
in processTypeAttrs
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=25767

Detailed Report: https://oss-fuzz.com/testcase?key=5707423611092992

Project: llvm
Fuzzing Engine: libFuzzer
Fuzz Target: clang-objc-fuzzer
Job Type: libfuzzer_asan_llvm
Platform Id: linux

Crash Type: Stack-overflow
Crash Address: 0x7ffdfff9aff8
Crash State:
  processTypeAttrs
  GetFullTypeForDeclarator
  clang::Sema::GetTypeForDeclarator
  
Sanitizer: address (ASAN)

Regressed: 
https://oss-fuzz.com/revisions?job=libfuzzer_asan_llvm&range=202009160603:202009170602

Reproducer Testcase: https://oss-fuzz.com/download?testcase_id=5707423611092992

Issue filed automatically.

See https://google.github.io/oss-fuzz/advanced-topics/reproducing for 
instructions to reproduce this bug locally.
When you fix this bug, please
  * mention the fix revision(s).
  * state whether the bug was a short-lived regression or an old bug in any 
stable releases.
  * add any other useful information.
This information can help downstream consumers.

If you need to contact the OSS-Fuzz team with a question, concern, or any other 
feedback, please file an issue at https://github.com/google/oss-fuzz/issues. 
Comments on individual Monorail issues are not monitored.

-- 
You received this message because:
  1. You were specifically CC'd on the issue

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

Reply to this email to add a comment.___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 47124] mac/arm64 codegen puts jump tables in __TEXT, __const instead of __TEXT, __text, leading to ld64 warnings about direct access to global weak symbols

2020-09-18 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=47124

Tim Northover  changed:

   What|Removed |Added

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

--- Comment #14 from Tim Northover  ---
Should be fixed now by 2afe4becec7.

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


[llvm-bugs] [Bug 47575] New: noalias/restrict on global pointers

2020-09-18 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=47575

Bug ID: 47575
   Summary: noalias/restrict on global pointers
   Product: libraries
   Version: trunk
  Hardware: PC
OS: Windows NT
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Common Code Generator Code
  Assignee: unassignedb...@nondot.org
  Reporter: david.bolvan...@gmail.com
CC: llvm-bugs@lists.llvm.org

float * __restrict__ x;
float * __restrict__ y;
float * __restrict__ z;



void foo (float * __restrict__ xx, float * __restrict__ yy)
{

 float * __restrict__ pin = &xx[0];
 float * __restrict__ pout =&yy[0];

  *pout++ = *pin++;
  *pout++ = *pin++;
  *pout++ = *pin++;
  *pout++ = *pin++;
}


void bar ()
{

 float * __restrict__ pin = &x[0];
 float * __restrict__ pout =&y[0];

  *pout++ = *pin++;
  *pout++ = *pin++;
  *pout++ = *pin++;
  *pout++ = *pin++;
}



void loop() {
  for (int i=0;i < 4;++i) x[i]=y[i]+z[i];
}


Clang -O3 -mavx2:
foo(float*, float*): # @foo(float*, float*)
vmovups xmm0, xmmword ptr [rdi]
vmovups xmmword ptr [rsi], xmm0
ret
bar():# @bar()
mov rax, qword ptr [rip + x]
mov rcx, qword ptr [rip + y]
mov edx, dword ptr [rax]
mov dword ptr [rcx], edx
mov edx, dword ptr [rax + 4]
mov dword ptr [rcx + 4], edx
mov edx, dword ptr [rax + 8]
mov dword ptr [rcx + 8], edx
mov eax, dword ptr [rax + 12]
mov dword ptr [rcx + 12], eax
ret
loop():   # @loop()
mov rax, qword ptr [rip + y]
mov rcx, qword ptr [rip + z]
mov rdx, qword ptr [rip + x]
vmovss  xmm0, dword ptr [rax]   # xmm0 = mem[0],zero,zero,zero
vaddss  xmm0, xmm0, dword ptr [rcx]
vmovss  dword ptr [rdx], xmm0
vmovss  xmm0, dword ptr [rax + 4]   # xmm0 = mem[0],zero,zero,zero
vaddss  xmm0, xmm0, dword ptr [rcx + 4]
vmovss  dword ptr [rdx + 4], xmm0
vmovss  xmm0, dword ptr [rax + 8]   # xmm0 = mem[0],zero,zero,zero
vaddss  xmm0, xmm0, dword ptr [rcx + 8]
vmovss  dword ptr [rdx + 8], xmm0
vmovss  xmm0, dword ptr [rax + 12]  # xmm0 = mem[0],zero,zero,zero
vaddss  xmm0, xmm0, dword ptr [rcx + 12]
vmovss  dword ptr [rdx + 12], xmm0
ret


GCC:
foo(float*, float*):
vmovups xmm0, XMMWORD PTR [rdi]
vmovups XMMWORD PTR [rsi], xmm0
ret
bar():
mov rax, QWORD PTR x[rip]
vmovups xmm0, XMMWORD PTR [rax]
mov rax, QWORD PTR y[rip]
vmovups XMMWORD PTR [rax], xmm0
ret
loop():
mov rax, QWORD PTR y[rip]
vmovups xmm0, XMMWORD PTR [rax]
mov rax, QWORD PTR z[rip]
vaddps  xmm0, xmm0, XMMWORD PTR [rax]
mov rax, QWORD PTR x[rip]
vmovups XMMWORD PTR [rax], xmm0
ret

https://gcc.godbolt.org/z/dPsv17

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


[llvm-bugs] [Bug 47576] New: [SLP] Allow vectorization for vec4 ops for avx2+

2020-09-18 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=47576

Bug ID: 47576
   Summary: [SLP] Allow vectorization for vec4 ops for avx2+
   Product: libraries
   Version: trunk
  Hardware: PC
OS: Windows NT
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Scalar Optimizations
  Assignee: unassignedb...@nondot.org
  Reporter: david.bolvan...@gmail.com
CC: llvm-bugs@lists.llvm.org

typedef unsigned char pixel;
typedef unsigned short dctcoef;

void pixel_sub_wxh( dctcoef *__restrict diff, pixel *__restrict pix1, int
i_pix1, pixel *__restrict pix2, int i_pix2 )
{
diff[0] = pix1[0] + pix2[0];
diff[1] = pix1[1] + pix2[1];
diff[2] = pix1[2] + pix2[2];
diff[3] = pix1[3] + pix2[3];

}

Clang -mavx2 -O3 :

pixel_sub_wxh(unsigned short*, unsigned char*, int, unsigned char*, int):  
  # @pixel_sub_wxh(unsigned short*, unsigned char*, int, unsigned char*,
int)
movzx   eax, byte ptr [rsi]
movzx   edx, byte ptr [rcx]
add edx, eax
mov word ptr [rdi], dx
movzx   eax, byte ptr [rsi + 1]
movzx   edx, byte ptr [rcx + 1]
add edx, eax
mov word ptr [rdi + 2], dx
movzx   eax, byte ptr [rsi + 2]
movzx   edx, byte ptr [rcx + 2]
add edx, eax
mov word ptr [rdi + 4], dx
movzx   eax, byte ptr [rsi + 3]
movzx   ecx, byte ptr [rcx + 3]
add ecx, eax
mov word ptr [rdi + 6], cx
ret

ICC -mavx2 -O3 (since 19.00) :
pixel_sub_wxh(unsigned short*, unsigned char*, int, unsigned char*, int):
vmovd xmm0, DWORD PTR [rsi] #6.15
vmovd xmm1, DWORD PTR [rcx] #6.25
vpmovzxbw xmm0, xmm0#6.15
vpmovzxbw xmm1, xmm1#6.25
vpaddwxmm2, xmm0, xmm1  #6.25
vmovq QWORD PTR [rdi], xmm2 #6.5
ret 


https://gcc.godbolt.org/z/a9rxaM

Cost model issue?

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


[llvm-bugs] [Bug 47577] New: Atomic operation emits an __atomic_* call rather than an instruction for trivial structure

2020-09-18 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=47577

Bug ID: 47577
   Summary: Atomic operation emits an __atomic_* call rather than
an instruction for trivial structure
   Product: clang
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: C++
  Assignee: unassignedclangb...@nondot.org
  Reporter: antosh...@gmail.com
CC: blitzrak...@gmail.com, dgre...@apple.com,
erik.pilking...@gmail.com, llvm-bugs@lists.llvm.org,
richard-l...@metafoo.co.uk

Consider the example:


#include 

struct SleepState {
unsigned short flags;
unsigned short epoch;
};

void test(std::atomic& i) {
SleepState ss{2, 4};
i.compare_exchange_weak(ss, SleepState{4,2});
}


Function test() could be compiled to the following:

test(std::atomic&):
  mov eax, 262146
  mov edx, 131076
  mov DWORD PTR [rsp-4], 262146
  lock cmpxchg DWORD PTR [rdi], edx
  ret


However clang calls __atomic_compare_exchange when libstdc++ is used:

test(std::atomic&)
  push rax
  mov rsi, rdi
  mov dword ptr [rsp], 262146
  mov dword ptr [rsp + 4], 131076
  mov rdx, rsp
  lea rcx, [rsp + 4]
  mov edi, 4
  mov r8d, 5
  mov r9d, 5
  call __atomic_compare_exchange
  pop rax
  ret


Godbolt playground: https://godbolt.org/z/Eajn57

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


[llvm-bugs] [Bug 47567] Incorrect transformation: (llvm.maximum undef, %x) -> undef

2020-09-18 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=47567

Sanjay Patel  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|CONFIRMED   |RESOLVED

--- Comment #6 from Sanjay Patel  ---
https://github.com/llvm/llvm-project/commit/3f100e64b429b6468e9a2c5b3e7ef7757a06dc48

I also see that constant folding isn't fully implemented for any 2-operand FP
intrinsics, so at minimum we have some inconsistent behavior (not sure if there
are any miscompiles).

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


[llvm-bugs] Issue 25767 in oss-fuzz: llvm:clang-objc-fuzzer: Stack-overflow in processTypeAttrs

2020-09-18 Thread ClusterFuzz-External via monorail via llvm-bugs
Updates:
Labels: ClusterFuzz-Verified
Status: Verified

Comment #1 on issue 25767 by ClusterFuzz-External: llvm:clang-objc-fuzzer: 
Stack-overflow in processTypeAttrs
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=25767#c1

ClusterFuzz testcase 5707423611092992 is verified as fixed in 
https://oss-fuzz.com/revisions?job=libfuzzer_asan_llvm&range=202009170602:202009180613

If this is incorrect, please file a bug on 
https://github.com/google/oss-fuzz/issues/new

-- 
You received this message because:
  1. You were specifically CC'd on the issue

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

Reply to this email to add a comment.___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 47578] New: Incorrectly lift a modulo computation outside an if statement

2020-09-18 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=47578

Bug ID: 47578
   Summary: Incorrectly lift a modulo computation outside an if
statement
   Product: clang
   Version: 10.0
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: -New Bugs
  Assignee: unassignedclangb...@nondot.org
  Reporter: k.even-mend...@imperial.ac.uk
CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org,
neeil...@live.com, richard-l...@metafoo.co.uk

#include 

static long r = 0;
static long *m[1] = {&r};

static int i = 1;
static int *pi = &i;

int main() {
   unsigned x = 0;
   if (i) { // Evaluates to true
 ++x; // Guaranteed to be reached, and afterwards x == 1
 int test = pi == (int*) 1;
   }

   printf("x = %d\n", x);
   // At this point, x == 1
   if (!x) { // Evaluates to false
 i = 7UL % (m[0] == (long*) 1); // Unreachable.  (It would have UB if it
*were* reachable, becuase of a mod by zero.)
   }
}

Get "floating point exception" with -02, Ubuntun, and clang-6/Clang-10.
The bug is no appearing with -O0 flag.

Restor the bug:
clang-10 -O2 -w test1.c 
./a.out 
Floating point exception (core dumped)
==
clang-10 -O0 -w test1.c 
./a.out 
x = 1

I tried with two versions, both got the bugs:
1) from llvm trunk: clang version 10.0.0 (trunk), Target:
x86_64-unknown-linux-gnu, Thread model: posix, InstalledDir:
/home/user42/llvm-csmith-0/llvm-install/bin (from 03/09/2020)
2) Ubuntu's: clang version 10.0.0-4ubuntu1~18.04.2, Target:
x86_64-pc-linux-gnu, Thread model: posix, InstalledDir: /usr/bin

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


[llvm-bugs] [Bug 47579] New: Assertion failure when executable path contains \" on Windows

2020-09-18 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=47579

Bug ID: 47579
   Summary: Assertion failure when executable path contains \" on
Windows
   Product: libraries
   Version: trunk
  Hardware: PC
OS: Windows NT
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Support Libraries
  Assignee: unassignedb...@nondot.org
  Reporter: john.br...@arm.com
CC: llvm-bugs@lists.llvm.org

If an llvm tool is invoked using a path that contains \" on Windows due to some
part of the path ending in \ being quoted, e.g.
  "F:\work\build\bin\"opt --help
then this results in an assertion failure:
  Assertion failed: idx < size(), file
F:\work\src\llvm-project\llvm\include\llvm/ADT/SmallVector.h, line 183

It looks like probably something is going wrong in
windows::GetCommandLineArguments in llvm/lib/Support/Windows/Process.inc or in
the functions that it calls (cl::TokenizeWindowsCommandLine or
GetExecutableName).

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


[llvm-bugs] [Bug 46755] Windows bots require Cmake update

2020-09-18 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46755

Adrian McCarthy  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 CC||ldio...@apple.com,
   ||r...@google.com
 Status|NEW |RESOLVED

--- Comment #1 from Adrian McCarthy  ---
Apologies for the delay, as we had trouble accessing those bots.  But now it
looks as though somebody has already quietly updated Cmake on those machines
back in July.  Cmake on those bots is now 3.18, and they've been intermittently
green since then, so this no longer appears to be a problem.

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


[llvm-bugs] [Bug 47580] New: [Codeview] Missing debug info for constant globals that are not used by code

2020-09-18 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=47580

Bug ID: 47580
   Summary: [Codeview] Missing debug info for constant globals
that are not used by code
   Product: libraries
   Version: trunk
  Hardware: PC
OS: Windows NT
Status: NEW
  Severity: enhancement
  Priority: P
 Component: DebugInfo
  Assignee: unassignedb...@nondot.org
  Reporter: sylvain.a...@ubisoft.com
CC: akhu...@google.com, alexandre.ga...@ubisoft.com,
jdevliegh...@apple.com, keith.wal...@arm.com,
llvm-bugs@lists.llvm.org,
paul_robin...@playstation.sony.com, r...@google.com

Here is a test case covering several cases of the same issue:

//
// main.cpp
//
//
struct A {
  static const int const_A = 3;
  static constexpr int constexpr_A = 4;
  static constexpr const int constexprconst_A = 5;
  static const int constOutside_A;
};
const int A::constOutside_A = 6;

static const int globalStaticConst = 10;
static constexpr int globalStaticConstexpr = 11;
const int globalConst = 12;
constexpr int globalConstexpr = 13;

int main() {
  A a;
  return 0;
}
//

Compiling with clang-cl.exe:

clang-cl.exe main.cpp /nologo /EHsc- /Z7 /std:c++17 /GS- /GR- /c
/Fo:main-clangcl.obj 
lld-link.exe /DEBUG main-clangcl.obj


Compiling with Microsoft's cl.exe:

cl.exe main.cpp /nologo /EHsc- /Z7 /std:c++17 /GS- /GR- /c /Fo:main-msvc.obj
main.cpp
lld-link.exe /DEBUG main-msvc.obj



In Visual Studio 2019 debugger, trying to display those values (through the
Watch Window):

1) main-MSVC.exe
 -> "A" : symbol exists, can expand to display members with their value
 -> "globalStaticConst" etc: displayed with value

2) main-clangcl.exe
 "A" symbols exists, can expand to display members, but the values are replaced
with an error message "An unspecified error has occurred", except for
constexprconst_A (which was evaluated in main()) and constOutside_A.

Note that the behavior is the same when compiling with clang argument
`-fno-limit-debug-info`.


Comparing the output of `llvm-pdbutil dump --symbols` on both obj files, we can
see a few S_CONSTANT entries that appear on msvc but not clangcl:


  Symbols   

  Mod  | `.debug$S`: 
 (...)
0 | S_CONSTANT [size = 21] `B::const_B`
type = 0x1003 (const int), value = 3
0 | S_CONSTANT [size = 25] `B::constexpr_B`
type = 0x1003 (const int), value = 4
0 | S_CONSTANT [size = 30] `B::constexprconst_B`
type = 0x1003 (const int), value = 5
 etc


It would be nice to have these values shown when debugging.

If I understand correctly, the goal is to have the informations about those
constants ready at CodeViewDebug::endModule(), so that they can be emitted in
CodeViewDebug::emitDebugInfoForGlobals(). 

@rnk, would you know where to gather those symbols information?

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


[llvm-bugs] Issue 23756 in oss-fuzz: llvm:llvm-isel-fuzzer--aarch64-O2: ASSERT: canSkipToPos(ByteNo) && "Invalid location"

2020-09-18 Thread sheriffbot via monorail via llvm-bugs
Updates:
Labels: Deadline-Approaching

Comment #1 on issue 23756 by sheriffbot: llvm:llvm-isel-fuzzer--aarch64-O2: 
ASSERT: canSkipToPos(ByteNo) && "Invalid location"
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=23756#c1

This bug is approaching its deadline for being fixed, and will be automatically 
derestricted within 7 days. If a fix is planned within 2 weeks after the 
deadline has passed, a grace extension can be granted.

- Your friendly Sheriffbot

-- 
You received this message because:
  1. You were specifically CC'd on the issue

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

Reply to this email to add a comment.___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 47581] New: llvm-readobj prints wrong addresses for arm32 unwind info (-u)

2020-09-18 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=47581

Bug ID: 47581
   Summary: llvm-readobj prints wrong addresses for arm32 unwind
info (-u)
   Product: tools
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: llvm-readobj
  Assignee: unassignedb...@nondot.org
  Reporter: rprich...@google.com
CC: jh7370.2...@my.bristol.ac.uk, llvm-bugs@lists.llvm.org

Created attachment 23983
  --> https://bugs.llvm.org/attachment.cgi?id=23983&action=edit
test binary

cat >test.c << EOF
void func1() {}
void func2() { func1(); }
void func3() {}
EOF

$ clang -target arm-linux-gnueabi test.c -fpic -shared -nostdlib
-funwind-tables

$ nm a.out | grep func
0230 T func1
0234 T func2
0248 T func3

$ readelf -u a.out

Unwind section '.ARM.exidx' at offset 0x24c contains 4 entries:

0x230 : 0x80b0b0b0
  Compact model index: 0
  0xb0  finish
  0xb0  finish
  0xb0  finish

0x234 : 0x809b8480
  Compact model index: 0
  0x9b  vsp = r11
  0x84 0x80 pop {r11, r14}

0x248 : 0x80b0b0b0
  Compact model index: 0
  0xb0  finish
  0xb0  finish
  0xb0  finish

0x24c : 0x1 [cantunwind]

$ /x/llvm-upstream/stage1/bin/llvm-readobj --unwind a.out

File: a.out
Format: elf32-littlearm
Arch: arm
AddressSize: 32bit
LoadName: 
UnwindInformation {
  UnwindIndexTable {
SectionIndex: 9
SectionName: .ARM.exidx
SectionOffset: 0x24C
Entries [
  Entry {
FunctionAddress: 0x230
FunctionName: func1
Model: Compact (Inline)
PersonalityIndex: 0
Opcodes [
  0xB0  ; finish
  0xB0  ; finish
  0xB0  ; finish
]
  }
  Entry {
FunctionAddress: 0x22C
Model: Compact (Inline)
PersonalityIndex: 0
Opcodes [
  0x9B  ; vsp = r11
  0x84 0x80 ; pop {fp, lr}
]
  }
  Entry {
FunctionAddress: 0x238
Model: Compact (Inline)
PersonalityIndex: 0
Opcodes [
  0xB0  ; finish
  0xB0  ; finish
  0xB0  ; finish
]
  }
  Entry {
FunctionAddress: 0x234
FunctionName: func2
Model: CantUnwind
  }
]
  }
}

binutils readobj and nm reports these addresses:
 - func1 == 0x230
 - func2 == 0x234
 - func3 == 0x248
 - end   == 0x24c

llvm-readobj reports these addresses:
 - func1 == 0x230
 - func2 == 0x22C
 - func3 == 0x238
 - end   == 0x234

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