[llvm-bugs] [Bug 42474] [meta] 9.0.0 Release Blockers

2019-09-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=42474
Bug 42474 depends on bug 43243, which changed state.

Bug 43243 Summary: clang-9 fails to drop static symbols with an alias
https://bugs.llvm.org/show_bug.cgi?id=43243

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


[llvm-bugs] [Bug 4068] [Meta] Compiling the Linux kernel with clang

2019-09-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=4068
Bug 4068 depends on bug 43243, which changed state.

Bug 43243 Summary: clang-9 fails to drop static symbols with an alias
https://bugs.llvm.org/show_bug.cgi?id=43243

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


[llvm-bugs] [Bug 43243] clang-9 fails to drop static symbols with an alias

2019-09-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=43243

Hans Wennborg  changed:

   What|Removed |Added

 Blocks||42474
 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #2 from Hans Wennborg  ---
Merged r369705 and r369713 to release_90 in r371372. This will be part of rc4.


Referenced Bugs:

https://bugs.llvm.org/show_bug.cgi?id=42474
[Bug 42474] [meta] 9.0.0 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
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 43252] New: Unnecessary mov instruction

2019-09-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=43252

Bug ID: 43252
   Summary: Unnecessary mov instruction
   Product: clang
   Version: unspecified
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: -New Bugs
  Assignee: unassignedclangb...@nondot.org
  Reporter: tspit...@ieee.org
CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org,
neeil...@live.com, richard-l...@metafoo.co.uk

For the following code

void foo(int i);
void bar(int i) {
if (i != 0)
foo(i);
bar(i);
}

clang -O3 -S produces this (cleaned up)

bar:
pushq   %rbx
movl%edi, %ebx
testl   %edi, %edi
je  .LBB0_2
movl%ebx, %edi
callq   foo
.LBB0_2:
movl%ebx, %edi
popq%rbx
jmp foo

The marked mov instruction is not necessary, as edi is already equal to ebx.

Also, the LBB0_2 label can move down one line to just before the popq
instrucion, as if the branch is taken then edi is still equal to ebx.

This is for clang 8.0 on Fedora 30. clang --version produces

clang version 8.0.0 (Fedora 8.0.0-1.fc30)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

-- 
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 4068] [Meta] Compiling the Linux kernel with clang

2019-09-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=4068
Bug 4068 depends on bug 43222, which changed state.

Bug 43222 Summary: [SimplifyCFG] produces incorrect callbr's
https://bugs.llvm.org/show_bug.cgi?id=43222

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


[llvm-bugs] [Bug 42474] [meta] 9.0.0 Release Blockers

2019-09-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=42474
Bug 42474 depends on bug 43222, which changed state.

Bug 43222 Summary: [SimplifyCFG] produces incorrect callbr's
https://bugs.llvm.org/show_bug.cgi?id=43222

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


[llvm-bugs] [Bug 43222] [SimplifyCFG] produces incorrect callbr's

2019-09-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=43222

Hans Wennborg  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 CC||h...@chromium.org
 Blocks||42474
 Status|NEW |RESOLVED

--- Comment #6 from Hans Wennborg  ---
(In reply to Nick Desaulniers from comment #5)
> https://reviews.llvm.org/D67252

That landed in r371262 and was merged to release_90 in r371376.


Referenced Bugs:

https://bugs.llvm.org/show_bug.cgi?id=42474
[Bug 42474] [meta] 9.0.0 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
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 43253] New: More aggressive garbage-collection

2019-09-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=43253

Bug ID: 43253
   Summary: More aggressive garbage-collection
   Product: lld
   Version: unspecified
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: All Bugs
  Assignee: unassignedb...@nondot.org
  Reporter: r...@google.com
CC: llvm-bugs@lists.llvm.org, peter.sm...@linaro.org

There seems to be room for improving -gc-sections so that the garbage collector
reclaims more sections that it does now. Let me describe the idea in this bug.

`-gc-sections` is a linker option to make the linker to do mark-sweep garbage
collection on input file sections. It is perhaps not very wrong to think that
adding a new unrelated (unused) object file to the command line as well as
`-gc-sections` flag doesn't increase the resulting executable size at all
because the new file is garbage-collected.

