[llvm-bugs] Issue 38109 in oss-fuzz: llvm:clang-objc-fuzzer: Stack-overflow in PointerExprEvaluator::VisitCastExpr

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

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

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

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

Crash Type: Stack-overflow
Crash Address: 0x7ffc24801fc0
Crash State:
  PointerExprEvaluator::VisitCastExpr
  clang::StmtVisitorBase::Visit
  EvaluatePointer
  
Sanitizer: address (ASAN)

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

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

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 38002] Missed opportunity for SETE for 2-cases switch

2021-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=38002

David Bolvansky  changed:

   What|Removed |Added

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

--- Comment #4 from David Bolvansky  ---
sw1(int): # @sw1(int)
  add edi, -3
  test edi, -3
  sete al
  ret


So.. fixed since LLVM 13.

-- 
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 51745] New: LLVM 13 regression: lost transformation x < C && y < C && z < C to (x | y | z) < C

2021-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=51745

Bug ID: 51745
   Summary: LLVM 13 regression: lost transformation x < C && y < C
&& z < C to  (x | y | z) < C
   Product: libraries
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Scalar Optimizations
  Assignee: unassignedb...@nondot.org
  Reporter: david.bolvan...@gmail.com
CC: llvm-bugs@lists.llvm.org

x < C && y < C && z < C to  (x | y | z) < C  where C is power of two.


bool
src1 (unsigned x, unsigned y, unsigned z, unsigned w)
{
  return x < 1024 && y < 1024 && z < 1024 && w < 1024;
}

bool
tgt1 (unsigned x, unsigned y, unsigned z, unsigned w)
{
  return (x | y | z | w) < 1024;
}



GCC:
src1(unsigned int, unsigned int, unsigned int, unsigned int):
or  edx, ecx
or  edx, esi
or  edx, edi
cmp edx, 1023
setbe   al
ret
tgt1(unsigned int, unsigned int, unsigned int, unsigned int):
or  edx, ecx
or  edx, esi
or  edx, edi
cmp edx, 1023
setbe   al
ret

Clang trunk:
src1(unsigned int, unsigned int, unsigned int, unsigned int):  
 # @src1(unsigned int, unsigned int, unsigned int, unsigned int)
cmp edi, 1024
setbal
cmp esi, 1024
setbsil
and sil, al
cmp edx, 1024
setbdl
cmp ecx, 1024
setbal
and al, dl
and al, sil
ret
tgt1(unsigned int, unsigned int, unsigned int, unsigned int):  
 # @tgt1(unsigned int, unsigned int, unsigned int, unsigned int)
or  edi, esi
or  edx, ecx
or  edx, edi
cmp edx, 1024
setbal
ret


Regressed with LLVM 13 which disabled select-to-or optimization.

-- 
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 51746] New: Suboptimal auto vectorized code with accumulator

2021-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=51746

Bug ID: 51746
   Summary: Suboptimal auto vectorized code with accumulator
   Product: libraries
   Version: trunk
  Hardware: PC
OS: Linux
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 int v4si __attribute__ ((vector_size (16)));
int
test1 (int acc, v4si v1, v4si v2, v4si v3, v4si v4)
{
  acc &= v1[0] & v1[1] & v1[2] & v1[3];
  acc &= v2[0] & v2[1] & v2[2] & v2[3];
  acc &= v3[0] & v3[1] & v3[2] & v3[3];
  acc &= v4[0] & v4[1] & v4[2] & v4[3];
  return acc;
}


GGC -O3:
test1(int, int __vector(4), int __vector(4), int __vector(4), int __vector(4)):
pandxmm0, xmm1
pandxmm2, xmm3
pandxmm2, xmm0
pshufd  xmm0, xmm2, 85
movdedx, xmm2
movdeax, xmm0
movdqa  xmm0, xmm2
and eax, edx
punpckhdq   xmm0, xmm2
pshufd  xmm2, xmm2, 255
and eax, edi
movdedx, xmm0
and edx, eax
movdeax, xmm2
and eax, edx
ret

Clang -O3:
test1(int, int __vector(4), int __vector(4), int __vector(4), int __vector(4)):
  # @test1(int, int __vector(4), int __vector(4), int
