[llvm-bugs] [Bug 29061] Inline assembly: 1 byte passed with constraint S" moved into DH instead of ESI

2017-09-29 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=29061

philipp.kl...@web.de changed:

   What|Removed |Added

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

--- Comment #4 from philipp.kl...@web.de ---
I can confirm that this has been fixed by https://reviews.llvm.org/D37801.
Thank you very much!

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


[llvm-bugs] [Bug 34778] New: BraceWrapping: SplitEmptyRecord ignored when AfterFunction is true

2017-09-29 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34778

Bug ID: 34778
   Summary: BraceWrapping: SplitEmptyRecord ignored when
AfterFunction is true
   Product: clang
   Version: 5.0
  Hardware: PC
OS: Windows NT
Status: NEW
  Severity: normal
  Priority: P
 Component: Formatter
  Assignee: unassignedclangb...@nondot.org
  Reporter: gerbo.eng...@ortec-finance.com
CC: djas...@google.com, kli...@google.com,
llvm-bugs@lists.llvm.org

The following works as expected:

$ echo "template struct X{};" | clang-format -style="{BasedOnStyle:
llvm, BreakBeforeBraces: Custom, BraceWrapping: { AfterFunction: false,
AfterStruct: true, SplitEmptyRecord: false}}"
template  struct X
{};

Change AfterFunction to true:

$ echo "template struct X{};" | clang-format -style="{BasedOnStyle:
llvm, BreakBeforeBraces: Custom, BraceWrapping: { AfterFunction: true,
AfterStruct: true, SplitEmptyRecord: false}}"
template  struct X
{
};

I would not expect AfterFunction to interfere with the formatting of a struct
(combined with SplitEmptyRecord).

Might be related to https://bugs.llvm.org/show_bug.cgi?id=25132 and
https://bugs.llvm.org/show_bug.cgi?id=34008

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


[llvm-bugs] [Bug 34779] New: Assertion failure in CStringChecker::CheckLocation

2017-09-29 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34779

Bug ID: 34779
   Summary: Assertion failure in CStringChecker::CheckLocation
   Product: clang
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Static Analyzer
  Assignee: ga...@apple.com
  Reporter: ale...@google.com
CC: dcough...@apple.com, kreme...@apple.com,
llvm-bugs@lists.llvm.org, noqnoq...@gmail.com

$ cat test-__CStringChecker__evalStrcpyCommon.cc
void strcpy(unsigned char *, unsigned char *);
unsigned char a, b;
void c() { strcpy(&a, &b); }
$ clang-tidy -checks=-*,clang-analyzer-unix.cstring*
test-__CStringChecker__evalStrcpyCommon.cc -- -std=c++11
assertion failed at
llvm/tools/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp:293 in
clang::ento::ProgramStateRef (anonymous
namespace)::CStringChecker::CheckLocation(clang::ento::CheckerContext &,
clang::ento::ProgramStateRef, const clang::Expr *, clang::ento::SVal, const
char *) const: ER->getValueType() == C.getASTContext().CharTy && "CheckLocation
should only be called with char* ElementRegions"
*** Check failure stack trace: ***
@  0x52c61ca  __assert_fail
@  0x1b3b2cb  (anonymous
namespace)::CStringChecker::CheckLocation()
@  0x1b3e278  (anonymous
namespace)::CStringChecker::evalStrcpyCommon()
@  0x1b37571  (anonymous namespace)::CStringChecker::evalStrcpy()
@  0x1b36174  (anonymous namespace)::CStringChecker::evalCall()
@  0x1b34f30  clang::ento::eval::Call::_evalCall<>()
@  0x1c554b2  clang::ento::CheckerFn<>::operator()()
@  0x1c5262e  clang::ento::CheckerManager::runCheckersForEvalCall()
@  0x1cb62f9  clang::ento::ExprEngine::evalCall()
@  0x1cb61bc  clang::ento::ExprEngine::VisitCallExpr()
@  0x1c6ef27  clang::ento::ExprEngine::Visit()
@  0x1c6bf01  clang::ento::ExprEngine::ProcessStmt()
@  0x1c6bbba  clang::ento::ExprEngine::processCFGElement()
@  0x1c9a206  clang::ento::CoreEngine::HandlePostStmt()
@  0x1c99b06  clang::ento::CoreEngine::dispatchWorkItem()
@  0x1c99668  clang::ento::CoreEngine::ExecuteWorkList()
@   0xf8c365  clang::ento::ExprEngine::ExecuteWorkList()
@   0xf33992  (anonymous
namespace)::AnalysisConsumer::ActionExprEngine()
@   0xf33751  (anonymous
namespace)::AnalysisConsumer::RunPathSensitiveChecks()
@   0xf33415  (anonymous namespace)::AnalysisConsumer::HandleCode()
@   0xf26ab3  (anonymous
namespace)::AnalysisConsumer::HandleDeclsCallGraph()
@   0xf24d37  (anonymous
namespace)::AnalysisConsumer::HandleTranslationUnit()
@  0x135bf7e  clang::MultiplexConsumer::HandleTranslationUnit()
@  0x1db73d6  clang::ParseAST()
@  0x134982a  clang::ASTFrontendAction::ExecuteAction()
@  0x13492c0  clang::FrontendAction::Execute()
@  0x115f4e2  clang::CompilerInstance::ExecuteAction()
@  0x1028652 
clang::tooling::FrontendActionFactory::runInvocation()
@  0x10284f3  clang::tooling::ToolInvocation::runInvocation()

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


