[llvm-bugs] [Bug 35650] New: [mc] Zero divider is not handled for modulo

2017-12-13 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=35650

Bug ID: 35650
   Summary: [mc] Zero divider is not handled for modulo
   Product: libraries
   Version: trunk
  Hardware: PC
OS: Windows NT
Status: NEW
  Severity: enhancement
  Priority: P
 Component: MC
  Assignee: unassignedb...@nondot.org
  Reporter: i.am.permi...@gmail.com
CC: artem.tama...@amd.com, dpreobrazhen...@luxoft.com,
llvm-bugs@lists.llvm.org

Zero RHS is handled for DIV, but not for MOD operation which leads to crash if
divider is zero:

bool MCExpr::evaluateAsRelocatableImpl(MCValue &Res, const MCAssembler *Asm,
...
case MCBinaryExpr::Div:
  // Handle division by zero. gas just emits a warning and keeps going,
  // we try to be stricter.
  // FIXME: Currently the caller of this function has no way to understand
  // we're bailing out because of 'division by zero'. Therefore, it will
  // emit a 'expected relocatable expression' error. It would be nice to
  // change this code to emit a better diagnostic.
  if (RHS == 0)
return false;
  Result = LHS / RHS;
  break;
...
case MCBinaryExpr::Mod:  Result = LHS % RHS; break;

-- 
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 31476] LLD failed to link symbols with "protected" visibility

2017-12-13 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=31476

Dimitry Andric  changed:

   What|Removed |Added

 CC||dimi...@andric.com
 Status|RESOLVED|REOPENED
 Resolution|INVALID |---

--- Comment #4 from Dimitry Andric  ---
It would be really nice if this could be solved somehow, as this blocks
building libunwind.  Both BFD ld and gold have no trouble linking the test case
in this bug, so what is so magic about it?

-- 
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 35651] New: Demangler produces incorrect output for alignof() and array.

2017-12-13 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=35651

Bug ID: 35651
   Summary: Demangler produces incorrect output for alignof() and
array.
   Product: clang
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: normal
  Priority: P
 Component: C++
  Assignee: unassignedclangb...@nondot.org
  Reporter: hua...@google.com
CC: dgre...@apple.com, llvm-bugs@lists.llvm.org

Please run the following:

  llvm-cxxfilt _Z3fooDTatA123_3barE

The result:

  foo(decltype(alignof (bar [123]) [123]))

The extra "[123]" at end seems wrong. Note that replacing "at" with "st" yields
correct result:

  llvm-cxxfilt _Z3fooDTstA123_3barE

=>

  foo(decltype(sizeof (bar [123]))


This behavior is caused by code in 2 places (see ItaniumDemangle.cpp)

(1) In struct string_pair: We have 

StrT move_full() { return std::move(first) + std::move(second); }

  this actually does not clear |first| and |second|!

(2) Compare parse_sizeof_type_expr() with parse_alignof_type(): The former has

db.names.back() = "sizeof (" + db.names.back().move_full() + ")

  but the latter has

db.names.back().first = "alignof (" + db.names.back().move_full() + ")";

  Therefore "st" (sizeof) overwrites |second| whereas "at" (alignof) keeps
stale |second|.

-- 
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 35652] New: Potential malware in test EXE

2017-12-13 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=35652

Bug ID: 35652
   Summary: Potential malware in test EXE
   Product: lldb
   Version: unspecified
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: All Bugs
  Assignee: lldb-...@lists.llvm.org
  Reporter: raphael.kn...@roche.com
CC: llvm-bugs@lists.llvm.org

Created attachment 19543
  --> https://bugs.llvm.org/attachment.cgi?id=19543&action=edit
screenshot of the VirusTotal result

Anti-virus ClamAV reported the file
`lldb/unittests/SymbolFile/PDB/Inputs/test-pdb.exe` to be suspicious.
[VirusTotal](https://www.virustotal.com) confirmed the outcome (see
attachment). I verified it with the most recent version of the EXE.

To reproduce simply upload the EXE to VirusTotal. Beware that passing the URL
of the [EXE
download](https://github.com/llvm-project/llvm-project-20170507/raw/master/lldb/unittests/SymbolFile/PDB/Inputs/test-pdb.exe)
yields a different result than uploading.

-- 
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 35653] New: Incorrect relocation for no PLT PIC code without optimization

2017-12-13 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=35653

Bug ID: 35653
   Summary: Incorrect relocation for no PLT PIC code without
optimization
   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