Unfortunately that naive understanding is not correct. If an object file
contains a global variable that has a nontrivial constructor, that initializer
must run before `main()`, so the linker handles global initializers as GC root
objects. Garbage-collecting such global variable changes program's semantics
even if the variable is not used at all, because a constructor may have a side
effect. For example, you can print out "Hello world" from a constructor, and
removing a global variable from the program changes the program's behavior.

But I'd think it is probably OK to garbage-collect global variables and their
ctors if they are read from archive files.

Object files in archive files are not guaranteed to be linked. They are linked
only when there are undefined symbols that cannot be resolved from them. So, we
can garbage-collect a whole object file if that is not reachable, maybe?

Another view of this proposal: if we run a mark-sweep garbage collector after
reading all object files and before reading any archive files, no file will be
read from archives if they would be dead after GC.

There's of course a risk of changing the existing programs behaviors, but I
think it's worth trying.

-- 
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 43230] [X86] Incorrect shuffle of shift optimization on haswell

2019-09-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=43230

Hans Wennborg  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||h...@chromium.org
 Resolution|--- |FIXED

--- Comment #6 from Hans Wennborg  ---
Merged to release_90 in r371378.

-- 
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 42474] [meta] 9.0.0 Release Blockers

2019-09-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=42474
Bug 42474 depends on bug 43230, which changed state.

Bug 43230 Summary: [X86] Incorrect shuffle of shift optimization on haswell
https://bugs.llvm.org/show_bug.cgi?id=43230

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


[llvm-bugs] [Bug 42474] [meta] 9.0.0 Release Blockers

2019-09-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=42474
Bug 42474 depends on bug 43233, which changed state.

Bug 43233 Summary: Assertion failed: (Exp != 0 && "Incorrect exponent 0 not 
handled"), function getPow, on std::pow(n, -0.0)
https://bugs.llvm.org/show_bug.cgi?id=43233

   What|Removed |Added

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


[llvm-bugs] [Bug 43233] Assertion failed: (Exp != 0 && "Incorrect exponent 0 not handled"), function getPow, on std::pow(n, -0.0)

2019-09-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=43233

Hans Wennborg  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|CONFIRMED   |RESOLVED
 CC||h...@chromium.org

--- Comment #5 from Hans Wennborg  ---
Merged to release_90 in r371381.

-- 
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 43244] 9.0rc3 SingleSource/UnitTests/Vector/AVX512F/Vector-AVX512F-t_movzext.test fails

2019-09-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=43244

Hans Wennborg  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 CC||h...@chromium.org
 Status|CONFIRMED   |RESOLVED

--- Comment #2 from Hans Wennborg  ---
Merged to release_90 in r371382.

It merged without issues -- my lucky day I guess :-)

-- 
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 42474] [meta] 9.0.0 Release Blockers

2019-09-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=42474
Bug 42474 depends on bug 43244, which changed state.

Bug 43244 Summary: 9.0rc3 
SingleSource/UnitTests/Vector/AVX512F/Vector-AVX512F-t_movzext.test fails
https://bugs.llvm.org/show_bug.cgi?id=43244

   What|Removed |Added

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


[llvm-bugs] [Bug 43254] New: Can't install clangd-9 alongside clang-tools-9 on Ubuntu Disco

2019-09-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=43254

Bug ID: 43254
   Summary: Can't install clangd-9 alongside clang-tools-9 on
Ubuntu Disco
   Product: Packaging
   Version: unspecified
  Hardware: PC
OS: All
Status: NEW
  Severity: enhancement
  Priority: P
 Component: deb packages
  Assignee: unassignedb...@nondot.org
  Reporter: j...@linux.com
CC: llvm-bugs@lists.llvm.org

When trying to install clangd-9 and clang-tools-9 via apt.llvm.org on Ubuntu
Disco, like this:

```Dockerfile
FROM ubuntu:disco

RUN apt-get update && apt-get install -qy curl gnupg software-properties-common

RUN curl -fsSL https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \
 && apt-add-repository -yu "deb http://apt.llvm.org/disco/
llvm-toolchain-disco-9 main" \
 && apt-get -t llvm-toolchain-disco-9 install -y \
clangd-9 \
clang-format-9 \
clang-tidy-9
```

it fails with this error:

> The following packages have unmet dependencies:
> clangd-9 : Breaks: clang-tools-9 (< 1:9~+rc1-1~exp2) but 
> 1:9~svn371301-1~exp1~20190908074810.48 is to be installed
> E: Unable to correct problems, you have held broken packages.

However, doing the exact same thing with clangd-10 and clang-tools-10 works
fine:

```Dockerfile
FROM ubuntu:disco

RUN apt-get update && apt-get install -qy curl gnupg software-properties-common

RUN curl -fsSL https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \
 && apt-add-repository -yu "deb http://apt.llvm.org/disco/ llvm-toolchain-disco
main" \
 && apt-get -t llvm-toolchain-disco install -y clangd-10 clang-tidy-10
clang-format-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] [Bug 43254] Can't install clangd-9 alongside clang-tools-9 on Ubuntu Disco

2019-09-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=43254

Sylvestre Ledru  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
   Assignee|unassignedb...@nondot.org   |sylves...@debian.org
 CC||sylves...@debian.org
 Resolution|--- |FIXED

--- Comment #2 from Sylvestre Ledru  ---
Fixed by removing the fields
https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/commit/12f259a940675f19332e520131e76596fb2b

-- 
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 43255] New: backend error because clang doesn't type check address space qualifiers during casting

2019-09-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=43255

Bug ID: 43255
   Summary: backend error because clang doesn't type check address
space qualifiers during casting
   Product: clang
   Version: trunk
  Hardware: PC
OS: All
Status: NEW
  Severity: enhancement
  Priority: P
 Component: -New Bugs
  Assignee: unassignedclangb...@nondot.org
  Reporter: d...@znu.io
CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org,
neeil...@live.com, richard-l...@metafoo.co.uk

The following code will crash in the backend because clang isn't type checking
address space qualifiers during casting. To fix the code, uncomment the line
below.

struct Cache {
long buffer[100];
};

class Thread {
public:
Thread *self;
char buffer[100*8];
Thread() : self(this) {}
};

__attribute__((address_space(257)))
Thread *const _foo = nullptr;


long getIndex(unsigned long index) {
return ((
//__attribute__((address_space(257)))
Cache*)_foo->buffer)->buffer[index];
}

Sema should catch this mismatch and diagnose.

-- 
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 43256] New: clang++ segment fault with string_view and libstdc++

2019-09-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=43256

Bug ID: 43256
   Summary: clang++ segment fault with string_view and libstdc++
   Product: clang
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: C++17
  Assignee: unassignedclangb...@nondot.org
  Reporter: yichen@inf.ethz.ch
CC: blitzrak...@gmail.com, erik.pilking...@gmail.com,
llvm-bugs@lists.llvm.org, richard-l...@metafoo.co.uk

$ clang++ -std=c++17 --compile -o /dev/null 1.cc
clang-10: /home/yiyan/CLionProjects/llvm-trunk/clang/lib/AST/APValue.cpp:744:
bool clang::APValue::isNullPointer() const: Assertion `isLValue() && "Invalid
usage"' failed.
Stack dump:
0.  Program arguments: /home/yiyan/.local/bin/clang-10 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
1.cc -mrelocation-model static -mthread-model posix -mframe-pointer=all
-fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables
-fuse-init-array -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb
-coverage-notes-file /dev/null.gcno -resource-dir
/home/yiyan/.local/lib/clang/10.0.0 -internal-isystem
/home/yiyan/.local/bin/../lib/gcc/x86_64-pc-linux-gnu/10.0.0/../../../../include/c++/10.0.0
-internal-isystem
/home/yiyan/.local/bin/../lib/gcc/x86_64-pc-linux-gnu/10.0.0/../../../../include/c++/10.0.0/x86_64-pc-linux-gnu
-internal-isystem
/home/yiyan/.local/bin/../lib/gcc/x86_64-pc-linux-gnu/10.0.0/../../../../include/c++/10.0.0/backward
-internal-isystem /usr/local/include -internal-isystem
/home/yiyan/.local/lib/clang/10.0.0/include -internal-externc-isystem
/usr/include/x86_64-linux-gnu -internal-externc-isystem /include
-internal-externc-isystem /usr/include -std=c++17 -fdeprecated-macro
-fdebug-compilation-dir /home/yiyan/CLionProjects/stl_tooling -ferror-limit 19
-fmessage-length 0 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -faddrsig -o /dev/null -x c++
1.cc 
1.  1.cc:9:1: current parser token '}'
2.  1.cc:3:15: parsing function body 'test01'
3.  1.cc:3:15: in compound statement ('{}')
 #0 0x039f6897 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/yiyan/CLionProjects/llvm-trunk/llvm/lib/Support/Unix/Signals.inc:532:11
 #1 0x039f6a39 PrintStackTraceSignalHandler(void*)