[llvm-bugs] [Bug 34780] New: Merge r314513 into the 5.0 branch

2017-09-29 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34780

Bug ID: 34780
   Summary: Merge r314513 into the 5.0 branch
   Product: OpenMP
   Version: unspecified
  Hardware: PC
OS: All
Status: NEW
  Severity: release blocker
  Priority: P
 Component: Runtime Library
  Assignee: unassignedb...@nondot.org
  Reporter: hah...@hahnjo.de
CC: andrey.churba...@intel.com, llvm-bugs@lists.llvm.org,
mgo...@gentoo.org, tstel...@redhat.com
Blocks: 34492

Commit r314513 fixes an uninitialized variable in omp_taskloop_grainsize.c that
has been seen while testing the 5.0.0 release:
http://lists.llvm.org/pipermail/release-testers/2017-August/000526.html


Referenced Bugs:

https://bugs.llvm.org/show_bug.cgi?id=34492
[Bug 34492] [meta] 5.0.1 Release Blockers
-- 
You are receiving this mail because:
You are on the CC list for the bug.___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 34610] Regalloc failure due to attempted reload of full register pair where only subreg is needed

2017-09-29 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34610

Jonas Paulsson  changed:

   What|Removed |Added

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

--- Comment #5 from Jonas Paulsson  ---
trunk@314516

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


[llvm-bugs] [Bug 34781] New: 'Unknown type' crash with coroutines

2017-09-29 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34781

Bug ID: 34781
   Summary: 'Unknown type' crash with coroutines
   Product: libraries
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: normal
  Priority: P
 Component: Common Code Generator Code
  Assignee: unassignedb...@nondot.org
  Reporter: sammcc...@google.com
CC: llvm-bugs@lists.llvm.org

Created attachment 19211
  --> https://bugs.llvm.org/attachment.cgi?id=19211&action=edit
bugpoint-reduced bitcode

Minimized C++ to follow

Unknown type!
UNREACHABLE executed at
/usr/local/google/home/sammccall/src/llvm2/lib/IR/ValueTypes.cpp:287!
clang(_ZN4llvm3sys15PrintStackTraceERNS_11raw_ostreamE+0x33)[0x3faf431]
clang[0x3faf4c2]
clang(_ZN4llvm3sys17RunSignalHandlersEv+0x76)[0x3fad8b0]
clang[0x3faedc9]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x10330)[0x7f7542220330]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x37)[0x7f7541017c37]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x148)[0x7f754101b028]
clang[0x3f32589]
clang(_ZN4llvm3MVT5getVTEPNS_4TypeEb+0x7e)[0x3941a90]
clang(_ZN4llvm3EVT6getEVTEPNS_4TypeEb+0x40)[0x3941c18]
clang[0x201d2cf]
clang(_ZN4llvm15ComputeValueVTsERKNS_14TargetLoweringERKNS_10DataLayoutEPNS_4TypeERNS_15SmallVectorImplINS_3EVTEEEPNS8_ImEEm+0x1bc)[0x3355cb2]
clang(_ZN4llvm19SelectionDAGBuilder20visitTargetIntrinsicERKNS_8CallInstEj+0x36c)[0x4bfa5d2]
clang(_ZN4llvm19SelectionDAGBuilder18visitIntrinsicCallERKNS_8CallInstEj+0x5ca)[0x4c00b78]
clang(_ZN4llvm19SelectionDAGBuilder9visitCallERKNS_8CallInstE+0x1b0)[0x4c0bb60]
clang(_ZN4llvm19SelectionDAGBuilder5visitEjRKNS_4UserE+0x560)[0x4be3fd6]
clang(_ZN4llvm19SelectionDAGBuilder5visitERKNS_11InstructionE+0x9f)[0x4be39d1]
clang(_ZN4llvm16SelectionDAGISel16SelectBasicBlockENS_14ilist_iteratorINS_12ilist_detail12node_optionsINS_11InstructionELb1ELb0EvEELb0ELb1EEES6_Rb+0x85)[0x4c89a95]
clang(_ZN4llvm16SelectionDAGISel20SelectAllBasicBlocksERKNS_8FunctionE+0x1527)[0x4c8f223]
clang(_ZN4llvm16SelectionDAGISel20runOnMachineFunctionERNS_15MachineFunctionE+0x754)[0x4c887b0]
clang[0x2dea7e8]
clang(_ZN4llvm19MachineFunctionPass13runOnFunctionERNS_8FunctionE+0x1c5)[0x347253f]
clang(_ZN4llvm13FPPassManager13runOnFunctionERNS_8FunctionE+0x122)[0x38c48b6]
clang(_ZN4llvm13FPPassManager11runOnModuleERNS_6ModuleE+0x61)[0x38c4a49]
clang[0x38c4de4]
clang(_ZN4llvm6legacy15PassManagerImpl3runERNS_6ModuleE+0x100)[0x38c5534]
clang(_ZN4llvm6legacy11PassManager3runERNS_6ModuleE+0x27)[0x38c5775]
clang[0x424d738]
clang(_ZN5clang17EmitBackendOutputERNS_17DiagnosticsEngineERKNS_19HeaderSearchOptionsERKNS_14CodeGenOptionsERKNS_13TargetOptionsERKNS_11LangOptionsERKN4llvm10DataLayoutEPNSE_6ModuleENS_13BackendActionESt10unique_ptrINSE_17raw_pwrite_streamESt14default_deleteISM_EE+0x3b4)[0x424ebec]
clang[0x4d6af10]
clang(_ZN5clang8ParseASTERNS_4SemaEbb+0x300)[0x59e705f]
clang(_ZN5clang17ASTFrontendAction13ExecuteActionEv+0x142)[0x4883a1e]
clang(_ZN5clang13CodeGenAction13ExecuteActionEv+0x47e)[0x4d68d40]
clang(_ZN5clang14FrontendAction7ExecuteEv+0x87)[0x488348f]
clang(_ZN5clang16CompilerInstance13ExecuteActionERNS_14FrontendActionE+0x4f9)[0x4825cdf]
clang(_ZN5clang25ExecuteCompilerInvocationEPNS_16CompilerInstanceE+0x61f)[0x49bb53a]
clang(_Z8cc1_mainN4llvm8ArrayRefIPKcEES2_Pv+0x44f)[0x1ff5140]
clang[0x1feacd9]
clang(main+0xb17)[0x1feb9c1]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5)[0x7f7541002f45]
clang[0x1fe8549]
Stack dump:
0.  Program arguments: clang -cc1 -triple x86_64-grtev4-linux-gnu -emit-obj
-target-cpu x86-64 -O2 -std=c++14 -fcoroutines-ts
-fexperimental-new-pass-manager coro1-eaadab.cpp 
1.   parser at end of file
2.  Code generation
3.  Running pass 'Function Pass Manager' on module 'coro1-eaadab.cpp'.
4.  Running pass 'X86 DAG->DAG Instruction Selection' on function
'@_Z4corov'
coro1-eaadab.sh: line 10: 52317 Aborted (core dumped) clang
-cc1 -triple x86_64-grtev4-linux-gnu -emit-obj -target-cpu x86-64 -O2
-std=c++14 -fcoroutines-ts -fexperimental-new-pass-manager coro1-eaadab.cpp

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


