[llvm-bugs] [Bug 44749] New: Assertion `SrcReg && SrcMO.isUse() && "two address instruction invalid"' failed.

2020-02-01 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=44749

Bug ID: 44749
   Summary: Assertion `SrcReg && SrcMO.isUse() && "two address
instruction invalid"' failed.
   Product: clang
   Version: trunk
  Hardware: PC
OS: All
Status: NEW
  Severity: normal
  Priority: P
 Component: -New Bugs
  Assignee: unassignedclangb...@nondot.org
  Reporter: changoch...@gmail.com
CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org,
neeil...@live.com, richard-l...@metafoo.co.uk

POC:
---
# 1 ""
# 1 "test1.c"
a() { return (calloc + 1 ? 1 : 0) - 100.00 <= b() ? 1 : 3.14; }
---


Run script:
---
# Crash reproducer for clang version 11.0.0
(https://github.com/llvm/llvm-project.git
56b7f595d2b402ff177ca42214325c8fdea10fb0)
# Driver args: "-x" "c" "-o" "test" "test1.c"
# Original command:  "/home/rxz226/llvm-project/bld_instru/bin/clang-11" "-cc1"
"-triple" "x86_64-unknown-linux-gnu" "-emit-obj" "-mrelax-all" "-disable-free"
"-main-file-name" "test1.c" "-mrelocation-model" "static" "-mthread-model"
"posix" "-mframe-pointer=all" "-fmath-errno" "-fno-rounding-math"
"-masm-verbose" "-mconstructor-aliases" "-munwind-tables" "-target-cpu"
"x86-64" "-dwarf-column-info" "-fno-split-dwarf-inlining"
"-debugger-tuning=gdb" "-resource-dir"
"/home/rxz226/llvm-project/bld_instru/lib/clang/11.0.0" "-internal-isystem"
"/usr/local/include" "-internal-isystem"
"/home/rxz226/llvm-project/bld_instru/lib/clang/11.0.0/include"
"-internal-externc-isystem" "/usr/include/x86_64-linux-gnu"
"-internal-externc-isystem" "/include" "-internal-externc-isystem"
"/usr/include" "-fdebug-compilation-dir" "/home/rxz226/fuzz_clang4/hangs/test"
"-ferror-limit" "19" "-fmessage-length" "0" "-fgnuc-version=4.2.1"
"-fobjc-runtime=gcc" "-fdiagnostics-show-option" "-fcolor-diagnostics"
"-faddrsig" "-o" "/tmp/test1-faa68f.o" "-x" "c" "test1.c"
 "/home/rxz226/llvm-project/bld_instru/bin/clang-11" "-cc1" "-triple"
"x86_64-unknown-linux-gnu" "-emit-obj" "-mrelax-all" "-disable-free"
"-main-file-name" "test1.c" "-mrelocation-model" "static" "-mthread-model"
"posix" "-mframe-pointer=all" "-fmath-errno" "-fno-rounding-math"
"-masm-verbose" "-mconstructor-aliases" "-munwind-tables" "-target-cpu"
"x86-64" "-dwarf-column-info" "-fno-split-dwarf-inlining"
"-debugger-tuning=gdb" "-ferror-limit" "19" "-fmessage-length" "0"
"-fgnuc-version=4.2.1" "-fobjc-runtime=gcc" "-fdiagnostics-show-option"
"-fcolor-diagnostics" "-faddrsig" "-x" "c" "test1-5d5af5.c"
---

