[llvm-bugs] [Bug 42164] Clang-format Add Option to Break before While

2020-05-20 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=42164

MyDeveloperDay  changed:

   What|Removed |Added

 Fixed By Commit(s)||807ab2cd0db3
 Resolution|--- |FIXED
 Status|CONFIRMED   |RESOLVED

-- 
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 46000] New: Diagnostic withholds number of line responsible for bad template instantiation

2020-05-20 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46000

Bug ID: 46000
   Summary: Diagnostic withholds number of line responsible for
bad template instantiation
   Product: clang
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: C++
  Assignee: unassignedclangb...@nondot.org
  Reporter: tonyele...@hotmail.com
CC: blitzrak...@gmail.com, dgre...@apple.com,
erik.pilking...@gmail.com, llvm-bugs@lists.llvm.org,
richard-l...@metafoo.co.uk

This code has a function template that wraps emplace_back() for vector and
then code that erroneously attempts to instantiate it to emplace_back a
nullptr:


#include 

template 
decltype(auto) int_vec_emplace_back_wrapper(std::vector &vec, Ts
&&...values) {
  return vec.emplace_back(std::forward(values)...);
}

void f(std::vector &vec) {
  int_vec_emplace_back_wrapper(vec, nullptr);
}


GCC's diagnostic includes a mention the erroneous line 9 but Clang's diagnostic
doesn't:


In file included from a.cpp:1:
In file included from
/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/vector:61:
In file included from
/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/allocator.h:46:
In file included from
/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8/bits/c++allocator.h:33:
/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ext/new_allocator.h:136:23:
error: cannot initialize a new value of type 'int' with an rvalue of type
'nullptr_t'
{ ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
 ^   ~~~
/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/alloc_traits.h:475:8:
note: in instantiation of function template specialization
'__gnu_cxx::new_allocator::construct' requested here
{ __a.construct(__p, std::forward<_Args>(__args)...); }
  ^
/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/vector.tcc:103:21:
note: in instantiation of function template specialization
'std::allocator_traits >::construct'
requested here
_Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish,
   ^
a.cpp:5:14: note: in instantiation of function template specialization
'std::vector >::emplace_back' requested
here
  return vec.emplace_back(std::forward(values)...);
 ^
1 error generated.


(Removing int_vec_emplace_back_wrapper()'s variadicity doesn't improve the
diagnostic but giving it an explicit void return type does)

https://bugs.llvm.org/show_bug.cgi?id=20452 touches similar issues but I don't
believe it subsumes 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
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 45679] LoopVectorizer produces wrong code with UserVF not dividing small TripCount

2020-05-20 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=45679

Florian Hahn  changed:

   What|Removed |Added

 Fixed By Commit(s)||682e739638a9
 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #1 from Florian Hahn  ---
Looks like this was fixed by
https://reviews.llvm.org/rG682e739638a9c569d4c5c358ab75365175a95efc

-- 
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 46001] New: Failure to optimize out movzx by reordering & 1 to be last operation

2020-05-20 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46001

Bug ID: 46001
   Summary: Failure to optimize out movzx by reordering & 1 to be
last operation
   Product: libraries
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Scalar Optimizations
  Assignee: unassignedb...@nondot.org
  Reporter: gabrav...@gmail.com
CC: llvm-bugs@lists.llvm.org

int f(int a, int b)
{
return ((a & 1) != 0) != (b != 0);
}

With -O3, LLVM outputs this :

f(int, int): # @f(int, int)
  test esi, esi
  setne al
  and dil, 1
  xor dil, al
  movzx eax, dil
  ret

It should be capable of outputting this :

f(int, int):
  test esi, esi
  setne al
  xor eax, edi
  and eax, 1
  ret

But it isn't.

-- 
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 46002] New: Wrong line information at Og

2020-05-20 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46002

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

Line information is wrong for line 17. 

$ cat amod.c 
int a ;
static int *b ;
char c;
void __assert_fail () __attribute__ ((__noreturn__));
static short d() {
b = a
;
}

int main () 
{
 d();
 {
  int p_14,  p_11  ;
  if (2  ^ c) ;
  else 
  ((p_14 == &p_11) ? (void) (0) : __assert_fail ("p_14 == &p_11",
"a.c", 131, __func__));
  }
}

$ clang -v
clang version 11.0.0 (https://github.com/llvm/llvm-project.git
268fa40daa151d3b4bff1df12b62e5dae94685d7)
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

$ lldb -v
lldb version 11.0.0
  clang revision 268fa40daa151d3b4bff1df12b62e5dae94685d7
  llvm revision 268fa40daa151d3b4bff1df12b62e5dae94685d7

$ clang -Og -g -o opt amod.c

