[Bug 44872] New: Assertion `addr_size == 4 || addr_size == 8' failed when evaluating reference to a static array inside noinline static function in program compiled with -O2

Bug ID 44872
Summary Assertion `addr_size == 4 || addr_size == 8’ failed when evaluating reference to a static array inside noinline static function in program compiled with -O2
Product lldb
Version unspecified
Hardware PC
OS Linux
Status NEW
Severity enhancement
Priority P
Component All Bugs
Assignee lldb-dev@lists.llvm.org
Reporter pierre.vanhoutryve@arm.com
CC jdevlieghere@apple.com, llvm-bugs@lists.llvm.org

OS: Ubuntu 18.04.3 LTS

lldb version 11.0.0
  clang revision e8c3a6c2606abdbf4f207c8b22e0f532d6247564
  llvm revision e8c3a6c2606abdbf4f207c8b22e0f532d6247564

clang version 11.0.0 ([https://github.com/llvm/llvm-project.git](https://github.com/llvm/llvm-project.git)
e8c3a6c2606abdbf4f207c8b22e0f532d6247564)
Target: x86_64-unknown-linux-gnu
Thread model: posix

This happens when evaluating 'array' inside the loop (line 5) in the
lldb-bug.cpp file.

Program compiled using "clang lldb-bug.cpp -O2 -g" and then ran using "lldb
a.out".

I've attached the reproducer. I also added a "output.txt" file with the
stacktrace.