[llvm-bugs] [Bug 34648] segfault while linking LLVM's readline library

2017-09-29 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34648

George Rimar  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #4 from George Rimar  ---
r313741

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


[llvm-bugs] [Bug 34782] New: Assertion "Deleted edge still exists in the CFG!"

2017-09-29 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34782

Bug ID: 34782
   Summary: Assertion "Deleted edge still exists in the CFG!"
   Product: new-bugs
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: normal
  Priority: P
 Component: new bugs
  Assignee: unassignedb...@nondot.org
  Reporter: babo...@gmail.com
CC: llvm-bugs@lists.llvm.org

Looks like a recent regression, I see a lot of fails like that.

clang trunk rev314491, x86_64.

> cat f.cpp
template  class b {
public:
  a &operator[](unsigned long);
  a *c;
};
template  a &b::operator[](unsigned long d) { return c[d]; }
struct e {
  char f;
  char g;
  short h;
};
b i, j;
long k;
void l() {
  if (~(i[7].g & (1 | 16) ?: i[5].h))
;
  else
(k ?: j[4].f) ? int(short(i[7].g)) & (1 | 16ULL) ?: i[5].h
  : int(short(i[7].g)) & (1 | 16ULL) ?: i[5].h;
}

> clang++ -O2 -w f.cpp -c
clang-6.0:
/home/dybaboki/llvm/llvm-trunk-20170928/include/llvm/Support/GenericDomTreeConstruction.h:906:
static void
llvm::DomTreeBuilder::SemiNCAInfo >::DeleteEdge(DomTreeT &, const
llvm::DomTreeBuilder::SemiNCAInfo::BatchUpdatePtr, const
llvm::DomTreeBuilder::SemiNCAInfo::NodePtr, const
llvm::DomTreeBuilder::SemiNCAInfo::NodePtr) [DomTreeT =
llvm::DominatorTreeBase]: Assertion `!IsSuccessor(To,
From) && "Deleted edge still exists in the CFG!"' failed.
#0 0x0135465f llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/home/dybaboki/llvm/bin-trunk-20170928/bin/clang-6.0+0x135465f)
#1 0x01354966 SignalHandler(int)
(/home/dybaboki/llvm/bin-trunk-20170928/bin/clang-6.0+0x1354966)
#2 0x7f7769992370 __restore_rt (/lib64/libpthread.so.0+0xf370)
#3 0x7f776850e1d7 __GI_raise (/lib64/libc.so.6+0x351d7)
#4 0x7f776850f8c8 __GI_abort (/lib64/libc.so.6+0x368c8)
#5 0x7f7768507146 __assert_fail_base (/lib64/libc.so.6+0x2e146)
#6 0x7f77685071f2 (/lib64/libc.so.6+0x2e1f2)
#7 0x00e94143
(/home/dybaboki/llvm/bin-trunk-20170928/bin/clang-6.0+0xe94143)
#8 0x011b9089 llvm::JumpThreadingPass::ProcessBlock(llvm::BasicBlock*)
(/home/dybaboki/llvm/bin-trunk-20170928/bin/clang-6.0+0x11b9089)
#9 0x011b7a62 llvm::JumpThreadingPass::runImpl(llvm::Function&,
llvm::TargetLibraryInfo*, llvm::LazyValueInfo*, llvm::AAResults*,
llvm::DominatorTree*, bool, std::unique_ptr >,
std::unique_ptr >)
(/home/dybaboki/llvm/bin-trunk-20170928/bin/clang-6.0+0x11b7a62)
#10 0x011c3e0f (anonymous
namespace)::JumpThreading::runOnFunction(llvm::Function&)
(/home/dybaboki/llvm/bin-trunk-20170928/bin/clang-6.0+0x11c3e0f)
<...>

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


[llvm-bugs] [Bug 33235] clang-cl doesn't treat __declspec(nothrow) as noexcept; fails to compile

2017-09-29 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=33235

Erich Keane  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
 Fixed By Commit(s)||314462

--- Comment #4 from Erich Keane  ---
Fixed & committed here:
https://github.com/llvm-mirror/clang/commit/0c1559eed619864fc354f7932a7e6a80b7197a2a

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


[llvm-bugs] [Bug 34783] New: opt crashes with "opt -globals-aa -licm -loop-unswitch -indvars": Assertion `New->getType() == getType() && "replaceAllUses of value with new value of different type!"' fa