$ lldb opt
(lldb) target create "opt"
Current executable set to 'opt' (x86_64).
(lldb) b main 
Breakpoint 1: where = opt`main + 1 at amod.c:12:6, address = 0x004004e1
(lldb) r
Process 64 launched: 'opt' (x86_64)
Process 64 stopped
* thread #1, name = 'opt', stop reason = breakpoint 1.1
frame #0: 0x004004e1 opt`main at amod.c:12:6
   9
   10   int main () 
   11   {
-> 12d();
   13{
   14 int p_14,  p_11  ;
   15 if (2  ^ c) ;
(lldb) s
Process 64 stopped
* thread #1, name = 'opt', stop reason = step in
frame #0: 0x00400510 opt`d at amod.c:17:47
   14 int p_14,  p_11  ;
   15 if (2  ^ c) ;
   16 else 
-> 17 ((p_14 == &p_11) ? (void) (0) : __assert_fail ("p_14 ==
&p_11", "a.c", 131, __func__));
   18 }
   19   }
(lldb) bt
* thread #1, name = 'opt', stop reason = step in
  * frame #0: 0x00400510 opt`d at amod.c:17:47
frame #1: 0x004004e6 opt`main at amod.c:12:6
frame #2: 0x77a05b97 libc.so.6`__libc_start_main + 231
frame #3: 0x0040041a opt`_start + 42
(lldb) di
opt`d:
->  0x400510 <+0>: retq   
(lldb) 

$ gdb opt
(gdb) b main
Breakpoint 1 at 0x4004e1: file amod.c, line 12.
(gdb) s
The program is not being run.
(gdb) r
Starting program: opt 

Breakpoint 1, main () at amod.c:12
12   d();
(gdb) s
0x00400510 in d () at amod.c:17
17((p_14 == &p_11) ? (void) (0) : __assert_fail ("p_14 ==
&p_11", "a.c", 131, __func__));
(gdb)

-- 
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 46003] New: Include compile_commands.txt in installed header directory

2020-05-20 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46003

Bug ID: 46003
   Summary: Include compile_commands.txt in installed header
directory
   Product: libc++
   Version: unspecified
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: All Bugs
  Assignee: unassignedclangb...@nondot.org
  Reporter: redbeard0...@gmail.com
CC: llvm-bugs@lists.llvm.org, mclow.li...@gmail.com

Having a compile_commands.txt file that includes at least -stdlib=libc++
significantly improves the experience when using clangd and navigating to one
of the libc++ headers on platforms where libc++ is not the default stdlib. It
may also be worth setting -std=c++LATEST so that the maximum amount of code is
parsed and usable, but that is less important than not having every file broken
due to mixing stdlib headers.

-- 
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 46004] New: AddressingModeMatcher::matchAddr - APInt::getMinSignedBits() <= 64 && "Too many bits for int64_t"

2020-05-20 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46004

Bug ID: 46004
   Summary: AddressingModeMatcher::matchAddr -
APInt::getMinSignedBits() <= 64 && "Too many bits for
int64_t"
   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: llvm-...@redking.me.uk
CC: llvm-bugs@lists.llvm.org

Reduced from https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=22357

define void @fuzz22357() {
  %B9 = add i128 undef, 170141183460469231731687303715884105727
  %add5 = add nuw nsw i128 %B9, 2
  %G = getelementptr i8, i8* undef, i128 %add5
  store i8 undef, i8* %G, align 1
  unreachable
}

llc -mtriple=x86_64--

Assertion failed: getMinSignedBits() <= 64 && "Too many bits for int64_t", file
E:\llvm\llvm-project\llvm\include\llvm/ADT/APInt.h, line 1635
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace.
Stack dump:
0.  Program arguments: ninja\bin\llc -mtriple=x86_64-- -o - fuzz.ll
1.  Running pass 'Function Pass Manager' on module 'fuzz.ll'.
2.  Running pass 'CodeGen Prepare' on function '@fuzz22357'

-- 
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 45455] Invalid undef splat in instcombine

2020-05-20 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=45455

Sanjay Patel  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #1 from Sanjay Patel  ---


*** This bug has been marked as a duplicate of bug 45955 ***

-- 
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 46005] New: Name mangling problem when initializing inline std::function with lambda

2020-05-20 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46005

Bug ID: 46005
   Summary: Name mangling problem when initializing inline
std::function with lambda
   Product: clang
   Version: 10.0
  Hardware: PC
OS: Windows NT
Status: NEW
  Severity: normal
  Priority: P
 Component: Frontend
  Assignee: unassignedclangb...@nondot.org
  Reporter: leandro.med...@sandboxsemiconductor.com
CC: llvm-bugs@lists.llvm.org, neeil...@live.com,
richard-l...@metafoo.co.uk

The code

#include 

inline auto x = std::function([]() {});
inline auto y = std::function([]() {});

int main() { return 0; }

fails to compile with the following error message: 

error: definition with same mangled name
 
'??$_Reset@V@@@?$_Func_class@X$$V@std@@IEAAX$$QEAV@@@Z' as
another definition

I'm using the STL implementation that shipped with Visual Studio 16.5.5. The
above compiles ok on gcc (both Linux based and mingw-w64), MSVC, and Clang with
libstdc++.

-- 
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 46006] New: Wrong debug info generated at -O3 (-O0 is correct)

2020-05-20 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46006

Bug ID: 46006
   Summary: Wrong debug info generated at -O3 (-O0 is correct)
   Product: libraries
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: normal
  Priority: P
 Component: DebugInfo
  Assignee: unassignedb...@nondot.org
  Reporter: yangyib...@hust.edu.cn
CC: jdevliegh...@apple.com, keith.wal...@arm.com,
llvm-bugs@lists.llvm.org,
paul_robin...@playstation.sony.com

lldb outputs 0 when the program is compiled with "-O3". It behaves correctly
when the program is compiled with "-O0".

$ cat small.c
void foo(int *a) {
  (*a)++;
}

int main() {
  int a = 0;
  foo (&a);
  return 0;
}

$ cat cmds
b 8
r
p a


$ clang --version
clang version 11.0.0 (/home/yibiao/.cache/yay/llvm-git/llvm-project
871beba234a83a2a02da9dedbd59b91a1bfbd7af)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

$ lldb --version
lldb version 11.0.0
  clang revision 871beba234a83a2a02da9dedbd59b91a1bfbd7af
  llvm revision 871beba234a83a2a02da9dedbd59b91a1bfbd7af


$ clang -g -O0 small.c
$ lldb -s cmds -b a.out
(lldb) target create "a.out"
Current executable set to '/home/yibiao/Debugger/a.out' (x86_64).
(lldb) command source -s 0 'cmds'
Executing commands in '/home/yibiao/Debugger/cmds'.
(lldb) b 8
Breakpoint 1: where = a.out`main + 33 at small.c:8:3, address =
0x00401151
(lldb) r
Process 3458 stopped
* thread #1, name = 'a.out', stop reason = breakpoint 1.1
frame #0: 0x00401151 a.out`main at small.c:8:3
   5int main() {
   6  int a = 0;
   7  foo (&a);
-> 8  return 0;
   9}

Process 3458 launched: '/home/yibiao/Debugger/a.out' (x86_64)
(lldb) p a
(int) $0 = 1


$ clang -g -O3 small.c
$ lldb -s cmds -b a.out
(lldb) target create "a.out"
Current executable set to '/home/yibiao/Debugger/a.out' (x86_64).
(lldb) command source -s 0 'cmds'
Executing commands in '/home/yibiao/Debugger/cmds'.
(lldb) b 8
Breakpoint 1: where = a.out`main at small.c:8:3, address = 0x00401120
(lldb) r
Process 3563 stopped
* thread #1, name = 'a.out', stop reason = breakpoint 1.1
frame #0: 0x00401120 a.out`main at small.c:8:3
   5int main() {
   6  int a = 0;
   7  foo (&a);
-> 8  return 0;
   9}

Process 3563 launched: '/home/yibiao/Debugger/a.out' (x86_64)
(lldb) p a
(int) $0 = 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
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] Issue 12264 in oss-fuzz: llvm/llvm-isel-fuzzer--aarch64-gisel: ASSERT: isa(Val) && "cast() argument of incompatible type!"

2020-05-20 Thread ClusterFuzz-External via monorail via llvm-bugs
Updates:
Labels: ClusterFuzz-Verified
Status: Verified

Comment #6 on issue 12264 by ClusterFuzz-External: 
llvm/llvm-isel-fuzzer--aarch64-gisel: ASSERT: isa(Val) && "cast() 
argument of incompatible type!"
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=12264#c6

ClusterFuzz testcase 5655670880206848 is verified as fixed in 
https://oss-fuzz.com/revisions?job=libfuzzer_asan_llvm&range=202005190249:202005200248

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 46007] New: Wrong debug info generated at -O1 (-O0/O2/O3 are correct)