__vector(4), int __vector(4))
movdeax, xmm1
pshufd  xmm4, xmm1, 85  # xmm4 = xmm1[1,1,1,1]
movdecx, xmm4
and ecx, eax
pshufd  xmm4, xmm1, 238 # xmm4 = xmm1[2,3,2,3]
movdeax, xmm4
and eax, ecx
pshufd  xmm1, xmm1, 255 # xmm1 = xmm1[3,3,3,3]
movdecx, xmm1
movdedx, xmm2
pshufd  xmm1, xmm2, 85  # xmm1 = xmm2[1,1,1,1]
movdesi, xmm1
and esi, ecx
and esi, edx
pshufd  xmm1, xmm2, 238 # xmm1 = xmm2[2,3,2,3]
movdecx, xmm1
and ecx, esi
pshufd  xmm1, xmm2, 255 # xmm1 = xmm2[3,3,3,3]
movdedx, xmm1
and edx, ecx
movdecx, xmm3
pshufd  xmm1, xmm3, 85  # xmm1 = xmm3[1,1,1,1]
movdesi, xmm1
and esi, ecx
pshufd  xmm1, xmm3, 238 # xmm1 = xmm3[2,3,2,3]
movdecx, xmm1
and ecx, esi
pshufd  xmm1, xmm3, 255 # xmm1 = xmm3[3,3,3,3]
movdesi, xmm1
and esi, ecx
pshufd  xmm1, xmm0, 238 # xmm1 = xmm0[2,3,2,3]
pandxmm1, xmm0
pshufd  xmm0, xmm1, 85  # xmm0 = xmm1[1,1,1,1]
pandxmm0, xmm1
movdecx, xmm0
and eax, edi
and eax, ecx
and eax, edx
and eax, esi
ret


Codegen: https://godbolt.org/z/Y86fodv5j

-- 
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 42300] [llvm-mca] How to model "result bus bubbles"?

2021-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=42300

Roman Lebedev  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |WORKSFORME

-- 
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 51747] New: Missed hoisting opportunity

2021-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=51747

Bug ID: 51747
   Summary: Missed hoisting opportunity
   Product: libraries
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Scalar Optimizations
  Assignee: unassignedb...@nondot.org
  Reporter: david.bolvan...@gmail.com
CC: llvm-bugs@lists.llvm.org

#include   /* fprintf, open, fdopen, fread, _fileno, stdin, stdout
*/
#include  /* malloc, free */
#include  /* strcmp, strlen */

static const char*
extractFilename(const char* path, char separator)
{
const char* search = strrchr(path, separator);
if (search == NULL) return path;
return search+1;
}

char*
FIO_createFilename_fromOutDir(const char* path, const char* outDirName, const
size_t suffixLen)
{
const char* filenameStart;
char separator;
char* result;

separator = '/';


filenameStart = extractFilename(path, separator);


result = (char*) calloc(1, strlen(outDirName) + 1 + strlen(filenameStart) +
suffixLen + 1);
if (!result) {
   ; // EXM_THROW(30, "zstd: FIO_createFilename_fromOutDir: %s",
strerror(errno));
}

memcpy(result, outDirName, strlen(outDirName));
if (outDirName[strlen(outDirName)-1] == separator) {
memcpy(result + strlen(outDirName), filenameStart,
strlen(filenameStart));
} else {
memcpy(result + strlen(outDirName), &separator, 1);
memcpy(result + strlen(outDirName) + 1, filenameStart,
strlen(filenameStart));
}

return result;
}


define dso_local noalias i8* @_Z29FIO_createFilename_fromOutDirPKcS0_m(i8*
readonly %0, i8* nocapture readonly %1, i64 %2) local_unnamed_addr #0 {
  %4 = tail call i8* @strrchr(i8* noundef nonnull dereferenceable(1) %0, i32
47) #4
  %5 = icmp eq i8* %4, null
  %6 = getelementptr inbounds i8, i8* %4, i64 1
  %7 = select i1 %5, i8* %0, i8* %6
  %8 = tail call i64 @strlen(i8* noundef nonnull dereferenceable(1) %1) #4
  %9 = tail call i64 @strlen(i8* noundef nonnull dereferenceable(1) %7) #4
  %10 = add i64 %2, 2
  %11 = add i64 %10, %8
  %12 = add i64 %11, %9
  %13 = tail call noalias align 16 i8* @calloc(i64 1, i64 %12) #5
  tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 16 %13, i8* align 1 %1,