$ bin/clang -target x86_64-unknown-linux-gnu -fomit-frame-pointer
-mstack-alignment=8 -fno-plt -fPIC -x c -S - -o - <<< '
void f(void);
void g(void) { return f(); }
'
.text
.file   "-"
.globl  g   # -- Begin function g
.p2align4, 0x90
.type   g,@function
g:  # @g
.cfi_startproc
# %bb.0:# %entry
callq   f
retq
.Lfunc_end0:
.size   g, .Lfunc_end0-g
.cfi_endproc
# -- End function

.ident  "clang version 6.0.0 (http://llvm.org/git/clang.git
efe67fdaf10325b04b6a6af538bed43eea8103a1) (http://llvm.org/git/llvm.git
bcf3bed73b8653dcce398f7d64dbb4e78a0746f2)"
.section".note.GNU-stack","",@progbits

$ bin/clang -target x86_64-unknown-linux-gnu -fomit-frame-pointer
-mstack-alignment=8 -O1 -fno-plt -fPIC -x c -S - -o - <<< '
void f(void);
void g(void) { return f(); }
'
.text
.file   "-"
.globl  g   # -- Begin function g
.p2align4, 0x90
.type   g,@function
g:  # @g
.cfi_startproc
# %bb.0:# %entry
jmpq*f@GOTPCREL(%rip)   # TAILCALL
.Lfunc_end0:
.size   g, .Lfunc_end0-g
.cfi_endproc
# -- End function

.ident  "clang version 6.0.0 (http://llvm.org/git/clang.git
efe67fdaf10325b04b6a6af538bed43eea8103a1) (http://llvm.org/git/llvm.git
bcf3bed73b8653dcce398f7d64dbb4e78a0746f2)"
.section".note.GNU-stack","",@progbits

Note that we generate `callq f` rather than `callq *f@GOTPCREL(%rip)`.

-- 
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 35642] recognize min/max patterns as commutative

2017-12-13 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=35642

Sanjay Patel  changed:

   What|Removed |Added

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

--- Comment #2 from Sanjay Patel  ---
Should be fixed after:
https://reviews.llvm.org/rL320640

-- 
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 35654] New: LLDB Does not print the correct value for a variable (suspect NRVO alias issue)

2017-12-13 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=35654

Bug ID: 35654
   Summary: LLDB Does not print the correct value for a variable
(suspect NRVO alias issue)
   Product: lldb
   Version: unspecified
  Hardware: Macintosh
OS: MacOS X
Status: NEW
  Severity: normal
  Priority: P
 Component: All Bugs
  Assignee: lldb-...@lists.llvm.org
  Reporter: chris.m.hart...@gmail.com
CC: llvm-bugs@lists.llvm.org

macbookpro:BugReport hartman$ clang++ --version
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin17.3.0
Thread model: posix
InstalledDir:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
macbookpro:BugReport hartman$ lldb --version
lldb-900.0.64
  Swift-4.0
macbookpro:BugReport hartman$ cat main.cpp
void bar2(){};

struct Large
{
int a,b,c,d,e;
};

Large f2()
{
bar2();
Large r;
r.a=1;
int s=r.a;
return r;
}

int main() {
f2();
return 0;
}

macbookpro:BugReport hartman$ clang++ --debug main.cpp
macbookpro:BugReport hartman$ lldb ./a.out
(lldb) target create "./a.out"
Current executable set to './a.out' (x86_64).
(lldb) breakpoint set --file main.cpp --line 14
Breakpoint 1: where = a.out`f2() + 39 at main.cpp:14, address =
0x00010f77
(lldb) run
Process 70299 launched: './a.out' (x86_64)
Process 70299 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
frame #0: 0x00010f77 a.out`f2() at main.cpp:14
   11   Large r;
   12   r.a=1;
   13   int s=r.a;
-> 14   return r;
   15   }
   16   
   17   int main() {
Target 0: (a.out) stopped.
(lldb) print s
(int) $0 = 1
(lldb) print r.a
(int) $1 = -272631496
(lldb) print r
(Large) $2 = (a = -272631496, b = 32766, c = -272631496, d = 32766, e = 0)

With a breakpoint at line 14 ("return r;") LLDB does not print the correct
value for r, although s shows the correct value. This seems to be highly
sensitive: r must be of large size (apparently anything bigger than 4 ints),
the return value, and declared after a call to some other function, which makes
me suspect some interaction with NRVO. If the call to bar() is commented out,
things work just fine.

-- 
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] Issue 4630 in oss-fuzz: llvm: Stack-overflow in llvm::detail::IEEEFloat::convertFromStringSpecials

2017-12-13 Thread ClusterFuzz-External via monorail via llvm-bugs