2020-05-20 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46007

Bug ID: 46007
   Summary: Wrong debug info generated at -O1 (-O0/O2/O3 are
correct)
   Product: libraries
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: DebugInfo
  Assignee: unassignedb...@nondot.org
  Reporter: yangyib...@hust.edu.cn
CC: jdevliegh...@apple.com, keith.wal...@arm.com,
llvm-bugs@lists.llvm.org,
paul_robin...@playstation.sony.com

The expected output from lldb should be 1, but lldb outputs -8434 when the
program is compiled with "-O1". It behaves correctly when the program is
compiled with "-O0", "-O2", and "-O3".



$ cat small.c
void foo(char *x) {
  *x = 1;
}

int main(int argc, char **argv) {
  char c[10];
  foo(c);
  return 0;
}

$ cat cmds
b 8
r
p argc


$ clang --version
clang version 11.0.0 (/home/yibiao/.cache/yay/llvm-git/llvm-project
871beba234a83a2a02da9dedbd59b91a1bfbd7af)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

$ lldb --version
lldb version 11.0.0
  clang revision 871beba234a83a2a02da9dedbd59b91a1bfbd7af
  llvm revision 871beba234a83a2a02da9dedbd59b91a1bfbd7af


$ clang -g -O1 small.c; lldb -s cmds -b a.out
(lldb) target create "a.out"
Current executable set to '/home/yibiao/Debugger/a.out' (x86_64).
(lldb) command source -s 0 'cmds'
Executing commands in '/home/yibiao/Debugger/cmds'.
(lldb) b 8
Breakpoint 1: where = a.out`main + 14 at small.c:8:3, address =
0x0040112e
(lldb) r
Process 8665 stopped
* thread #1, name = 'a.out', stop reason = breakpoint 1.1
frame #0: 0x0040112e a.out`main(argc=-8434,
argv=0x7fffe008) at small.c:8:3
   5int main(int argc, char **argv) {
   6  char c[10];
   7  foo(c);
-> 8  return 0;
   9}