/home/yiyan/CLionProjects/llvm-trunk/llvm/lib/Support/Unix/Signals.inc:593:1
 #2 0x039f542b llvm::sys::RunSignalHandlers()
/home/yiyan/CLionProjects/llvm-trunk/llvm/lib/Support/Signals.cpp:67:5
 #3 0x039f70a8 SignalHandler(int)
/home/yiyan/CLionProjects/llvm-trunk/llvm/lib/Support/Unix/Signals.inc:384:1
 #4 0x7f61297ae890 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
 #5 0x7f612807de97 raise
/build/glibc-OTsEL5/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
 #6 0x7f612807f801 abort /build/glibc-OTsEL5/glibc-2.27/stdlib/abort.c:81:0
 #7 0x7f612806f39a __assert_fail_base
/build/glibc-OTsEL5/glibc-2.27/assert/assert.c:89:0
 #8 0x7f612806f412 (/lib/x86_64-linux-gnu/libc.so.6+0x30412)
 #9 0x07926d4c clang::APValue::isNullPointer() const
/home/yiyan/CLionProjects/llvm-trunk/clang/lib/AST/APValue.cpp:0:3
#10 0x07d0e844 EvaluateArgs(llvm::ArrayRef,
llvm::SmallVector&, (anonymous namespace)::EvalInfo&,
clang::FunctionDecl const*)
/home/yiyan/CLionProjects/llvm-trunk/clang/lib/AST/ExprConstant.cpp:5129:44
#11 0x07d0dced HandleFunctionCall(clang::SourceLocation,
clang::FunctionDecl const*, (anonymous namespace)::LValue const*,
llvm::ArrayRef, clang::Stmt const*, (anonymous
namespace)::EvalInfo&, clang::APValue&, (anonymous namespace)::LValue const*)
/home/yiyan/CLionProjects/llvm-trunk/clang/lib/AST/ExprConstant.cpp:5146:7
#12 0x07d678cf (anonymous namespace)::ExprEvaluatorBase<(anonymous
namespace)::IntExprEvaluator>::handleCallExpr(clang::CallExpr const*,
clang::APValue&, (anonymous namespace)::LValue const*)
/home/yiyan/CLionProjects/llvm-trunk/clang/lib/AST/ExprConstant.cpp:6204:9
#13 0x07d662d4 (anonymous namespace)::ExprEvaluatorBase<(anonymous
namespace)::IntExprEvaluator>::VisitCallExpr(clang::CallExpr const*)
/home/yiyan/CLionProjects/llvm-trunk/clang/lib/AST/ExprConstant.cpp:6078:9
#14 0x07d3edd8 (anonymous
namespace)::IntExprEvaluator::VisitCallExpr(clang::CallExpr const*)
/home/yiyan/CLionProjects/llvm-trunk/clang/lib/AST/ExprConstant.cpp:9478:3
#15 0x07d3ee43 clang::StmtVisitorBase::VisitCXXMemberCallExpr(clang::CXXMemberCallExpr const*)
/tmp/tmpeq5eck_z/tools/clang/include/clang/AST/StmtNodes.inc:775:1
#16 0x07d3b5d3 clang::StmtVisitorBase::Visit(clang::Stmt const*)
/tmp/tmpeq5eck_z/tools/clang/include/clang/AST/StmtNodes.inc:775:1
#17 0x07d09400 Evaluate(clang::APValue&, (anonymous
namespace)::EvalInfo&, clang::Expr const*)
/home/yiyan/CLionProjects/llvm-t

[llvm-bugs] [Bug 43257] New: Missed optimization for multiplication on 1.5 and 1.25

2019-09-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=43257

Bug ID: 43257
   Summary: Missed optimization for multiplication on 1.5 and 1.25
   Product: clang
   Version: unspecified
  Hardware: All