Stack dump:
---
clang:
/home/rxz226/llvm-project/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1480:
bool (anonymous
namespace)::TwoAddressInstructionPass::collectTiedOperands(llvm::MachineInstr
*, (anonymous namespace)::TwoAddressInstructionPass::TiedOperandMap &):
Assertion `SrcReg && SrcMO.isUse() && "two address instruction invalid"'
failed.
Stack dump:
0.  Program arguments: /home/rxz226/llvm-project/bld_instru/bin/clang -x c
-o test test1.c
1.   parser at end of file
2.  Code generation
3.  Running pass 'Function Pass Manager' on module 'test1.c'.
4.  Running pass 'Two-Address instruction pass' on function '@a'
 #0 0x0681faf6 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/rxz226/llvm-project/llvm/lib/Support/Unix/Signals.inc:560:7
 #1 0x0681ac5e llvm::sys::RunSignalHandlers()
/home/rxz226/llvm-project/llvm/lib/Support/Signals.cpp:69:18
 #2 0x0681dd30 llvm::sys::CleanupOnSignal(unsigned long)
/home/rxz226/llvm-project/llvm/lib/Support/Unix/Signals.inc:361:3
 #3 0x0662a5aa (anonymous
namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long)
/home/rxz226/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:80:5
 #4 0x0662a9e6
/home/rxz226/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:361:51
 #5 0x7f8954dad390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
 #6 0x7f8953917428 raise
/build/glibc-LK5gWL/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
 #7 0x7f895391902a abort /build/glibc-LK5gWL/glibc-2.23/stdlib/abort.c:91:0
 #8 0x7f895390fbd7 __assert_fail_base
/build/glibc-LK5gWL/glibc-2.23/assert/assert.c:92:0
 #9 0x7f895390fc82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
#10 0x04cc6b83 llvm::MachineOperand::isKill() const
/home/rxz226/llvm-project/llvm/include/llvm/CodeGen/MachineOperand.h:389:5
#11 0x04cc6b83 (anonymous
namespace)::TwoAddressInstructionPass::eliminateRegSequence(llvm::MachineInstrBundleIterator&)
/home/rxz226/llvm-project/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1826:0
#12 0x04cc6b83 (anonymous
namespace)::TwoAddressInstructionPass::runOnMachineFunction(llvm::MachineFunction&)
/home/rxz226/llvm-project/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1716:0
#13 0x04775489
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
/home/rxz226/llvm-project/llvm/lib/CodeGen/MachineFunc

[llvm-bugs] [Bug 44750] New: Crash in UNREACHABLE executed at llvm/lib/CodeGen/RegAllocFast.cpp:509!

2020-02-01 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=44750

Bug ID: 44750
   Summary: Crash in UNREACHABLE executed at
llvm/lib/CodeGen/RegAllocFast.cpp:509!
   Product: clang
   Version: trunk
  Hardware: PC
OS: All
Status: NEW
  Severity: release blocker
  Priority: P
 Component: -New Bugs
  Assignee: unassignedclangb...@nondot.org
  Reporter: changoch...@gmail.com
CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org,
neeil...@live.com, richard-l...@metafoo.co.uk

POC:
---
# 1 ""
# 1 "test1.c"
a;
char b;
c() {
  d();
  a = 0 > calloc;
  b = (struct {int e} *)0 - 30;
}
---

Run script:
---
# Crash reproducer for clang version 11.0.0
(https://github.com/llvm/llvm-project.git
56b7f595d2b402ff177ca42214325c8fdea10fb0)
# Driver args: "-x" "c" "-o" "test" "test1.c"
# Original command:  "/home/rxz226/llvm-project/bld_instru/bin/clang-11" "-cc1"
"-triple" "x86_64-unknown-linux-gnu" "-emit-obj" "-mrelax-all" "-disable-free"
"-main-file-name" "test1.c" "-mrelocation-model" "static" "-mthread-model"
"posix" "-mframe-pointer=all" "-fmath-errno" "-fno-rounding-math"
"-masm-verbose" "-mconstructor-aliases" "-munwind-tables" "-target-cpu"
"x86-64" "-dwarf-column-info" "-fno-split-dwarf-inlining"
"-debugger-tuning=gdb" "-resource-dir"
"/home/rxz226/llvm-project/bld_instru/lib/clang/11.0.0" "-internal-isystem"
"/usr/local/include" "-internal-isystem"
"/home/rxz226/llvm-project/bld_instru/lib/clang/11.0.0/include"
"-internal-externc-isystem" "/usr/include/x86_64-linux-gnu"
"-internal-externc-isystem" "/include" "-internal-externc-isystem"
"/usr/include" "-fdebug-compilation-dir" "/home/rxz226/fuzz_clang3/hangs/test"
"-ferror-limit" "19" "-fmessage-length" "0" "-fgnuc-version=4.2.1"
"-fobjc-runtime=gcc" "-fdiagnostics-show-option" "-fcolor-diagnostics"
"-faddrsig" "-o" "/tmp/test1-4703f7.o" "-x" "c" "test1.c"
 "/home/rxz226/llvm-project/bld_instru/bin/clang-11" "-cc1" "-triple"
"x86_64-unknown-linux-gnu" "-emit-obj" "-mrelax-all" "-disable-free"
"-main-file-name" "test1.c" "-mrelocation-model" "static" "-mthread-model"
"posix" "-mframe-pointer=all" "-fmath-errno" "-fno-rounding-math"
"-masm-verbose" "-mconstructor-aliases" "-munwind-tables" "-target-cpu"
"x86-64" "-dwarf-column-info" "-fno-split-dwarf-inlining"
"-debugger-tuning=gdb" "-ferror-limit" "19" "-fmessage-length" "0"
"-fgnuc-version=4.2.1" "-fobjc-runtime=gcc" "-fdiagnostics-show-option"
"-fcolor-diagnostics" "-faddrsig" "-x" "c" "test1-a10414.c"
---


stack dump:
---
Instruction uses an alias of an allocated register
UNREACHABLE executed at
/home/rxz226/llvm-project/llvm/lib/CodeGen/RegAllocFast.cpp:509!
Stack dump:
0.  Program arguments: /home/rxz226/llvm-project/bld_instru/bin/clang -x c
-o test test1.c
1.   parser at end of file
2.  Code generation
3.  Running pass 'Function Pass Manager' on module 'test1.c'.
4.  Running pass 'Fast Register Allocator' on function '@c'
 #0 0x0681faf6 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/rxz226/llvm-project/llvm/lib/Support/Unix/Signals.inc:560:7
 #1 0x0681ac5e llvm::sys::RunSignalHandlers()
/home/rxz226/llvm-project/llvm/lib/Support/Signals.cpp:69:18
 #2 0x0681dd30 llvm::sys::CleanupOnSignal(unsigned long)
/home/rxz226/llvm-project/llvm/lib/Support/Unix/Signals.inc:361:3
 #3 0x0662a5aa (anonymous
namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long)
/home/rxz226/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:80:5
 #4 0x0662a9e6
/home/rxz226/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:361:51
 #5 0x7f2e67b7d390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
 #6 0x7f2e666e7428 raise
/build/glibc-LK5gWL/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
 #7 0x7f2e666e902a abort /build/glibc-LK5gWL/glibc-2.23/stdlib/abort.c:91:0
 #8 0x0663a594
/home/rxz226/llvm-project/llvm/lib/Support/ErrorHandling.cpp:209:3
 #9 0x04e4db86 (anonymous
namespace)::RegAllocFast::usePhysReg(llvm::MachineOperand&)
/home/rxz226/llvm-project/llvm/lib/CodeGen/RegAllocFast.cpp:494:7
#10 0x04e4db86 (anonymous
namespace)::RegAllocFast::allocateInstruction(llvm::MachineInstr&)
/home/rxz226/llvm-project/llvm/lib/CodeGen/RegAllocFast.cpp:1064:0
#11 0x04e4778b (anonymous
namespace)::RegAllocFast::allocateBasicBlock(llvm::MachineBasicBlock&)
/home/rxz226/llvm-project/llvm/lib/CodeGen/RegAllocFast.cpp:1264:25
#12 0x04e4778b (anonymous
namespace)::RegAllocFast::runOnMachineFunction(llvm::MachineFunction&)
/home/rxz226/llvm-project/llvm/lib/CodeGen/RegAllocFast.cpp:1316:0
#13 0x04775489
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
/home/rxz226/llvm-project/llvm/lib/CodeGen/MachineFunctionPass.cpp:75:7
#14 0x052a3f93 llvm::FPPassManager::runOnFunction(llvm::Function&)
/home/rxz226/llvm-project/llvm/lib/IR/L

[llvm-bugs] [Bug 44749] Assertion `SrcReg && SrcMO.isUse() && "two address instruction invalid"' failed.