Process 8665 launched: '/home/yibiao/Debugger/a.out' (x86_64)
(lldb) p argc
(int) $0 = -8434


/
When compiled with "-O0/O2/-O3", the value of argv is correct as follow.
*/ 

$ clang -g -O3 small.c; lldb -s cmds -b a.out
(lldb) target create "a.out"
Current executable set to '/home/yibiao/Debugger/a.out' (x86_64).
(lldb) command source -s 0 'cmds'
Executing commands in '/home/yibiao/Debugger/cmds'.
(lldb) b 8
Breakpoint 1: where = a.out`main at small.c:8:3, address = 0x00401120
(lldb) r
Process 8765 stopped
* thread #1, name = 'a.out', stop reason = breakpoint 1.1
frame #0: 0x00401120 a.out`main(argc=1, argv=0x7fffe008) at
small.c:8:3
   5int main(int argc, char **argv) {
   6  char c[10];
   7  foo(c);
-> 8  return 0;
   9}

Process 8765 launched: '/home/yibiao/Debugger/a.out' (x86_64)
(lldb) p argc
(int) $0 = 1

-- 
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 46008] New: Wrong line information at Og

2020-05-20 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46008

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

Line 7 should not be hit.

$ cat a.c
short a = 1;
int b, c;
void(d)() {}
int main() {
  int *p_5 = &c;
  for (; a <= 0; a = d)
if ((*p_5))
  break;
  b = *p_5;
}

$  clang -v
clang version 11.0.0 (https://github.com/llvm/llvm-project.git
268fa40daa151d3b4bff1df12b62e5dae94685d7)
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

$ lldb -v
lldb version 11.0.0
  clang revision 268fa40daa151d3b4bff1df12b62e5dae94685d7
  llvm revision 268fa40daa151d3b4bff1df12b62e5dae94685d7

$ 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:6:12, address = 0x00400490
(lldb) r
Process 334 launched: '/home/stepping/output/opt' (x86_64)
Process 334 stopped
* thread #1, name = 'opt', stop reason = breakpoint 1.1
frame #0: 0x00400490 opt`main at a.c:6:12
   3void(d)() {}
   4int main() {
   5  int *p_5 = &c;
-> 6  for (; a <= 0; a = d)
   7if ((*p_5))
   8  break;
   9  b = *p_5;
(lldb) p a
(short) $0 = 1
(lldb) s
Process 334 stopped
* thread #1, name = 'opt', stop reason = step in
frame #0: 0x00400498 opt`main at a.c:7:10
   4int main() {
   5  int *p_5 = &c;
   6  for (; a <= 0; a = d)
-> 7if ((*p_5))
   8  break;
   9  b = *p_5;
   10   }
(lldb) di
opt`main:
0x400490 <+0>:  cmpw   $0x0, 0x200b90(%rip)  ; __dso_handle + 5
->  0x400498 <+8>:  movl   0x200b92(%rip), %eax  ; opt.PT_LOAD[1]..bss + 4
0x40049e <+14>: jg 0x4004c1  ; <+49> at a.c:9:5
0x4004a0 <+16>: testl  %eax, %eax
0x4004a2 <+18>: jne0x4004c1  ; <+49> at a.c:9:5
0x4004a4 <+20>: movl   $0x400480, %ecx   ; imm = 0x400480 
0x4004a9 <+25>: nopl   (%rax)
0x4004b0 <+32>: testw  %cx, %cx
0x4004b3 <+35>: jle0x4004b0  ; <+32> at a.c:6:3
0x4004b5 <+37>: movl   $0x400480, %ecx   ; imm = 0x400480 
0x4004ba <+42>: movw   %cx, 0x200b67(%rip)   ; __dso_handle + 6
0x4004c1 <+49>: movl   %eax, 0x200b6d(%rip)  ; b
0x4004c7 <+55>: xorl   %eax, %eax
0x4004c9 <+57>: retq   
(lldb) s
Process 334 stopped
* thread #1, name = 'opt', stop reason = step in
frame #0: 0x0040049e opt`main at a.c:6:3
   3void(d)() {}
   4int main() {
   5  int *p_5 = &c;
-> 6  for (; a <= 0; a = d)
   7if ((*p_5))
   8  break;
   9  b = *p_5;
(lldb) s
Process 334 stopped
* thread #1, name = 'opt', stop reason = step in
frame #0: 0x004004c1 opt`main at a.c:9:5
   6  for (; a <= 0; a = d)
   7if ((*p_5))
   8  break;
-> 9  b = *p_5;
   10   }
(lldb) 

$ gdb opt
(gdb) b main
Breakpoint 1 at 0x400490: file a.c, line 6.
(gdb) r
Starting program: opt 

Breakpoint 1, main () at a.c:6
6 for (; a <= 0; a = d)
(gdb) s
7   if ((*p_5))
(gdb) s
6 for (; a <= 0; a = d)
(gdb) s
9 b = *p_5;
(gdb)

-- 
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 46009] New: Wrong line information at Og