OS: All
Status: NEW
  Severity: enhancement
  Priority: P
 Component: LLVM Codegen
  Assignee: unassignedclangb...@nondot.org
  Reporter: zamazan...@tut.by
CC: llvm-bugs@lists.llvm.org, neeil...@live.com,
richard-l...@metafoo.co.uk

On x86_32 for any number X of type (unsigned, unsigned short, unsigned char)
multiplication by 1.5 with a conversion back to unsigned with any rounding mode
produces the exactly same result as if X + (X >> 1).

Same holds for 1.25:
unsigned(X * 1.25) == unsigned(X + (X >> 2))

The above transformation allows to emit a short code without floating point
computations:

test2(unsigned int):  # @test2(unsigned int)
mov eax, edi
shr eax
lea eax, [rax + rdi]
ret

Instead of:

test(unsigned int):   # @test(unsigned int)
mov eax, edi
cvtsi2sdxmm0, rax
mulsd   xmm0, qword ptr [rip + .LCPI0_0]
cvttsd2si   rax, xmm0
ret

Same issue in GCC: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91709

Godbolt playground: https://godbolt.org/z/zVQuwP

-- 
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 38058] Fix support for archives with members larger than 4GB

2019-09-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=38058

Owen Reynolds  changed:

   What|Removed |Added

 Fixed By Commit(s)||366813
 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
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] Issue 16890 in oss-fuzz: llvm:clang-fuzzer: Stack-overflow in processTypeAttrs

2019-09-09 Thread ClusterFuzz-External via monorail via llvm-bugs

Updates:
Labels: ClusterFuzz-Verified
Status: Verified

Comment #1 on issue 16890 by ClusterFuzz-External: llvm:clang-fuzzer:  
Stack-overflow in processTypeAttrs

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

ClusterFuzz testcase 5723531530207232 is verified as fixed in  
https://oss-fuzz.com/revisions?job=libfuzzer_asan_llvm&range=201909070331:201909090324


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 34197] x86: llc crashes when build a program

2019-09-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34197

Simon Pilgrim  changed:

   What|Removed |Added

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

--- Comment #2 from Simon Pilgrim  ---


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

-- 
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 37311] Can't get register for value! UNREACHABLE executed at ../lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:1344!

2019-09-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=37311

Simon Pilgrim  changed:

   What|Removed |Added

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

--- Comment #4 from Simon Pilgrim  ---


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

-- 
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 15333 in oss-fuzz: llvm/llvm-isel-fuzzer--wasm32-O2: ASSERT: V.getNode() && "Getting TableId on SDValue()"

2019-09-09 Thread sheriff… via monorail via llvm-bugs

Updates:
Labels: Deadline-Approaching

Comment #2 on issue 15333 by sheriff...@chromium.org:  
llvm/llvm-isel-fuzzer--wasm32-O2: ASSERT: V.getNode() && "Getting TableId  
on SDValue()"

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

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] Issue 15332 in oss-fuzz: llvm/llvm-isel-fuzzer--wasm32-O2: Abrt in llvm::llvm_unreachable_internal

2019-09-09 Thread sheriff… via monorail via llvm-bugs

Updates:
Labels: Deadline-Approaching

Comment #1 on issue 15332 by sheriff...@chromium.org:  
llvm/llvm-isel-fuzzer--wasm32-O2: Abrt in llvm::llvm_unreachable_internal

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=15332#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] Issue 17098 in oss-fuzz: llvm:llvm-itanium-demangle-fuzzer: Out-of-memory in llvm_llvm-itanium-demangle-fuzzer

2019-09-09 Thread ClusterFuzz-External via monorail via llvm-bugs

Status: New
Owner: 
CC: k...@google.com, masc...@google.com, jdevlieg...@apple.com,  
igm...@gmail.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 Reproducible Engine-libfuzzer OS-Linux Proj-llvm  
Reported-2019-09-09

Type: Bug

New issue 17098 by ClusterFuzz-External: llvm:llvm-itanium-demangle-fuzzer:  
Out-of-memory in llvm_llvm-itanium-demangle-fuzzer

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

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

Project: llvm
Fuzzing Engine: libFuzzer
Fuzz Target: llvm-itanium-demangle-fuzzer
Job Type: libfuzzer_msan_llvm
Platform Id: linux