i64 %8, i1 false)
  %14 = add i64 %8, -1
  %15 = getelementptr inbounds i8, i8* %1, i64 %14
  %16 = load i8, i8* %15, align 1, !tbaa !3
  %17 = icmp eq i8 %16, 47
  %18 = getelementptr inbounds i8, i8* %13, i64 %8
  br i1 %17, label %19, label %21

19:   ; preds = %3
  %20 = tail call i64 @strlen(i8* noundef nonnull dereferenceable(1) %7) #4
  tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %18, i8* align 1 %7,
i64 %20, i1 false)
  br label %24

21:   ; preds = %3
  store i8 47, i8* %18, align 1
  %22 = getelementptr inbounds i8, i8* %18, i64 1
  %23 = tail call i64 @strlen(i8* noundef nonnull dereferenceable(1) %7) #4
  tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 1 %22, i8* align
1 %7, i64 %23, i1 false)
  br label %24

24:   ; preds = %21, %19
  ret i8* %13
}



Issue: hoist strlen (%20, %23) before branch? GVN Hoist does not help. Seems
like LLVM is worried about "store i8 47, i8* %18, align 1".


With:
19:   ; preds = %3
  %20 = tail call i64 @strlen(i8* noundef nonnull dereferenceable(1) %7) #4
  tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %18, i8* align 1 %7,
i64 %20, i1 false)
  br label %24

21:   ; preds = %3
  %22 = tail call i64 @strlen(i8* noundef nonnull dereferenceable(1) %7) #4
  %23 = getelementptr inbounds i8, i8* %18, i64 1
  tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 1 %23, i8* align
1 %7, i64 %22, i1 false)
  br label %24

24:   ; preds = %21, %19
  ret i8* %13
}

Hoisted fine.


But if gep and strlen is reordered (also in motivating testcase IR):
19:   ; preds = %3
  %20 = tail call i64 @strlen(i8* noundef nonnull dereferenceable(1) %7) #4
  tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %18, i8* align 1 %7,
i64 %20, i1 false)
  br label %24

21:   ; preds = %3
  %22 = getelementptr inbounds i8, i8* %18, i64 1 
  %23 = tail call i64 @strlen(i8* noundef nonnull dereferenceable(1) %7) #4
  tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 1 %22, i8* align
1 %7, i64 %23, i1 false)
  br label %24

24:   ; preds = %21, %19
  ret i8* %13
}

Hoisting failed.

%22

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
llvm-bugs mailing list
llvm-bugs@l

[llvm-bugs] [Bug 41734] -fsanitize-coverage=inline-8bit-counters + ThinLTO = lld crash

2021-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=41734

Roman Lebedev  changed:

   What|Removed |Added

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

--- Comment #14 from Roman Lebedev  ---
I can no longer reproduce.
I believe this has been either fixed or masked.
Thanks!

-- 
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 27686 in oss-fuzz: llvm: Fuzzing build failure

2021-09-04 Thread ClusterFuzz-External via monorail via llvm-bugs

Comment #46 on issue 27686 by ClusterFuzz-External: llvm: Fuzzing build failure
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=27686#c46

Friendly reminder that the the build is still failing.
Please try to fix this failure to ensure that fuzzing remains productive.
Latest build log: 
https://oss-fuzz-build-logs.storage.googleapis.com/log-5f55cf4a-8170-443f-ab5f-adb1ffe22734.txt

-- 
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 51748] New: Unrecognized rotate patterns

2021-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=51748

Bug ID: 51748
   Summary: Unrecognized rotate patterns
   Product: libraries
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Scalar Optimizations
  Assignee: unassignedb...@nondot.org
  Reporter: david.bolvan...@gmail.com
CC: llvm-bugs@lists.llvm.org

unsigned rol1(unsigned x, int y)
{
return (x << y) | (x >> (64-y)); 
} 

define dso_local i32 @rol1(i32 %0, i32 %1) local_unnamed_addr #0 {
  %3 = shl i32 %0, %1
  %4 = sub nsw i32 64, %1
  %5 = lshr i32 %0, %4
  %6 = or i32 %5, %3
  ret i32 %6
}