2020-05-20 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46009

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

Line 8 should not be hit.

$ cat a.c
int a,  b,  c ;
int main ()
{
{int ui1 = 5,  ui2 = b;
   c =  
  ui2 == 0 ? 
  ui1 : 
  (ui1 / ui2); 
 }
}

$ clang -v
clang version 11.0.0 (https://github.com/llvm/llvm-project.git
268fa40daa151d3b4bff1df12b62e5dae94685d7)
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

$ lldb -v

$ lldb opt 
(lldb) target create "opt"
Current executable set to 'opt' (x86_64).
(lldb) b main
Breakpoint 1: where = opt`main at a.c:4:26, address = 0x00400480
(lldb) r
Process 65 launched: 'opt' (x86_64)
Process 65 stopped
* thread #1, name = 'opt', stop reason = breakpoint 1.1
frame #0: 0x00400480 opt`main at a.c:4:26
   1int a,  b,  c ;
   2int main ()
   3{
-> 4{int ui1 = 5,  ui2 = b;
   5   c =  
   6  ui2 == 0 ? 
   7  ui1 : 
(lldb) s
Process 65 stopped
* thread #1, name = 'opt', stop reason = step in
frame #0: 0x00400486 opt`main at a.c:8:16
   5   c =  
   6  ui2 == 0 ? 
   7  ui1 : 
-> 8  (ui1 / ui2); 
   9 }
   10   }
(lldb) di
opt`main:
0x400480 <+0>:  movl   0x200ba6(%rip), %ecx  ; b
->  0x400486 <+6>:  movl   $0x5, %eax
0x40048b <+11>: testl  %ecx, %ecx
0x40048d <+13>: je 0x400493  ; <+19> at a.c:5:10
0x40048f <+15>: xorl   %edx, %edx
0x400491 <+17>: idivl  %ecx
0x400493 <+19>: movl   %eax, 0x200b97(%rip)  ; c
0x400499 <+25>: xorl   %eax, %eax
0x40049b <+27>: retq   
(lldb) s
Process 65 stopped
* thread #1, name = 'opt', stop reason = step in
frame #0: 0x0040048b opt`main at a.c:6:15
   3{
   4{int ui1 = 5,  ui2 = b;
   5   c =  
-> 6  ui2 == 0 ? 
   7  ui1 : 
   8  (ui1 / ui2); 
   9 }
(lldb) s
Process 65 stopped
* thread #1, name = 'opt', stop reason = step in
frame #0: 0x00400493 opt`main at a.c:5:10
   2int main ()
   3{
   4{int ui1 = 5,  ui2 = b;
-> 5   c =  
   6  ui2 == 0 ? 
   7  ui1 : 
   8  (ui1 / ui2); 
(lldb) s
Process 65 stopped
* thread #1, name = 'opt', stop reason = step in
frame #0: 0x00400499 opt`main at a.c:10:1
   7  ui1 : 
   8  (ui1 / ui2); 
   9 }
-> 10   }

-- 
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 22047 in oss-fuzz: llvm:clang-fuzzer: Stack-overflow in clang::NumericLiteralParser::isValidUDSuffix

2020-05-20 Thread ClusterFuzz-External via monorail via llvm-bugs
Updates:
Labels: ClusterFuzz-Verified
Status: Verified

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

ClusterFuzz testcase 5722166789406720 is verified as fixed in 
https://oss-fuzz.com/revisions?job=libfuzzer_asan_llvm&range=202005190249:202005200248

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 46010] New: Confusing backtrace at -O2

2020-05-20 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46010

Bug ID: 46010
   Summary: Confusing backtrace at -O2
   Product: clang
   Version: unspecified
  Hardware: PC
OS: All
Status: NEW
  Severity: enhancement
  Priority: P
 Component: LLVM Codegen
  Assignee: unassignedclangb...@nondot.org
  Reporter: qrzh...@gatech.edu
CC: llvm-bugs@lists.llvm.org, neeil...@live.com,
richard-l...@metafoo.co.uk