2017-09-29 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34783

Bug ID: 34783
   Summary: opt crashes with "opt -globals-aa -licm -loop-unswitch
-indvars": Assertion `New->getType() == getType() &&
"replaceAllUses of value with new value of different
type!"' failed
   Product: libraries
   Version: trunk
  Hardware: PC
OS: All
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Scalar Optimizations
  Assignee: unassignedb...@nondot.org
  Reporter: s...@cs.ucdavis.edu
CC: llvm-bugs@lists.llvm.org

This is tested with rev. 314493. 


$ clangpolly -v
clang version 6.0.0 (http://llvm.org/git/clang.git
2fb39644fd947db828c0d8ecf36edd2d387dac8c)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/su/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9.4
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.3.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.3.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.2.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
$ 
$ clangpolly -O3 -mllvm -disable-llvm-optzns -w -c -emit-llvm -o small.bc
small.c
$ optpolly -globals-aa -licm -loop-unswitch -indvars -o small-opt.bc small.bc
optpolly: /home/su/software/tmp/polly/llvm/lib/IR/Value.cpp:402: void
llvm::Value::doRAUW(llvm::Value*, bool): Assertion `New->getType() == getType()
&& "replaceAllUses of value with new value of different type!"' failed.
LLVMSymbolizer: error reading file: No such file or directory
#0 0x01f42e6a (optpolly+0x1f42e6a)
#1 0x01f4100e (optpolly+0x1f4100e)
#2 0x01f41170 (optpolly+0x1f41170)
#3 0x7f67617cc330 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#4 0x7f67605b4c37 gsignal
/build/eglibc-SvCtMH/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#5 0x7f67605b8028 abort
/build/eglibc-SvCtMH/eglibc-2.19/stdlib/abort.c:91:0
#6 0x7f67605adbf6 __assert_fail_base
/build/eglibc-SvCtMH/eglibc-2.19/assert/assert.c:92:0
#7 0x7f67605adca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)
#8 0x01ab90f6 (optpolly+0x1ab90f6)
#9 0x02016e7e (optpolly+0x2016e7e)
#10 0x01d74844 (optpolly+0x1d74844)
#11 0x01d77033 (optpolly+0x1d77033)
#12 0x01597833 (optpolly+0x1597833)
#13 0x01a76cdb (optpolly+0x1a76cdb)
#14 0x01a76d8c (optpolly+0x1a76d8c)
#15 0x01a779ea (optpolly+0x1a779ea)
#16 0x0089c026 (optpolly+0x89c026)
#17 0x7f676059ff45 __libc_start_main
/build/eglibc-SvCtMH/eglibc-2.19/csu/libc-start.c:321:0
#18 0x0090980a (optpolly+0x90980a)
Stack dump:
0.  Program arguments: optpolly -globals-aa -licm -loop-unswitch -indvars
-o small-opt.bc small.bc 
1.  Running pass 'Function Pass Manager' on module 'small.bc'.
2.  Running pass 'Loop Pass Manager' on function '@fn2'
3.  Running pass 'Induction Variable Simplification' on basic block
'%for.cond1.us'
Aborted (core dumped)
$ 


--


int a, b, c;

int fn1 () { return 0; }

void fn2 ()
{
  int *e = 0;
  for (; c; )
for (; a; a = fn1 ())
  if (b)
e = 0;
  e;
}

int main ()
{
  fn2 ();
  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
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 34784] New: Merge r312357 into the 5.0 branch : [TTI] Fix getGEPCost() for geps with a single operand.

2017-09-29 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34784

Bug ID: 34784
   Summary: Merge r312357 into the 5.0 branch : [TTI] Fix
getGEPCost() for geps with a single operand.
   Product: new-bugs
   Version: 5.0
  Hardware: All
OS: All
Status: NEW
  Severity: enhancement
  Priority: P
 Component: new bugs
  Assignee: unassignedb...@nondot.org
  Reporter: bage...@gmail.com
CC: llvm-bugs@lists.llvm.org
Blocks: 34492

Is it OK to merge the following revision(s) to the 5.0 branch?


Referenced Bugs:

https://bugs.llvm.org/show_bug.cgi?id=34492
[Bug 34492] [meta] 5.0.1 Release Blockers
-- 
You are receiving this mail because:
You are on the CC list for the bug.___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 34785] New: clang crashes on valid code at -Os and above on x86_64-linux-gnu: Assertion `!IsSuccessor(To, From) && "Deleted edge still exists in the CFG!"' failed