Status: New
Owner: 
CC: k...@google.com, masc...@google.com, jdevlieg...@apple.com,  
akila_sr...@apple.com, llvm-b...@lists.llvm.org, v...@apple.com
Labels: ClusterFuzz Stability-Memory-AddressSanitizer Reproducible  
Engine-libfuzzer Proj-llvm Reported-2017-12-14

Type: Bug

New issue 4630 by ClusterFuzz-External: llvm: Stack-overflow in  
llvm::detail::IEEEFloat::convertFromStringSpecials

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

Detailed report: https://oss-fuzz.com/testcase?key=5320234895409152

Project: llvm
Fuzzer: libFuzzer_llvm_clang-fuzzer
Job Type: libfuzzer_asan_llvm
Platform Id: linux

Crash Type: Stack-overflow
Crash Address: 0x7ffe3257c8e8
Crash State:
  llvm::detail::IEEEFloat::convertFromStringSpecials
  llvm::detail::IEEEFloat::convertFromString
  clang::NumericLiteralParser::GetFloatValue

Sanitizer: address (ASAN)

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


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


Issue filed automatically.

See https://github.com/google/oss-fuzz/blob/master/docs/reproducing.md for  
more information.


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 have questions for the OSS-Fuzz team, please file an issue at  
https://github.com/google/oss-fuzz/issues.


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


[llvm-bugs] [Bug 35656] New: opt crashes with "opt -scev-aa -print-alias-sets -aa-eval"

2017-12-13 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=35656

Bug ID: 35656
   Summary: opt crashes with "opt -scev-aa  -print-alias-sets
-aa-eval"
   Product: libraries
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Global Analyses
  Assignee: unassignedb...@nondot.org
  Reporter: cs12b1...@iith.ac.in
CC: llvm-bugs@lists.llvm.org

Created attachment 19544
  --> https://bugs.llvm.org/attachment.cgi?id=19544&action=edit
Minimal test case.

Opt crashes with:
opt -scev-aa  -print-alias-sets -aa-eval a.ll

However it does not crash with:
opt -basicaa -print-alias-sets -aa-eval a.ll
OR
opt -scev-aa -print-alias-sets a.ll
OR
opt -scev-aa -aa-eval a.ll

All three flags(-scev-aa, -print-alias-sets, -aa-eval) are necessary to
reproduce the bug.

-- 
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 35657] New: Compiler abort in 01 in SROA pass

2017-12-13 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=35657

Bug ID: 35657
   Summary: Compiler abort in 01 in SROA pass
   Product: clang
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: normal
  Priority: P
 Component: LLVM Codegen
  Assignee: unassignedclangb...@nondot.org
  Reporter: santosh.zanju...@amd.com
CC: llvm-bugs@lists.llvm.org

Created attachment 19545
  --> https://bugs.llvm.org/attachment.cgi?id=19545&action=edit
test case

The issue is started from svn r319522

r319522 | inouehrs | 2017-12-01 06:05:05 + (Fri, 01 Dec 2017) | 5 lines

Recommit rL319407: [SROA] enable splitting for non-whole-alloca loads and
stores

Recommiting once reverted patch rL319407 after adding a check for bit vector
size to avoid failures in some build bots.



#8 0x2c1458a3 llvm::SROA::rewritePartition(llvm::AllocaInst&,
llvm::sroa::AllocaSlices&, llvm::sroa::Partition&)
(/home/amd/santosh/llvm/trunk-install/bin/../lib/libLLVM-6.0svn.so+0x125a8a3)
#9 0x2c145c35 llvm::SROA::splitAlloca(llvm::AllocaInst&,
llvm::sroa::AllocaSlices&)
(/home/amd/santosh/llvm/trunk-install/bin/../lib/libLLVM-6.0svn.so+0x125ac35)
#10 0x2c1472a3 llvm::SROA::runOnAlloca(llvm::AllocaInst&)
(/home/amd/santosh/llvm/trunk-install/bin/../lib/libLLVM-6.0svn.so+0x125c2a3)
#11 0x2c14865a llvm::SROA::runImpl(llvm::Function&,
llvm::DominatorTree&, llvm::AssumptionCache&)
(/home/amd/santosh/llvm/trunk-install/bin/../lib/libLLVM-6.0svn.so+0x125d65a)
#12 0x2c149038
llvm::sroa::SROALegacyPass::runOnFunction(llvm::Function&)
(/home/amd/santosh/llvm/trunk-install/bin/../lib/libLLVM-6.0svn.so+0x125e038)
#13 0x2b6ef883 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/home/amd/santosh/llvm/trunk-install/bin/../lib/libLLVM-6.0svn.so+0x804883)


Error log and test case attached.

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