Crash Type: Out-of-memory (exceeds 2048 MB)
Crash Address:
Crash State:
  llvm_llvm-itanium-demangle-fuzzer

Sanitizer: memory (MSAN)

Crash Revision:  
https://oss-fuzz.com/revisions?job=libfuzzer_msan_llvm&revision=201906300300


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


Issue filed automatically.

See https://google.github.io/oss-fuzz/advanced-topics/reproducing for  
instructions to reproduce this bug locally.


--
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 43258] New: Make it easier to find the definition for an alias command

2019-09-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=43258

Bug ID: 43258
   Summary: Make it easier to find the definition for an alias
command
   Product: lldb
   Version: unspecified
  Hardware: All
OS: All
Status: NEW
  Severity: enhancement
  Priority: P
 Component: All Bugs
  Assignee: lldb-...@lists.llvm.org
  Reporter: jing...@apple.com
CC: jdevliegh...@apple.com, llvm-bugs@lists.llvm.org

Currently to see the definition of a command alias, you have to run "help" on
the command, and scan down to the end of the page to see the definition.  That
is not very obvious.

One option which came to mind is to have: "command alias name" - which is
currently an error - print the command alias of "name" if it exists.  But that
wouldn't work for "command regex name" which enters you into the "enter the
regex substitution strings" IOHandler.

Another option is to add something to help, like:

(lldb) help --print-definition name

To print the definition of "name" if there is one.  This could print regex
patterns, the alias mapping and maybe even the bodies of Python defined
commands...

-- 
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 43259] New: [InstCombine] Failure to simplify add-of-negative+underflow check+null check of non-null base pointer

2019-09-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=43259

Bug ID: 43259
   Summary: [InstCombine] Failure to simplify
add-of-negative+underflow check+null check of non-null
base pointer
   Product: libraries
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Scalar Optimizations
  Assignee: unassignedb...@nondot.org
  Reporter: lebedev...@gmail.com
CC: llvm-bugs@lists.llvm.org

Again comes up in https://reviews.llvm.org/D67122
Much like what we have in #43251,
for 
#include 
char* test(char& base, signed long offset) {
  __builtin_assume(offset < 0);
  return &base + offset;
}

We produce 

https://godbolt.org/z/r40U47

and again those two icmp's can be merged:
https://rise4fun.com/Alive/8h2

-- 
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 38487] Invalid function signatures when inlining `this` into multiple parameters and there is inalloca parameters

2019-09-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=38487

Reid Kleckner  changed:

   What|Removed |Added

 Resolution|--- |DUPLICATE
 Status|REOPENED|RESOLVED

--- Comment #4 from Reid Kleckner  ---
This was reported again and Bob fixed it in r359743.

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

-- 
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 43260] New: emscripten exception with new LLVM backend

2019-09-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=43260

Bug ID: 43260
   Summary: emscripten exception with new LLVM backend
   Product: clang
   Version: unspecified
  Hardware: PC
OS: Linux
Status: NEW
  Severity: normal
  Priority: P
 Component: C
  Assignee: unassignedclangb...@nondot.org
  Reporter: hac...@linux.com
CC: blitzrak...@gmail.com, dgre...@apple.com,
erik.pilking...@gmail.com, llvm-bugs@lists.llvm.org,
richard-l...@metafoo.co.uk