2020-02-01 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=44749

Craig Topper  changed:

   What|Removed |Added

 Fixed By Commit(s)||a57dd66d5e1c7e2514d42afdcb7
   ||4566b76552e60
 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #1 from Craig Topper  ---
Fixed in a57dd66d5e1c7e2514d42afdcb74566b76552e60

-- 
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 44751] New: Assertion failure in class template with function with terse concept syntax where concept has decltype(previous_deduced_parameter) as explicit concept argument

2020-02-01 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=44751

Bug ID: 44751
   Summary: Assertion failure in class template with function with
terse concept syntax where concept has
decltype(previous_deduced_parameter) as explicit
concept argument
   Product: clang
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: C++2a
  Assignee: unassignedclangb...@nondot.org
  Reporter: da...@doublewise.net
CC: blitzrak...@gmail.com, erik.pilking...@gmail.com,
llvm-bugs@lists.llvm.org, richard-l...@metafoo.co.uk

The following code

```
template
concept true_ = true;

template
struct s {
template
static void f(A a, true_ auto)
{
}
};

auto x = s();
```

causes an assertion failure of

```
clang++: /home/david/llvm/clang/lib/Sema/SemaTemplateInstantiate.cpp:3394:
llvm::PointerUnion*>*
clang::LocalInstantiationScope::findInstantiationOf(const clang::Decl*):
Assertion `isa(D) && "declaration not instantiated in this scope"'
failed.
Stack dump:
0.  Program arguments: /home/david/llvm/build/bin/clang++ -std=c++2a -o
/dev/null -c /home/david/test/main.cpp 
1.  /home/david/test/main.cpp:12:18: current parser token ';'
2.  /home/david/test/main.cpp:5:8: instantiating class definition 's'
 #0 0x5584dcc0581a llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/home/david/llvm/build/bin/clang+++0x1aba81a)
 #1 0x5584dcc034b4 llvm::sys::RunSignalHandlers()