When stopped at line 4, the backtrack should be main->b. With "-O2", it gives
main->d->b. See the following example. At "-O2", only breakpoint 1.3 was hit.


$ clang-trunk -v
clang version 11.0.0 (https://github.com/llvm/llvm-project.git
58684fbb6f2e6871f3f96ac8c7166a7d7486e971)



#expected backtrace
$ clang-trunk -g abc.c
$ lldb-trunk -s cmds -b a.out
(lldb) b 4
Breakpoint 1: where = a.out`b + 18 at abc.c:4:4, address = 0x00400492
(lldb) r
Process 1631 stopped
* thread #1, name = 'a.out', stop reason = breakpoint 1.1
frame #0: 0x00400492 a.out`b at abc.c:4:4
   1int a;
   2void b() {
   3  int *c = &a;
-> 4  *c = 0; // stop here
   5}
   6void d() { b(); }
   7int main() {

Process 1631 launched: '/home/absozero/projects/LLDB-testing/reduce/a.out'
(x86_64)
(lldb) bt
* thread #1, name = 'a.out', stop reason = breakpoint 1.1
  * frame #0: 0x00400492 a.out`b at abc.c:4:4
frame #1: 0x004004b9 a.out`main at abc.c:8:3
frame #2: 0x77a05b97 libc.so.6`__libc_start_main + 231
frame #3: 0x004003ba a.out`_start + 42
(lldb) kill



#backtrace at -O2
$ clang-trunk -g abc.c -O2
$ lldb-trunk -s cmds -b a.out
(lldb) b 4
Breakpoint 1: 3 locations.
(lldb) r
Process 17759 stopped
* thread #1, name = 'a.out', stop reason = breakpoint 1.3
frame #0: 0x004004a0 a.out`main [inlined] b at abc.c:4:6
   1int a;
   2void b() {
   3  int *c = &a;
-> 4  *c = 0; // stop here
   5}
   6void d() { b(); }
   7int main() {

Process 17759 launched: '/home/absozero/projects/LLDB-testing/reduce/a.out'
(x86_64)
(lldb) bt
* thread #1, name = 'a.out', stop reason = breakpoint 1.3
  * frame #0: 0x004004a0 a.out`main [inlined] b at abc.c:4:6
frame #1: 0x004004a0 a.out`main [inlined] d at abc.c:6
frame #2: 0x004004a0 a.out`main at abc.c:9
frame #3: 0x77a05b97 libc.so.6`__libc_start_main + 231
frame #4: 0x004003ba a.out`_start + 42
(lldb) kill


$ cat abc.c
int a;
void b() {
  int *c = &a;
  *c = 0; // stop here
}
void d() { b(); }
int main() {
  b();
  d();
}

$ cat cmds
b 4
r
bt
kill
q

-- 
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 45911] Data sharing and lambda capture: No context value for inlined OpenMP region

2020-05-20 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=45911

Alexey Bataev  changed:

   What|Removed |Added

 CC||a.bat...@hotmail.com
 Status|NEW |RESOLVED
 Resolution|--- |FIXED
 Fixed By Commit(s)||414afdf940e8473db4156d0c1bc
   ||500ec527f1a1f

-- 
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 45995] X86 bugs in extract value and select with type v4i1

2020-05-20 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=45995

Aart Bik  changed:

   What|Removed |Added

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

-- 
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 46010] Confusing backtrace at -O2

2020-05-20 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46010

Davide Italiano  changed:

   What|Removed |Added

 Resolution|--- |INVALID
 Status|NEW |RESOLVED

--- Comment #2 from Davide Italiano  ---
I agree with Dave :)

-- 
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 20913 in oss-fuzz: llvm:clang-fuzzer: ASSERT: DD && "queried property of class with no definition"

2020-05-20 Thread sheriffbot via monorail via llvm-bugs
Updates:
Labels: Deadline-Approaching

Comment #1 on issue 20913 by sheriffbot: llvm:clang-fuzzer: ASSERT: DD && 
"queried property of class with no definition"
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20913#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 46011] New: Toy Fibonacci program in IR causes segfault during optimization passes

2020-05-20 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46011

Bug ID: 46011
   Summary: Toy Fibonacci program in IR causes segfault during
optimization passes
   Product: libraries
   Version: 10.0
  Hardware: All
OS: All
Status: NEW
  Severity: normal
  Priority: P
 Component: Loop Optimizer
  Assignee: unassignedb...@nondot.org
  Reporter: amb...@gmail.com
CC: llvm-bugs@lists.llvm.org

The following program crashes clang in the llvm optimization passes on OSX,
Windows/MSYS64, and Linux Mint.

It's entirely possible the program has a bug, but it should probably return a
more graceful error, rather than crashing the compiler.