define i32 @src(i32 %0, i32 %1) {
%2:
  %3 = shl i32 %0, %1
  %4 = sub nsw i32 64, %1
  %5 = lshr i32 %0, %4
  %6 = or i32 %5, %3
  ret i32 %6
}
=>
define i32 @tgt(i32 %0, i32 %1) {
%2:
  %3 = fshl i32 %0, i32 %0, i32 %1
  ret i32 %3
}

https://alive2.llvm.org/ce/z/6jDaR_

-- 
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 51750] New: Wrong backtrace and source line information at Og

2021-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=51750

Bug ID: 51750
   Summary: Wrong backtrace and source line information at Og
   Product: libraries
   Version: trunk
  Hardware: PC
OS: Windows NT
Status: NEW
  Severity: enhancement
  Priority: P
 Component: DebugInfo
  Assignee: unassignedb...@nondot.org
  Reporter: art...@diag.uniroma1.it
CC: jdevliegh...@apple.com, keith.wal...@arm.com,
llvm-bugs@lists.llvm.org,
paul_robin...@playstation.sony.com

Comment:
When stepping on the "pushq %rax" assembly instruction the backtrace indicates
that we are inside the main function and the associated source line is wrong
(line 17, which is in function w). The "pushq %rax" instruction should point to
line 0.

Steps to reproduce bug:
root@b04800b37146:/home/stepping/output# clang -v
clang version 14.0.0 (https://github.com/llvm/llvm-project.git
957334382cd12ec07b46c0ddfdcc220731f6d80f)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.5.0
Candidate multilib: .;@m64
Selected multilib: .;@m64
root@b04800b37146:/home/stepping/output# lldb -v
lldb version 14.0.0 (https://github.com/llvm/llvm-project.git revision
957334382cd12ec07b46c0ddfdcc220731f6d80f)
  clang revision 957334382cd12ec07b46c0ddfdcc220731f6d80f
  llvm revision 957334382cd12ec07b46c0ddfdcc220731f6d80f