(/home/david/llvm/build/bin/clang+++0x1ab84b4)
 #2 0x5584dcc03729 llvm::sys::CleanupOnSignal(unsigned long)
(/home/david/llvm/build/bin/clang+++0x1ab8729)
 #3 0x5584dcb78525 (anonymous
namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long)
(/home/david/llvm/build/bin/clang+++0x1a2d525)
 #4 0x5584dcb78ac0
llvm::CrashRecoveryContext::registerCleanup(llvm::CrashRecoveryContextCleanup*)
(/home/david/llvm/build/bin/clang+++0x1a2dac0)
 #5 0x7f8575fdb930 __restore_rt (/usr/lib/libpthread.so.0+0x14930)
 #6 0x7f8575a56f25 raise (/usr/lib/libc.so.6+0x3bf25)
 #7 0x7f8575a40897 abort (/usr/lib/libc.so.6+0x25897)
 #8 0x7f8575a40767 _nl_load_domain.cold (/usr/lib/libc.so.6+0x25767)
 #9 0x7f8575a4f526 (/usr/lib/libc.so.6+0x34526)
#10 0x5584def29eac
clang::LocalInstantiationScope::findInstantiationOf(clang::Decl const*)
(/home/david/llvm/build/bin/clang+++0x3ddeeac)
#11 0x5584def7ad79 clang::Sema::FindInstantiatedDecl(clang::SourceLocation,
clang::NamedDecl*, clang::MultiLevelTemplateArgumentList const&, bool)
(.localalias) (/home/david/llvm/build/bin/clang+++0x3e2fd79)
#12 0x5584def22e15 (anonymous
namespace)::TemplateInstantiator::TransformDecl(clang::SourceLocation,
clang::Decl*) (/home/david/llvm/build/bin/clang+++0x3dd7e15)
#13 0x5584def4fc83 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformDeclRefExpr(clang::DeclRefExpr*)
(/home/david/llvm/build/bin/clang+++0x3e04c83)
#14 0x5584def50187 (anonymous
namespace)::TemplateInstantiator::TransformDeclRefExpr(clang::DeclRefExpr*)
(/home/david/llvm/build/bin/clang+++0x3e05187)
#15 0x5584def30167 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*)
(/home/david/llvm/build/bin/clang+++0x3de5167)
#16 0x5584def3ca77 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&,
clang::TypeLoc) (/home/david/llvm/build/bin/clang+++0x3df1a77)
#17 0x5584def41a80 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformType(clang::TypeSourceInfo*)
(/home/david/llvm/build/bin/clang+++0x3df6a80)
#18 0x5584def45675 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformTemplateArgument(clang::TemplateArgumentLoc
const&, clang::TemplateArgumentLoc&, bool)
(/home/david/llvm/build/bin/clang+++0x3dfa675)
#19 0x5584def46e1a bool clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformTemplateArguments(clang::TemplateArgumentLoc const*, clang::TemplateArgumentLoc const*,
clang::TemplateArgumentListInfo&, bool) (.constprop.0)
(/home/david/llvm/build/bin/clang+++0x3dfbe1a)
#20 0x5584def474a8 clang::Sema::Subst(clang::TemplateArgumentLoc const*,
unsigned int, clang::TemplateArgumentListInfo&,
clang::MultiLevelTemplateArgumentList const&)
(/home/david/llvm/build/bin/clang+++0x3dfc4a8)
#21 0x5584def6cc5c
clang::TemplateDeclInstantiator::VisitTemplateTypeParmDecl(clang::TemplateTypeParmDecl*)
(/home/david/llvm/build/bin/clang+++0x3e21c5c)
#22 0x5584def88ce3
clang::TemplateDeclInstantiator::SubstTemplateParams(clang::TemplateParameterList*)
(/home/david/llvm/build/bin/clang+++0x3e3dce3)
#23 0x5584def883ce
clang::TemplateDeclInstantiator::VisitFunctionTemplateDecl(clang::FunctionTemplateDecl*)
(/home/david/llvm/build

[llvm-bugs] [Bug 44753] New: Doxygen bug breaks static analyzer CallEvent docs

2020-02-01 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=44753

Bug ID: 44753
   Summary: Doxygen bug breaks static analyzer CallEvent docs
   Product: Documentation
   Version: trunk
  Hardware: PC
OS: All
Status: NEW
  Severity: normal
  Priority: P
 Component: Doxygen
  Assignee: unassignedb...@nondot.org
  Reporter: nicolas.alva...@gmail.com
CC: llvm-bugs@lists.llvm.org

In include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h:561 there is
this doc comment:

/// Represents a call to a block.
///
/// Example: ^{ /* ... */ }()
class BlockCall : public CallEvent {

This unfortunately triggers a bug in Doxygen where it thinks the */ is closing
the documentation comment, and the } is closing the ento namespace. This breaks
a lot of things in the generated documentation:
- BlockCall and *all the classes that follow* appear in the clang namespace
rather than clang::ento
- clang::CXXInstanceCall, clang::CXXAllocatorCall, etc (in the wrong namespace)
inherit from some unknown AnyFunctionCall that Doxygen can't find, so it also
doesn't know the inheritance chain continues up to clang::ento::CallEvent.

See https://clang.llvm.org/doxygen/classAnyFunctionCall.html

I found that this bug is already fixed in Doxygen 1.8.16:
https://github.com/doxygen/doxygen/commit/8e96d9c994e18626cd6f00ea875c7cab1d7502c4

There's two possible fixes. Either switch to Doxygen >= 1.8.16 on the server
that generates the online documentation, or change that example line to not use
comments:

/// Example: ^{ code; }()

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