; crash.ll
define i64 @fib(i64 %n) {
entry:
  %is0 = icmp eq i64 %n, 0
  br i1 %is0, label %return_0, label %loop
return_0:
  ret i64 0
loop:
  %i = phi i64 [2, %entry], [%ii, %loop]
  %ii = add i64 %i, 1

  %a = phi i64 [1, %entry], [%b, %loop]
  %b = phi i64 [1, %entry], [%c, %loop]
  %c = add i64 %a, %b

  %continue = icmp ule i64 %ii, %n
  br i1 %continue, label %loop, label %done
done:
  ret i64 %b
}


Stack trace from Windows/MSYS64 (the other platforms appear to have the same
crash, but with less complete stack traces).

$ clang -S crash.ll -o crashopt.ll -emit-llvm -O1
warning: overriding the module target triple with x86_64-w64-windows-gnu
[-Woverride-module]
Stack dump:
0.  Program arguments: C:\msys64\mingw64\bin\clang.exe -cc1 -triple
x86_64-w64-windows-gnu -emit-llvm -disable-free -disable-llvm-verifier
-discard-value-names -main-file-name crash.ll -mrelocation-model pic -pic-level
2 -mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases
-munwind-tables -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb
-momit-leaf-frame-pointer -coverage-notes-file
C:\Users\ambrus\llvmcrash\crashopt.gcno -resource-dir
C:\msys64\mingw64\lib\clang\9.0.0 -O1 -fdebug-compilation-dir
C:\Users\ambrus\llvmcrash -ferror-limit 19 -fmessage-length 0
-fno-use-cxa-atexit -fobjc-runtime=gcc -fseh-exceptions
-fdiagnostics-show-option -faddrsig -o crashopt.ll -x ir crash.ll
1.  Per-module optimization passes
2.  Running pass 'CallGraph Pass Manager' on module 'crash.ll'.
3.  Running pass 'Combine redundant instructions' on function '@fib'
 #0 0x6cf43bf0 llvm::InstCombiner::visitPHINode(llvm::PHINode&)
(C:\msys64\mingw64\bin\libLLVM.dll+0xb83bf0)
 #1 0x6ceb9002 llvm::InstCombiner::run()
(C:\msys64\mingw64\bin\libLLVM.dll+0xaf9002)
 #2 0x6ceba951 llvm::InstCombiner::run()
(C:\msys64\mingw64\bin\libLLVM.dll+0xafa951)
 #3 0x6cebaca4
llvm::InstructionCombiningPass::runOnFunction(llvm::Function&)
(C:\msys64\mingw64\bin\libLLVM.dll+0xafaca4)
 #4 0x6c59fef8 llvm::FPPassManager::runOnFunction(llvm::Function&)
(C:\msys64\mingw64\bin\libLLVM.dll+0x1dfef8)
 #5 0x6d344d71 llvm::initializeDummyCGSCCPassPass(llvm::PassRegistry&)
(C:\msys64\mingw64\bin\libLLVM.dll+0xf84d71)
 #6 0x6c59f2cb llvm::legacy::PassManagerImpl::run(llvm::Module&)
(C:\msys64\mingw64\bin\libLLVM.dll+0x1df2cb)
 #7 0x67ff2633 clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::HeaderSearchOptions const&, clang::CodeGenOptions const&,
clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout
const&, llvm::Module*, clang::BackendAction,
std::unique_ptr >)
(C:\msys64\mingw64\bin\libclang-cpp.dll+0xbf2633)
 #8 0x6829fa60 clang::CodeGenAction::ExecuteAction()
(C:\msys64\mingw64\bin\libclang-cpp.dll+0xe9fa60)
 #9 0x6895ccd9 clang::FrontendAction::Execute()
(C:\msys64\mingw64\bin\libclang-cpp.dll+0x155ccd9)
#10 0x6891cb81
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(C:\msys64\mingw64\bin\libclang-cpp.dll+0x151cb81)
#11 0x689bf689
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(C:\msys64\mingw64\bin\libclang-cpp.dll+0x15bf689)
#12 0x0040217b (C:\msys64\mingw64\bin\clang.exe+0x217b)
#13 0x00413b07 (C:\msys64\mingw64\bin\clang.exe+0x13b07)
#14 0x004013b4 (C:\msys64\mingw64\bin\clang.exe+0x13b4)
#15 0x0040150b (C:\msys64\mingw64\bin\clang.exe+0x150b)
#16 0x7ffc34f37bd4 (C:\WINDOWS\System32\KERNEL32.DLL+0x17bd4)
#17 0x7ffc350ace51 (C:\WINDOWS\SYSTEM32\ntdll.dll+0x6ce51)
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 9.0.0 (https://github.com/msys2/MINGW-packages.git
ded8515833d0acc22453a8b5d2adb73cbf355fe1)
Target: x86_64-w64-windows-gnu
Thread model: posix
InstalledDir: C:\msys64\mingw64\bin
clang: note: diagnostic msg: PLEASE submit a bug report to
https://bugs.llvm.org/ and include the crash backtrace, preprocessed source,
and associated run script.
clang: note: diagnostic msg: Error generating preprocessed source(s) - no
preprocessable inputs.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