2017-09-29 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34785

Bug ID: 34785
   Summary: clang crashes on valid code at -Os and above on
x86_64-linux-gnu: Assertion `!IsSuccessor(To, From) &&
"Deleted edge still exists in the CFG!"' failed
   Product: clang
   Version: unspecified
  Hardware: PC
OS: All
Status: NEW
  Severity: enhancement
  Priority: P
 Component: -New Bugs
  Assignee: unassignedclangb...@nondot.org
  Reporter: s...@cs.ucdavis.edu
CC: llvm-bugs@lists.llvm.org

This is tested with rev. 314502. 


$ clangpolly -v
clang version 6.0.0 (http://llvm.org/git/clang.git
94efed908a60ba04964f220f0822e3463d0dcc38) (http://llvm.org/git/llvm.git
8ba98f908f0e471a51ed73bc847bc778af024eab)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/su/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.4.0
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/6.0.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.0.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
$
$ clangpolly -O1 -w small.c
$
$ clangpolly -Os -w small.c
clang-6.0:
/home/su/software/tmp/polly/llvm/include/llvm/Support/GenericDomTreeConstruction.h:906:
static void llvm::DomTreeBuilder::SemiNCAInfo::DeleteEdge(DomTreeT&,
llvm::DomTreeBuilder::SemiNCAInfo::BatchUpdatePtr,
llvm::DomTreeBuilder::SemiNCAInfo::NodePtr,
llvm::DomTreeBuilder::SemiNCAInfo::NodePtr) [with DomTreeT =
llvm::DominatorTreeBase;
llvm::DomTreeBuilder::SemiNCAInfo::BatchUpdatePtr =
llvm::DomTreeBuilder::SemiNCAInfo >::BatchUpdateInfo*;
llvm::DomTreeBuilder::SemiNCAInfo::NodePtr = llvm::BasicBlock*]:
Assertion `!IsSuccessor(To, From) && "Deleted edge still exists in the CFG!"'
failed.
#0 0x0202aafa llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/su/software/tmp/polly/llvm/lib/Support/Unix/Signals.inc:402:0
#1 0x0202896e llvm::sys::RunSignalHandlers()
/home/su/software/tmp/polly/llvm/lib/Support/Signals.cpp:50:0
#2 0x02028ae2 SignalHandler(int)
/home/su/software/tmp/polly/llvm/lib/Support/Unix/Signals.inc:242:0
#3 0x7fba44b55390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
#4 0x7fba438c7428 gsignal
/build/glibc-bfm8X4/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
#5 0x7fba438c902a abort /build/glibc-bfm8X4/glibc-2.23/stdlib/abort.c:91:0
#6 0x7fba438bfbd7 __assert_fail_base
/build/glibc-bfm8X4/glibc-2.23/assert/assert.c:92:0
#7 0x7fba438bfc82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
#8 0x01b4771d
llvm::DomTreeBuilder::SemiNCAInfo >::DeleteEdge(llvm::DominatorTreeBase&,
llvm::DomTreeBuilder::SemiNCAInfo >::BatchUpdateInfo*, llvm::BasicBlock*, llvm::BasicBlock*)
/home/su/software/tmp/polly/llvm/include/llvm/Support/GenericDomTreeConstruction.h:893:0
#9 0x01b50c8d
llvm::DomTreeBuilder::SemiNCAInfo >::ApplyUpdates(llvm::DominatorTreeBase&,
llvm::ArrayRef >)
/home/su/software/tmp/polly/llvm/include/llvm/Support/GenericDomTreeConstruction.h:1149:0
#10 0x01e8388f
std::_Vector_base,
std::allocator >
>::~_Vector_base() /usr/include/c++/5/bits/stl_vector.h:161:0
#11 0x01e8388f
std::vector,
std::allocator > >::~vector()
/usr/include/c++/5/bits/stl_vector.h:425:0
#12 0x01e8388f llvm::JumpThreadingPass::ProcessBlock(llvm::BasicBlock*)
/home/su/software/tmp/polly/llvm/lib/Transforms/Scalar/JumpThreading.cpp:1043:0
#13 0x01e84319 llvm::JumpThreadingPass::runImpl(llvm::Function&,
llvm::TargetLibraryInfo*, llvm::LazyValueInfo*, llvm::AAResults*,
llvm::DominatorTree*, bool, std::unique_ptr >,
std::unique_ptr >)
/home/su/software/tmp/polly/llvm/lib/Transforms/Scalar/JumpThreading.cpp:375:0
#14 0x01e85261 std::unique_ptr >::~unique_ptr()
/

[llvm-bugs] [Bug 34617] [X86] [ASM INTEL SYNTAX] clang generates incorrect assembler code when x86-asm-syntax=intel

2017-09-29 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34617

Konstantin Belochapka  changed:

   What|Removed |Added

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