root@b04800b37146:/home/stepping/output# cat a.c
volatile int a, c, e;
short d;
int f;
char g, h, k;
int j;
unsigned l;
static short m[] = {3, 3, 3, 3, 3, 3, 3};
int n;
int(o)() {
  f = o();
  if (f)
m[2] = e;
}
void p() {
  int b[6];
  int i;
  for (i = 0; i < 6; i++)
b[i] = 10;
  d = 0;
  for (; d <= 5; d++) {
j |= 6;
h = g++;
b[2] | m[6] || (l = k);
  }
}
int main() {
  p();
  for (; n;)
c = a * 7;
  a = j;
  a = h;
  a = m[g];
  printf("%X\n");
}
root@b04800b37146:/home/stepping/output# cat -n a.c
 1  volatile int a, c, e;
 2  short d;
 3  int f;
 4  char g, h, k;
 5  int j;
 6  unsigned l;
 7  static short m[] = {3, 3, 3, 3, 3, 3, 3};
 8  int n;
 9  int(o)() {
10f = o();
11if (f)
12  m[2] = e;
13  }
14  void p() {
15int b[6];
16int i;
17for (i = 0; i < 6; i++)
18  b[i] = 10;
19d = 0;
20for (; d <= 5; d++) {
21  j |= 6;
22  h = g++;
23  b[2] | m[6] || (l = k);
24}
25  }
26  int main() {
27p();
28for (; n;)
29  c = a * 7;
30a = j;
31a = h;
32a = m[g];
33printf("%X\n");
34  }
root@b04800b37146:/home/stepping/output# lldb opt
(lldb) target create "opt"
Current executable set to '/home/stepping/output/opt' (x86_64).
(lldb) b 0x400556
Breakpoint 1: address = 0x00400556
(lldb) r
Process 50577 launched: '/home/stepping/output/opt' (x86_64)
E5F8
Process 50577 exited with status = 0 (0x)
(lldb) b 0x400556
Breakpoint 2: where = opt`main + 22 [inlined] p + 6 at a.c:17:3, address =
0x00400556
(lldb) r
Process 50585 launched: '/home/stepping/output/opt' (x86_64)
Process 50585 stopped
* thread #1, name = 'opt', stop reason = breakpoint 2.1
frame #0: 0x00400556 opt`main [inlined] p at a.c:17:3
   14   void p() {
   15 int b[6];
   16 int i;
-> 17 for (i = 0; i < 6; i++)
   18   b[i] = 10;
   19 d = 0;
   20 for (; d <= 5; d++) {
(lldb) di -l
opt`main:
0x400554 <+20>: jne0x400550  ; <+16> [inlined] p at
a.c:17:17
->  0x400556 <+22>: pushq  %rax
0x400557 <+23>: movl   0x200ae2(%rip), %r9d  ; j
0x40055e <+30>: movw   $0x6, %dx
0x400562 <+34>: movb   0x200adc(%rip), %al   ; g
0x400568 <+40>: nopl   (%rax,%rax)
(lldb) bt
* thread #1, name = 'opt', stop reason = breakpoint 2.1
  * frame #0: 0x00400556 opt`main [inlined] p at a.c:17:3
frame #1: 0x00400550 opt`main at a.c:27:3
frame #2: 0x77a03bf7 libc.so.6`__libc_start_main + 231
frame #3: 0x0040040a opt`_start + 42

-- 
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 51751] New: Wrong mapping assembly-line at Og

2021-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=51751

Bug ID: 51751
   Summary: Wrong mapping assembly-line at Og
   Product: libraries
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: DebugInfo
  Assignee: unassignedb...@nondot.org
  Reporter: art...@diag.uniroma1.it
CC: jdevliegh...@apple.com, keith.wal...@arm.com,
llvm-bugs@lists.llvm.org,
paul_robin...@playstation.sony.com

Comment:
The debugger wrongly associates the mov instruction "0x40049a <+10>: movw $0x0,
0x200b89(%rip)" to line 6, which is the call to func_1, instead of line 3 which
is the actual assignment.

Steps to reproduce bug:

root@69ab245e01ef:/home/stepping/output# clang -v
clang version 14.0.0 (https://github.com/llvm/llvm-project.git
957334382cd12ec07b46c0ddfdcc220731f6d80f)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.5.0
Candidate multilib: .;@m64
Selected multilib: .;@m64
root@69ab245e01ef:/home/stepping/output# lldb -v
lldb version 14.0.0 (https://github.com/llvm/llvm-project.git revision
957334382cd12ec07b46c0ddfdcc220731f6d80f)
  clang revision 957334382cd12ec07b46c0ddfdcc220731f6d80f
  llvm revision 957334382cd12ec07b46c0ddfdcc220731f6d80f
root@69ab245e01ef:/home/stepping/output# cat a.c
short a;
int b;
void func_1() { a = 0; }
int main() {
  b = 0;
  func_1();
}
root@69ab245e01ef:/home/stepping/output# cat -n a.c
 1  short a;
 2  int b;
 3  void func_1() { a = 0; }
 4  int main() {
 5b = 0;
 6func_1();
 7  }
root@69ab245e01ef:/home/stepping/output# clang -Og -g -Wno-everything -o opt
a.c
root@69ab245e01ef:/home/stepping/output# lldb opt
(lldb) target create "opt"
Current executable set to '/home/stepping/output/opt' (x86_64).
(lldb) b main
Breakpoint 1: where = opt`main at a.c:5:5, address = 0x00400490
(lldb) r
Process 55 launched: '/home/stepping/output/opt' (x86_64)
Process 55 stopped
* thread #1, name = 'opt', stop reason = breakpoint 1.1
frame #0: 0x00400490 opt`main at a.c:5:5
   2int b;
   3void func_1() { a = 0; }
   4int main() {
-> 5  b = 0;
   6  func_1();
   7}
(lldb) si
Process 55 stopped
* thread #1, name = 'opt', stop reason = instruction step into
frame #0: 0x0040049a opt`main at a.c:6:3
   3void func_1() { a = 0; }
   4int main() {
   5  b = 0;
-> 6  func_1();
   7}
(lldb) di -l
opt`main:
->  0x40049a <+10>: movw   $0x0, 0x200b89(%rip)  ; completed.7698

   5  b = 0;
   6  func_1();
** 7}

0x4004a3 <+19>: xorl   %eax, %eax
0x4004a5 <+21>: retq
0x4004a6:   nopw   %cs:(%rax,%rax)
opt`__libc_csu_init:
0x4004b0 <+0>:  pushq  %r15
0x4004b2 <+2>:  pushq  %r14
0x4004b4 <+4>:  movq   %rdx, %r15
0x4004b7 <+7>:  pushq  %r13

-- 
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 51565] Missing transformation rotate(X, Z) == rotate(Y, Z) ---> X == Y