When compiling [sphincs.js](https://github.com/cyph/sphincs.js) with emscripten
latest-upstream, I get the following error. Specifically, the problem is caused
by using `WASM=1` with anything other than `-O0`.

Not sure if this is more of an llvm or emscripten problem, so I submitted to
both. emscripten issue:
https://github.com/emscripten-core/emscripten/issues/9413

```
clang-10:
/b/s/w/ir/cache/builder/emscripten-releases/llvm-project/llvm/lib/Analysis/ScalarEvolution.cpp:4069:
const llvm::SCEV *llvm::ScalarEvolution::getNoopOrZeroExtend(const llvm::SCEV
*, llvm::Type *): Assertion `getTypeSizeInBits(SrcTy) <= getTypeSizeInBits(Ty)
&& "getNoopOrZeroExtend cannot truncate!"' failed.
Stack dump:
0.  Program arguments: /home/gibson/emsdk/upstream/bin/clang-10 -cc1
-triple wasm32-unknown-emscripten -emit-obj -disable-free -main-file-name
sign.c -mrelocation-model static -mthread-model posix -mframe-pointer=none
-masm-verbose -mconstructor-aliases -fuse-init-array -target-cpu generic
-fvisibility hidden -dwarf-column-info -debugger-tuning=gdb
-coverage-notes-file /tmp/emscripten_temp__jRzu7/sign_8.gcno -resource-dir
/home/gibson/emsdk/upstream/lib/clang/10.0.0 -include
c_src/crypto_stream/chacha12/e/ref/namespace.h -D __EMSCRIPTEN_major__=1 -D
__EMSCRIPTEN_minor__=38 -D __EMSCRIPTEN_tiny__=43 -D _LIBCPP_ABI_VERSION=2 -D
unix -D __unix -D __unix__ -D EMSCRIPTEN -I
libsodium/src/libsodium/include/sodium -I openssl/include -I c_src -I
c_src/include -I c_src/crypto_stream/chacha12/e/ref -internal-isystem
/home/gibson/emsdk/upstream/lib/clang/10.0.0/include -internal-isystem
/include/wasm32-emscripten -internal-isystem /include -O3
-Werror=implicit-function-declaration -fdebug-compilation-dir /cyph/sphincs.js
-ferror-limit 19 -fmessage-length 0 -fobjc-runtime=gnustep -fno-common
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp
-nostdsysteminc
-isystem/home/gibson/emsdk/upstream/emscripten/system/include/libcxx
-isystem/home/gibson/emsdk/upstream/emscripten/system/lib/libcxxabi/include
-isystem/home/gibson/emsdk/upstream/emscripten/system/include/compat
-isystem/home/gibson/emsdk/upstream/emscripten/system/include
-isystem/home/gibson/emsdk/upstream/emscripten/system/include/libc
-isystem/home/gibson/emsdk/upstream/emscripten/system/lib/libc/musl/arch/emscripten
-isystem/home/gibson/emsdk/upstream/emscripten/system/local/include
-isystem/home/gibson/emsdk/upstream/emscripten/system/include/SDL -mllvm
-combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm
-disable-lsr -o /tmp/emscripten_temp__jRzu7/sign_8.o -x c
c_src/crypto_sign/sphincs256/ref/sign.c
1.   parser at end of file
2.  Per-module optimization passes
3.  Running pass 'CallGraph Pass Manager' on module
'c_src/crypto_sign/sphincs256/ref/sign.c'.
4.  Running pass 'Loop Pass Manager' on function
'@crypto_sign_sphincs_open'
5.  Running pass 'Recognize loop idioms' on basic block '%for.body72'
 #0 0x7f8fdb7f5bd4 PrintStackTraceSignalHandler(void*)
(/home/gibson/emsdk/upstream/bin/../lib/libLLVM-10svn.so+0x6e7bd4)
 #1 0x7f8fdb7f395e llvm::sys::RunSignalHandlers()
(/home/gibson/emsdk/upstream/bin/../lib/libLLVM-10svn.so+0x6e595e)
 #2 0x7f8fdb7f5e88 SignalHandler(int)
(/home/gibson/emsdk/upstream/bin/../lib/libLLVM-10svn.so+0x6e7e88)
 #3 0x7f8fdb0f4730 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12730)
 #4 0x7f8fd7b5e7bb raise (/lib/x86_64-linux-gnu/libc.so.6+0x377bb)
 #5 0x7f8fd7b49535 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22535)
 #6 0x7f8fd7b4940f (/lib/x86_64-linux-gnu/libc.so.6+0x2240f)
 #7 0x7f8fd7b57102 (/lib/x86_64-linux-gnu/libc.so.6+0x30102)
 #8 0x7f8fdca0d51a
(/home/gibson/emsdk/upstream/bin/../lib/libLLVM-10svn.so+0x18ff51a)
 #9 0x7f8fdc507961 (anonymous
namespace)::LoopIdiomRecognize::detectBCmpIdiom(llvm::ICmpInst*&,
llvm::CmpInst*&, llvm::LoadInst*&, llvm::LoadInst*&, llvm::SCEV const*&,
llvm::SCEV const*&, llvm::SCEV const*&) const
(/home/gibson/emsdk/upstream/bin/../lib/libLLVM-10svn.so+0x13f9961)
#10 0x7f8fdc4fce6c (anonymous
namespace)::LoopIdiomRecognize::runOnNoncountableLoop()
(/home/gibson/emsdk/upstream/bin/../lib/libLLVM-10svn.so+0x13eee6c)
#11 0x7f8fdc4f9d12 (anonymous
namespace)::LoopIdiomRecognizeLegacyPass::runOnLoop(llvm::Loop*,
llvm::LPPassManager&)
(/home/gibson/emsdk/upstream/bin/../lib/libLLVM-10svn.so

[llvm-bugs] [Bug 43242] Regression: clang crashes when processing operator() call in a lambda

2019-09-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=43242

Richard Smith  changed:

   What|Removed |Added

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

--- Comment #2 from Richard Smith  ---
Fixed in r371468. Thanks for the report and the reduced testcase!

-- 
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 43261] New: [InstCombine] Failure to simplify 2 icmp and select after rL369840