--- Comment #1 from Konstantin Belochapka  ---
Fixed in revision:

r314140 | kbelochapka | 2017-09-25 12:26:48 -0700 (Mon, 25 Sep 2017)

[X86] [ASM INTEL SYNTAX] fix for incorrect assembler code generation when
x86-asm-syntax=intel (PR34617).
Fix for incorrect code generation when x86-asm-syntax=intel.
Differential Revision: https://reviews.llvm.org/D37945

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


[llvm-bugs] [Bug 34740] Merge r311599, r314251 and r314252 into 5.0.1

2017-09-29 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34740

Tom Stellard  changed:

   What|Removed |Added

 Fixed By Commit(s)|r311599 r314251 r314252 |r311599 r314251 r314252
   ||r314553 r314554 r314555
 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from Tom Stellard  ---
Merged: r314553 r314554 r314555

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


[llvm-bugs] [Bug 34492] [meta] 5.0.1 Release Blockers

2017-09-29 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34492
Bug 34492 depends on bug 34740, which changed state.

Bug 34740 Summary: Merge r311599, r314251 and r314252 into 5.0.1
https://bugs.llvm.org/show_bug.cgi?id=34740

   What|Removed |Added

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


[llvm-bugs] [Bug 34786] New: potential missing shrink wrapping on x86_64

2017-09-29 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34786

Bug ID: 34786
   Summary: potential missing shrink wrapping on x86_64
   Product: libraries
   Version: trunk
  Hardware: PC
OS: All
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Backend: X86
  Assignee: unassignedb...@nondot.org
  Reporter: compn...@compnerd.org
CC: llvm-bugs@lists.llvm.org

```
void (*e)(void *);

extern void g(void *);

void f(void *p) {
  if (__builtin_expect(e != (void *)0, 0))
e(p);
  g(p);
}

```

%clang_cc1 -mrelocation-model static -triple i386-apple-macosx10.4.0 -S -Os -o
- %s

Generates:

```
_f:
movl_e, %eax
testl   %eax, %eax
jne LBB0_1
jmp _g
LBB0_1:
subl$12, %esp
movl16(%esp), %ecx
movl%ecx, (%esp)
calll   *%eax
addl$12, %esp
jmp _g
```

However, note the following on x86_64:

%clang_cc1 -mrelocation-model static -triple x86_64-apple-macosx10.4.0 -S -Os
-o - %s

```
_f:
pushq   %rbx
movq%rdi, %rbx
movq_e@GOTPCREL(%rip), %rax
movq(%rax), %rax
testq   %rax, %rax
jne LBB0_1
LBB0_2:
movq%rbx, %rdi
popq%rbx
jmp _g
LBB0_1:
movq%rbx, %rdi
callq   *%rax
jmp LBB0_2
```

On the case of x86_64, we do not generate a tail call to `g`, opting to
coalesce the BBs across the tail call.  However, the call to `g` is explicitly
being marked as cold via the `__builtin_expect` with the false parameter.

Is there something that I'm overlooking or is this a limitation on our shrink
wrapping?  Seems that this may be related to PR33868.

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


[llvm-bugs] [Bug 34586] Merge r312348 into the 5.0 branch : LiveIntervalAnalysis: Fix alias regunit reserved definition

2017-09-29 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34586

Tom Stellard  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Fixed By Commit(s)|r312348 |r312348 r314565
 Resolution|--- |FIXED

--- Comment #3 from Tom Stellard  ---
Merged: r314565

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


[llvm-bugs] [Bug 34492] [meta] 5.0.1 Release Blockers

2017-09-29 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34492
Bug 34492 depends on bug 34586, which changed state.

Bug 34586 Summary: Merge r312348 into the 5.0 branch : LiveIntervalAnalysis: 
Fix alias regunit reserved definition
https://bugs.llvm.org/show_bug.cgi?id=34586

   What|Removed |Added

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


[llvm-bugs] [Bug 34492] [meta] 5.0.1 Release Blockers

2017-09-29 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34492
Bug 34492 depends on bug 34656, which changed state.

Bug 34656 Summary: Fix DWARF handling of 128bit float registers on SPARC64
https://bugs.llvm.org/show_bug.cgi?id=34656

   What|Removed |Added

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


[llvm-bugs] [Bug 34656] Fix DWARF handling of 128bit float registers on SPARC64

2017-09-29 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34656

Tom Stellard  changed:

   What|Removed |Added

 Fixed By Commit(s)|r311951 r312038 |r311951 r312038 r314567
 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #3 from Tom Stellard  ---
Merged: r314567

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


[llvm-bugs] [Bug 34492] [meta] 5.0.1 Release Blockers

2017-09-29 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34492
Bug 34492 depends on bug 34631, which changed state.

Bug 34631 Summary: [X86] Using _mm512_maskz_set1_epi64  on a 32-bit target 
causes cannot select intrinsic error
https://bugs.llvm.org/show_bug.cgi?id=34631

   What|Removed |Added

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


[llvm-bugs] [Bug 34631] [X86] Using _mm512_maskz_set1_epi64 on a 32-bit target causes cannot select intrinsic error

2017-09-29 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34631

Tom Stellard  changed:

   What|Removed |Added

 Fixed By Commit(s)|r313392 |r313392 r314569
 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #8 from Tom Stellard  ---
Merged: r314569

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