[llvm-bugs] [Bug 45816] Bit field alignment

2020-05-20 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=45816

Jake Merdich  changed:

   What|Removed |Added

 Status|CONFIRMED   |RESOLVED
 CC||jake.merd...@amd.com
 Resolution|--- |FIXED

--- Comment #3 from Jake Merdich  ---
Final fix in https://reviews.llvm.org/D80176 (b99bf0e).

-- 
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 45307] temp_directory_path() returns path with trailing slash

2020-05-20 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=45307

Louis Dionne  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |WONTFIX

--- Comment #4 from Louis Dionne  ---
Revisiting this, I think returning the environment variable as-is is fine. In
the test program, we should canonicalize the result of
`fs::temp_directory_path()` if we want to check the assertion we're checking.

I'd also argue that `path{"/tmp"}` and `path{"/tmp/"}` should probably compare
equal, but that's a DR if anything.

-- 
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 42707] [C++] Assertion fires in CastExpr::CastConsistency

2020-05-20 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=42707

Anastasia Stulova  changed:

   What|Removed |Added

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

-- 
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 46012] New: declare target pointer cannot be accessed in target region

2020-05-20 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46012

Bug ID: 46012
   Summary: declare target pointer cannot be accessed in target
region
   Product: OpenMP
   Version: unspecified
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Runtime Library
  Assignee: unassignedb...@nondot.org
  Reporter: xw111lu...@gmail.com
CC: llvm-bugs@lists.llvm.org

In the following example, a pointer in declare target doesn't get the mapped
address. IBM XL works.

Clang run output:
arr omp_target_is_present 0
arr initial device address (nil)
arr host address 0x13e2f20
arr omp_target_is_present 1
arr device address inside map 0x7f953680
device address 0 (nil)
device address 1 (nil)
device address 2 (nil)
arr omp_target_is_present 0
arr final device address (nil)

#include 
#include 
#include 

#pragma omp declare target
int * arr;

void foo(int i)
{
  printf("devuce address %d %p\n", i, arr);
}
#pragma omp end declare target

int main(void)
{
  // Allocate array and set to zero
  int len = 3;
  arr = (int *) calloc( len, sizeof(int) );

  printf("arr omp_target_is_present %d\n", omp_target_is_present(arr, 0));
  #pragma omp target data use_device_ptr(arr)
  {
printf("arr initial device address %p\n", arr);
  }

  #pragma omp target data map(tofrom: arr[:len])
  {
printf("arr host address %p\n", arr);
printf("arr omp_target_is_present %d\n", omp_target_is_present(arr, 0));
#pragma omp target data use_device_ptr(arr)
{
  printf("arr device address inside map %p\n", arr);
}

#pragma omp target teams distribute parallel for
for( int i = 0; i < len; i++)
  foo(i);
  }

  printf("arr omp_target_is_present %d\n", omp_target_is_present(arr, 0));
  #pragma omp target data use_device_ptr(arr)
  {
printf("arr final device address %p\n", arr);
  }

  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
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 46013] New: Failure to optimize out casting in division of casted char (to int)

2020-05-20 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46013

Bug ID: 46013
   Summary: Failure to optimize out casting in division of casted
char (to int)
   Product: libraries
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Scalar Optimizations
  Assignee: unassignedb...@nondot.org
  Reporter: gabrav...@gmail.com
CC: llvm-bugs@lists.llvm.org

int f(signed char a)
{
return (((unsigned int)(int)a) / 2LL);
}

This can be optimized to `return (unsigned)(int)a >> 1;`. This transformation
is done by GCC, but not by 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
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 46011] Toy Fibonacci program in IR causes segfault during optimization passes

2020-05-20 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46011

Ambrus Csaszar  changed:

   What|Removed |Added

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

--- Comment #2 from Ambrus Csaszar  ---
Florian, thank you for the quick and helpful reply! I do see that opt produces
an error message instead of crashing blindly.

-- 
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 22386 in oss-fuzz: llvm:llvm-isel-fuzzer--aarch64-O2: Heap-use-after-free in SimplifyCFGOpt::simplifyOnce

2020-05-20 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 Security_Severity-High Reported-2020-05-21
Type: Bug-Security

New issue 22386 by ClusterFuzz-External: llvm:llvm-isel-fuzzer--aarch64-O2: 
Heap-use-after-free in SimplifyCFGOpt::simplifyOnce
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=22386

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

Project: llvm
Fuzzing Engine: libFuzzer
Fuzz Target: llvm-isel-fuzzer--aarch64-O2
Job Type: libfuzzer_asan_llvm
Platform Id: linux

Crash Type: Heap-use-after-free READ 4
Crash Address: 0x60706f5c
Crash State:
  SimplifyCFGOpt::simplifyOnce
  llvm::simplifyCFG
  iterativelySimplifyCFG
  
Sanitizer: address (ASAN)

Recommended Security Severity: High

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

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

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