2019-09-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=43261

Bug ID: 43261
   Summary: [InstCombine] Failure to simplify 2 icmp and select
after rL369840
   Product: libraries
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Scalar Optimizations
  Assignee: unassignedb...@nondot.org
  Reporter: denis.bakhva...@intel.com
CC: llvm-bugs@lists.llvm.org

Before rL369840 we simplified the following case:

  %tmp = add i32 %i, -3
  %tmp1 = icmp ult i32 %tmp, 2
  %cmp2 = icmp eq i32 %i, 5
  %phitmp = zext i1 %cmp2 to i32
  %tmp2 = select i1 %tmp1, i32 1, i32 %phitmp

to

  %tmp = add i32 %i, -3
  %0 = icmp ult i32 %tmp, 3
  %tmp2 = zext i1 %0 to i32

Proof: https://rise4fun.com/Alive/dhoe

There were 4 steps of simplification:
step1&2: https://rise4fun.com/Alive/82o
step3&4: https://rise4fun.com/Alive/Izp

After rL369840 we invert the first comparison (icmp ult -> ugt, as a result of
tryToReuseConstantFromSelectInComparison() ) and instcombine takes another
route.

I'm not sure if it is a duplicate of recently created bug for InstCombine.

-- 
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 43260] emscripten exception with new LLVM backend

2019-09-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=43260

Heejin Ahn  changed:

   What|Removed |Added

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

--- Comment #4 from Heejin Ahn  ---
I could reproduce it with the emsdk latest-release. This is not a WebAssembly
backend's bug but a bug in some other LLVM IR pass, and this is fixed in the
current tip of the tree. Because this is not an LLVM bug, I'll close this, and
we can continue discussion in the emscripten issue.

-- 
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 42082] Defaults output file permissions to 0775 unlike GNU objcopy which mirrors the input file's permissions

2019-09-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=42082

Fangrui Song  changed:

   What|Removed |Added

 CC||i...@maskray.me
 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #4 from Fangrui Song  ---
Fixed by D62718/r365162 and follow-ups. The description of r365162 is
incorrect.

GNU objcopy has some tricky rules to decide the output permission.

  if (i_ehdrp->e_type == ET_EXEC)
abfd->flags |= EXEC_P;
  else if (i_ehdrp->e_type == ET_DYN)
abfd->flags |= DYNAMIC;

// bfd/opncls.c
static inline void
_maybe_make_executable (bfd * abfd)
{
  /* If the file was open for writing and is now executable,
 make it so.  */
  if (abfd->direction == write_direction
  && (abfd->flags & (EXEC_P | DYNAMIC)) != 0)
{
  struct stat buf;

  if (stat (abfd->filename, &buf) == 0
  /* Do not attempt to change non-regular files.  This is
 here especially for configure scripts and kernel builds
 which run tests with "ld [...] -o /dev/null".  */
  && S_ISREG(buf.st_mode))
{
  unsigned int mask = umask (0);

  umask (mask);
  chmod (abfd->filename,
 (0777
  & (buf.st_mode | ((S_IXUSR | S_IXGRP | S_IXOTH) &~ mask;
}
}
}

llvm-objcopy simply copies the permission of the input to the output.

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