2021-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=51565

David Bolvansky  changed:

   What|Removed |Added

 Fixed By Commit(s)||3a696f6092effe6513b85f51510
   ||e51090e205715
 Status|NEW |RESOLVED
 Resolution|--- |FIXED

-- 
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 41571] [5/6/7/8 Regression] Multiple returns are produced where previously was only one

2021-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=41571

Nikita Kniazev  changed:

   What|Removed |Added

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

--- Comment #1 from Nikita Kniazev  ---
Fixed in LLVM 12

-- 
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 51752] New: spurious "used "here" note diagnostics for __clang_cuda_device_functions.h

2021-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=51752

Bug ID: 51752
   Summary: spurious "used "here" note diagnostics for
__clang_cuda_device_functions.h
   Product: OpenMP
   Version: unspecified
  Hardware: PC
OS: Linux
Status: NEW
  Severity: normal
  Priority: P
 Component: Clang Compiler Support
  Assignee: unassignedclangb...@nondot.org
  Reporter: jdenny.o...@gmail.com
CC: a.bat...@hotmail.com, jdoerf...@anl.gov,
llvm-bugs@lists.llvm.org

I can reproduce this at least as recently as 1f9e437065ae and at least as early
as 04242bdca991.  The note diagnostics here do not make sense to me:

```
$ cat test.c
#include 
#include 
int main(int argc, char *argv[]) {
  assert(argc == 2);
  int i = atoi(argv[1]);
  return 0;
}
$ clang -fopenmp -fopenmp-targets=nvptx64 -Wunused-variable test.c
test.c:5:7: warning: unused variable 'i' [-Wunused-variable]
  int i = atoi(argv[1]);
  ^
1 warning generated.
test.c:5:7: warning: unused variable 'i' [-Wunused-variable]
  int i = atoi(argv[1]);
  ^
/home/jdenny/ornl/llvm/llvm-mono-git/install/lib/clang/14.0.0/include/__clang_cuda_device_functions.h:43:66:
note: used here
__DEVICE__ void __attribute__((overloadable)) __brkpt(int __a) { __brkpt(); }
 ^
/home/jdenny/ornl/llvm/llvm-mono-git/install/lib/clang/14.0.0/include/__clang_cuda_device_functions.h:1189:10:
note: used here
  return __bool2mask(__vseteq2(__a, __b), 16);
 ^
/home/jdenny/ornl/llvm/llvm-mono-git/install/lib/clang/14.0.0/include/__clang_cuda_device_functions.h:1189:22:
note: used here
  return __bool2mask(__vseteq2(__a, __b), 16);
 ^
/home/jdenny/ornl/llvm/llvm-mono-git/install/lib/clang/14.0.0/include/__clang_cuda_device_functions.h:1199:22:
note: used here
  return __bool2mask(__vseteq4(__a, __b), 8);
 ^
/home/jdenny/ornl/llvm/llvm-mono-git/install/lib/clang/14.0.0/include/__clang_cuda_device_functions.h:1209:22:
note: used here
  return __bool2mask(__vsetges2(__a, __b), 16);
 ^
/home/jdenny/ornl/llvm/llvm-mono-git/install/lib/clang/14.0.0/include/__clang_cuda_device_functions.h:1219:22:
note: used here
  return __bool2mask(__vsetges4(__a, __b), 8);
 ^
/home/jdenny/ornl/llvm/llvm-mono-git/install/lib/clang/14.0.0/include/__clang_cuda_device_functions.h:1229:22:
note: used here
  return __bool2mask(__vsetgeu2(__a, __b), 16);
 ^
/home/jdenny/ornl/llvm/llvm-mono-git/install/lib/clang/14.0.0/include/__clang_cuda_device_functions.h:1239:22:
note: used here
  return __bool2mask(__vsetgeu4(__a, __b), 8);
 ^
/home/jdenny/ornl/llvm/llvm-mono-git/install/lib/clang/14.0.0/include/__clang_cuda_device_functions.h:1249:22:
note: used here
  return __bool2mask(__vsetgts2(__a, __b), 16);
 ^
/home/jdenny/ornl/llvm/llvm-mono-git/install/lib/clang/14.0.0/include/__clang_cuda_device_functions.h:1259:22:
note: used here
  return __bool2mask(__vsetgts4(__a, __b), 8);
 ^
/home/jdenny/ornl/llvm/llvm-mono-git/install/lib/clang/14.0.0/include/__clang_cuda_device_functions.h:1269:22:
note: used here
  return __bool2mask(__vsetgtu2(__a, __b), 16);
 ^
/home/jdenny/ornl/llvm/llvm-mono-git/install/lib/clang/14.0.0/include/__clang_cuda_device_functions.h:1279:22:
note: used here
  return __bool2mask(__vsetgtu4(__a, __b), 8);
 ^
/home/jdenny/ornl/llvm/llvm-mono-git/install/lib/clang/14.0.0/include/__clang_cuda_device_functions.h:1289:22:
note: used here
  return __bool2mask(__vsetles2(__a, __b), 16);
 ^
/home/jdenny/ornl/llvm/llvm-mono-git/install/lib/clang/14.0.0/include/__clang_cuda_device_functions.h:1299:22:
note: used here
  return __bool2mask(__vsetles4(__a, __b), 8);
 ^
/home/jdenny/ornl/llvm/llvm-mono-git/install/lib/clang/14.0.0/include/__clang_cuda_device_functions.h:1309:22:
note: used here
  return __bool2mask(__vsetleu2(__a, __b), 16);
 ^
/home/jdenny/ornl/llvm/llvm-mono-git/install/lib/clang/14.0.0/include/__clang_cuda_device_functions.h:1319:22:
note: used here
  return __bool2mask(__vsetleu4(__a, __b), 8);
 ^
/home/jdenny/ornl/llvm/llvm-mono-git/install/lib/clang/14.0.0/include/__clang_cuda_device_functions.h:1329:22:
note: used here
  return __bool2mask(__vsetlts2(__a, __b), 16);
 ^
/home/jdenny/ornl/llvm/llvm-mono-git/install/lib/clang/14.0.0/include/__clang_cuda_device_functions.h:1339:22:
note: used here
  return __bool2mask(__vsetlts4(__a, __b), 8);
 ^
/home/jdenny/ornl/llvm/llvm-mono-git/install/lib/clang/14.0.0/include/__clang_cuda_device_functions.h:1349:22:
note: used here
  return __bool2mask(__vsetltu2(__a, __b), 16);
 ^
/home/jdenny/ornl/ll

[llvm-bugs] [Bug 49865] tests: consolidate encoding, assembly & disassembly tests under test/MC

2021-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=49865

Min-Yih Hsu  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Fixed By Commit(s)||28868027f7529ba3de7f16a5371
   ||0e7dae5d6f6ae
 Status|NEW |RESOLVED

--- Comment #3 from Min-Yih Hsu  ---
The migration is finalized now and we can remove utils/extract-section.py.

-- 
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 51753] New: Nested std::bind with a custom placeholder fails to compile

2021-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=51753

Bug ID: 51753
   Summary: Nested std::bind with a custom placeholder fails to
compile
   Product: libc++
   Version: 12.0
  Hardware: PC
OS: Windows NT
Status: NEW
  Severity: normal
  Priority: P
 Component: All Bugs
  Assignee: unassignedclangb...@nondot.org
  Reporter: pdi...@gmail.com
CC: llvm-bugs@lists.llvm.org, mclow.li...@gmail.com

The code
```
#include 

template struct lambda2_arg
{
};

constexpr lambda2_arg<1> _1{};

namespace std
{

template struct is_placeholder< lambda2_arg >: integral_constant
{
};

} // namespace std

struct plus_equal
{
template decltype(auto) operator()(T1&& t1, T2&& t2)
const
{
return std::forward(t1) += std::forward(t2);
}
};

struct X
{
int m;
};

int main()
{
X x{ 1 };
return std::bind( plus_equal(), std::bind( &X::m, _1 ), 1 )( x );
}
```
(https://godbolt.org/z/8h1Td56c7)

fails to compile. Other standard libraries work. Using std::placeholders::_1
instead of _1 works.

(This bind expression is produced by Boost.Lambda2.)

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