[llvm-bugs] [Bug 34787] New: Assertion `TN->getNumChildren() == 0 && "Not a tree leaf"'

2017-09-29 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34787

Bug ID: 34787
   Summary: Assertion `TN->getNumChildren() == 0 && "Not a tree
leaf"'
   Product: new-bugs
   Version: trunk
  Hardware: PC
OS: All
Status: NEW
  Severity: enhancement
  Priority: P
 Component: new bugs
  Assignee: unassignedb...@nondot.org
  Reporter: babo...@gmail.com
CC: llvm-bugs@lists.llvm.org

clang trunk rev314491, x86_64.

Another assertion in JumpThreadingPass (first one reported in #34782)

> cat f.cpp
template  class b {
public:
  a &operator[](unsigned long);
  a *c;
};
template  a &b::operator[](unsigned long d) { return c[d]; }
int e, f;
char g, h;
b i, j, k;
void l() {
  if (j[2]) {
k[1];
if (f) {
  int n;
  if (g + 3) {
g ?: k[1];
i[1];
  } else
h = 0;
  if (g ? e : k[1] & 90870993)
int m;
}
j[2];
  }
}

> clang++ -std=c++11 -O2 f.cpp -c -w
f.cpp:16:9: warning: expression result unused [-Wunused-value]
g ?: k[1];
^
clang-6.0:
/localdisk2/users/dybaboki/llvm/llvm-trunk-20170928/include/llvm/Support/GenericDomTreeConstruction.h:1107:
static void
llvm::DomTreeBuilder::SemiNCAInfo >::EraseNode(DomTreeT &, const llvm::DomTreeBuilder::SemiN
CAInfo::TreeNodePtr) [DomTreeT = llvm::DominatorTreeBase]: Assertion `TN->getNumChildren() == 0 && "Not a tree leaf"' failed.
#0 0x0135465f llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/localdisk2/users/dybaboki/llvm/bin-trunk-20170928/bin/clang-6.0+0x135465f)
#1 0x01354966 SignalHandler(int)
(/localdisk2/users/dybaboki/llvm/bin-trunk-20170928/bin/clang-6.0+0x1354966)
#2 0x7fa491a5f5e0 __restore_rt (/lib64/libpthread.so.0+0xf5e0)
#3 0x7fa4905d91f7 __GI_raise (/lib64/libc.so.6+0x351f7)
#4 0x7fa4905da8e8 __GI_abort (/lib64/libc.so.6+0x368e8)
#5 0x7fa4905d2266 __assert_fail_base (/lib64/libc.so.6+0x2e266)
#6 0x7fa4905d2312 (/lib64/libc.so.6+0x2e312)
#7 0x00eab197
llvm::DomTreeBuilder::SemiNCAInfo >::EraseNode(llvm::DominatorTreeBase&,
llvm::DomTreeNodeBase*)
(/localdisk2/users/dybaboki/llvm/bin-trunk-20170928/bin/clang
-6.0+0xeab197)
#8 0x00ea95f6
llvm::DomTreeBuilder::SemiNCAInfo >::DeleteUnreachable(llvm::DominatorTreeBase&,
llvm::DomTreeBuilder::SemiNCAInfo >::BatchUpda
teInfo*, llvm::DomTreeNodeBase*)
(/localdisk2/users/dybaboki/llvm/bin-trunk-20170928/bin/clang-6.0+0xea95f6)
#9 0x00e93fdc
llvm::DomTreeBuilder::SemiNCAInfo >::DeleteEdge(llvm::DominatorTreeBase&,
llvm::DomTreeBuilder::SemiNCAInfo >::BatchUpdateInfo*
, llvm::BasicBlock*, llvm::BasicBlock*)
(/localdisk2/users/dybaboki/llvm/bin-trunk-20170928/bin/clang-6.0+0xe93fdc)
#10 0x00eadb51
llvm::DomTreeBuilder::SemiNCAInfo >::ApplyNextUpdate(llvm::DominatorTreeBase&,
llvm::DomTreeBuilder::SemiNCAInfo >::BatchUpdat
eInfo&)
(/localdisk2/users/dybaboki/llvm/bin-trunk-20170928/bin/clang-6.0+0xeadb51)
#11 0x00e94ccb
llvm::DomTreeBuilder::SemiNCAInfo >::ApplyUpdates(llvm::DominatorTreeBase&,
llvm::ArrayRef >)
(/localdisk2/users/dybaboki/llvm/
bin-trunk-20170928/bin/clang-6.0+0xe94ccb)
#12 0x013a7c9e llvm::MergeBasicBlockIntoOnlyPred(llvm::BasicBlock*,
llvm::DominatorTree*)
(/localdisk2/users/dybaboki/llvm/bin-trunk-20170928/bin/clang-6.0+0x13a7c9e)
#13 0x011b8353 llvm::JumpThreadingPass::ProcessBlock(llvm::BasicBlock*)
(/localdisk2/users/dybaboki/llvm/bin-trunk-20170928/bin/clang-6.0+0x11b8353)
#14 0x011b7a7b llvm::JumpThreadingPass::runImpl(llvm::Function&,
llvm::TargetLibraryInfo*, llvm::LazyValueInfo*, llvm::AAResults*,
llvm::DominatorTree*, bool, std::unique_ptr >, std::unique_pt
r
>) (/localdisk2/users/dybaboki/llvm/bin-trunk-20170928/bin/clang-6.0+0x11b7a7b)
#15 0x011c3e0f (anonymous
namespace)::JumpThreading::runOnFunction(llvm::Function&)
(/localdisk2/users/dybaboki/llvm/bin-trunk-20170928/bin/clang-6.0+0x11c3e0f)
<...>

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


[llvm-bugs] [Bug 34788] New: Faulty inserted DBG_VALUE by LiveDebugVariables when the DBG_VALUE is last use in virtual register live range

2017-09-29 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34788

Bug ID: 34788
   Summary: Faulty inserted DBG_VALUE by LiveDebugVariables when
the DBG_VALUE is last use in virtual register live
range
   Product: libraries
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Common Code Generator Code
  Assignee: unassignedb...@nondot.org
  Reporter: karl-johan.karls...@ericsson.com
CC: llvm-bugs@lists.llvm.org

Created attachment 19214
  --> https://bugs.llvm.org/attachment.cgi?id=19214&action=edit
llc -start-before=greedy -stop-after=livedebugvars foo.mir -o -

Consider the following mir as input to greedy:

  bb.0.entry:
ADJCALLSTACKDOWN64 0, 0, 0, implicit-def dead %rsp, implicit-def dead
%eflags, implicit %rsp, debug-location !14
dead %eax = MOV32r0 implicit-def dead %eflags, implicit-def %al,
debug-location !14
CALL64pcrel32 @getval, csr_64, implicit %rsp, implicit killed %al,
implicit-def %rsp, implicit-def %eax, debug-location !14
ADJCALLSTACKUP64 0, 0, implicit-def dead %rsp, implicit-def dead %eflags,
implicit %rsp, debug-location !14
%2 = COPY killed %eax, debug-location !14
DBG_VALUE debug-use %2, debug-use _, !11, !DIExpression(), debug-location
!15
ADJCALLSTACKDOWN64 0, 0, 0, implicit-def dead %rsp, implicit-def dead
%eflags, implicit %rsp, debug-location !16
dead %eax = MOV32r0 implicit-def dead %eflags, implicit-def %al,
debug-location !16
CALL64pcrel32 @getval, csr_64, implicit %rsp, implicit killed %al,
implicit-def %rsp, implicit-def %eax, debug-location !16
ADJCALLSTACKUP64 0, 0, implicit-def dead %rsp, implicit-def dead %eflags,
implicit %rsp, debug-location !16
%3 = COPY killed %eax, debug-location !16
DBG_VALUE debug-use %3, debug-use _, !13, !DIExpression(), debug-location
!17
ADJCALLSTACKDOWN64 0, 0, 0, implicit-def dead %rsp, implicit-def dead
%eflags, implicit %rsp, debug-location !18
%edi = COPY %2, debug-location !18
%esi = COPY %3, debug-location !18
CALL64pcrel32 @usevals, csr_64, implicit %rsp, implicit killed %edi,
implicit killed %esi, implicit-def %rsp, debug-location !18
DBG_VALUE debug-use %3, debug-use _, !11, !DIExpression(), debug-location
!15
ADJCALLSTACKUP64 0, 0, implicit-def dead %rsp, implicit-def dead %eflags,
implicit %rsp, debug-location !18
RET 0, debug-location !19


After the livedebugvariables pass have reinserted DBG_VALUEs (after greedy) it
look like this:

  bb.0.entry:
liveins: %rbx

frame-setup PUSH64r killed %rbx, implicit-def %rsp, implicit %rsp,
debug-location !14
CFI_INSTRUCTION def_cfa_offset 16
CFI_INSTRUCTION offset %rbx, -16
dead %eax = XOR32rr undef %eax, undef %eax, implicit-def dead %eflags,
implicit-def %al, debug-location !14
CALL64pcrel32 @getval, csr_64, implicit %rsp, implicit %al, implicit-def
%rsp, implicit-def %eax, debug-location !14
%ebx = MOV32rr %eax, debug-location !14
DBG_VALUE debug-use %ebx, debug-use _, !11, !DIExpression(), debug-location
!15
dead %eax = XOR32rr undef %eax, undef %eax, implicit-def dead %eflags,
implicit-def %al, debug-location !16
CALL64pcrel32 @getval, csr_64, implicit %rsp, implicit %al, implicit-def
%rsp, implicit-def %eax, debug-location !16
DBG_VALUE debug-use %eax, debug-use _, !13, !DIExpression(), debug-location
!17
%edi = MOV32rr killed %ebx, debug-location !18
%esi = MOV32rr killed %eax, debug-location !18
CALL64pcrel32 @usevals, csr_64, implicit %rsp, implicit killed %edi,
implicit killed %esi, implicit-def %rsp, debug-location !18
DBG_VALUE debug-use %eax, debug-use _, !11, !DIExpression(), debug-location
!15
%rbx = POP64r implicit-def %rsp, implicit %rsp, debug-location !19
RETQ debug-location !19

The last DBG_VALUE is wrong:

DBG_VALUE debug-use %eax, debug-use _, !11, !DIExpression(), debug-location !15

The value in EAX do not necessarily contain any value connected to the variable
the DBG_VALUE is suppose to describe as the range ended before the call to
usevals. The register allocator might have reused EAX for another value.

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