[llvm-bugs] [Bug 47341] New: Support -mstack-protector-guard=sysreg for arm64 and riscv

2020-08-28 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=47341

Bug ID: 47341
   Summary: Support -mstack-protector-guard=sysreg for arm64 and
riscv
   Product: clang
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: -New Bugs
  Assignee: unassignedclangb...@nondot.org
  Reporter: keesc...@chromium.org
CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org,
neeil...@live.com, richard-l...@metafoo.co.uk

The Linux kernel uses this for having a per-thread stack canary. Implementing
this for both arm64 and riscv is desired.

For example, gcc's arm64 support is used like this in the kernel:

-mstack-protector-guard=sysreg
-mstack-protector-guard-reg=sp_el0
-mstack-protector-guard-offset=0

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0a1213fa7432778b71a1c0166bf56660a3aab030


Here are discussions on the start of riscv support:

https://lore.kernel.org/lkml/cajf2gttr_enhgrmjqnbgbhec8y4d3ysqaresvwhub1ykemk...@mail.gmail.com/

-- 
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 46725] [meta] 11.0.0 Release Blockers

2020-08-28 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46725
Bug 46725 depends on bug 47331, which changed state.

Bug 47331 Summary: Request merge of three AArch64 SVE fixes onto the LLVM 11 
release branch.
https://bugs.llvm.org/show_bug.cgi?id=47331

   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 47331] Request merge of three AArch64 SVE fixes onto the LLVM 11 release branch.

2020-08-28 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=47331

Hans Wennborg  changed:

   What|Removed |Added

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

--- Comment #1 from Hans Wennborg  ---
Okay, pushed as bc1425082be, 2bde1011ba1, f5c02e4855d.

Please let me know if there are any follow-ups.

-- 
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 47270] clang crashes on not finding a destructor during pch deserialization

2020-08-28 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=47270

Hans Wennborg  changed:

   What|Removed |Added

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

--- Comment #3 from Hans Wennborg  ---
(In reply to hokein from comment #2)
> reopen this for cherry-pick eed0af6179ca4fe9e60121e0829ed8d3849b1ce5

Pushed to 11.x as e37a52fe921280105f5f291bb01722c391ef1123. Thanks!

-- 
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 46725] [meta] 11.0.0 Release Blockers

2020-08-28 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46725
Bug 46725 depends on bug 47270, which changed state.

Bug 47270 Summary: clang crashes on not finding a destructor during pch 
deserialization
https://bugs.llvm.org/show_bug.cgi?id=47270

   What|Removed |Added

 Status|REOPENED|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 46725] [meta] 11.0.0 Release Blockers

2020-08-28 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46725
Bug 46725 depends on bug 47037, which changed state.

Bug 47037 Summary: apiModeling.llvm.CastValue checker crashes on every 
isa_and_nonnull<>()
https://bugs.llvm.org/show_bug.cgi?id=47037

   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 47037] apiModeling.llvm.CastValue checker crashes on every isa_and_nonnull<>()

2020-08-28 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=47037

Hans Wennborg  changed:

   What|Removed |Added

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

--- Comment #8 from Hans Wennborg  ---
(In reply to Artem Dergachev from comment #7)
> Landed as 5a9e7789396e and 4448affede51.

Thanks! Pushed to 11.x as 5b08e498cd3 and 22bce848a0b.

-- 
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 47134] OpenMP support is broken for JIT-compiled modules

2020-08-28 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=47134

Hans Wennborg  changed:

   What|Removed |Added

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

--- Comment #8 from Hans Wennborg  ---
(In reply to Johannes Doerfert from comment #7)
> So I tried to rebase it just to end up confused. Is it not already merged as
> 9f4a92a4349ff1794379b706a4851c678899d5d2 ? What am I missing here?

Oh, we merged that for another bug. Well, we should be good here then :-)

Sorry for the confusion.

-- 
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 46725] [meta] 11.0.0 Release Blockers

2020-08-28 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46725
Bug 46725 depends on bug 47134, which changed state.

Bug 47134 Summary: OpenMP support is broken for JIT-compiled modules
https://bugs.llvm.org/show_bug.cgi?id=47134

   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 46725] [meta] 11.0.0 Release Blockers

2020-08-28 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46725
Bug 46725 depends on bug 47336, which changed state.

Bug 47336 Summary: Merge d870e363263835bec96c83f51b20e64722cad742 into 11.0
https://bugs.llvm.org/show_bug.cgi?id=47336

   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 47336] Merge d870e363263835bec96c83f51b20e64722cad742 into 11.0

2020-08-28 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=47336

Hans Wennborg  changed:

   What|Removed |Added

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

--- Comment #1 from Hans Wennborg  ---
Pushed as 97ac9e82002d6b12831ca2c78f739cca65a4fa05.

-- 
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 47342] New: Broken fopencookie() seek interceptor on i386

2020-08-28 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=47342

Bug ID: 47342
   Summary: Broken fopencookie() seek interceptor on i386
   Product: compiler-rt
   Version: unspecified
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: asan
  Assignee: unassignedb...@nondot.org
  Reporter: nikita@gmail.com
CC: llvm-bugs@lists.llvm.org

Test case (based on an autoconf test for fopencookie):

#define _GNU_SOURCE
#include 
#include 

struct cookiedata {
off64_t pos;
};

ssize_t reader(void *cookie, char *buffer, size_t size) {
return size;
}
ssize_t writer(void *cookie, const char *buffer, size_t size) {
return size;
}
int closer(void *cookie) {
return 0;
}
int seeker(void *cookie, off64_t *position, int whence) {
((struct cookiedata*)cookie)->pos = *position;
return 0;
}

cookie_io_functions_t funcs = {reader, writer, seeker, closer};

int main() {
struct cookiedata g = { 0 };
FILE *fp = fopencookie(&g, "r", funcs);

if (fp && fseek(fp, 8192, SEEK_SET) == 0 && g.pos == 8192)
exit(0);
exit(1);
}

Compiled using `clang -m32 -g -Wall -fsanitize=address test.c` crashes with the
following trace:

(gdb) bt
#0  0x08109c6d in seeker (cookie=0xced0, position=0x2000, whence=0) at
test.c:19
#1  0x080b093a in wrapped_seek(void*, unsigned long long*, int) ()
#2  0xf7db0b53 in ?? () from /lib/i386-linux-gnu/libc.so.6
#3  0xf7ce563f in _IO_file_seekoff () from /lib/i386-linux-gnu/libc.so.6
#4  0xf7ce1769 in fseek () from /lib/i386-linux-gnu/libc.so.6
#5  0x08109e50 in main () at test.c:29

It looks like the function receives the offset rather than a pointer to the
offset.

The implementation of the seek interceptor can be found here:
https://github.com/llvm/llvm-project/blob/6148cca70888ead020a808279043fd013ca72a2a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc#L6332-L6339
>From a cursory look, I don't see anything wrong with it though. It just passes
through the offset pointer.

-- 
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 47343] New: opt -loop-vectorize crashes with "PHINode should have one entry for each predecessor of its parent basic block!"

2020-08-28 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=47343

Bug ID: 47343
   Summary: opt -loop-vectorize crashes with "PHINode should have
one entry for each predecessor of its parent basic
block!"
   Product: libraries
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Loop Optimizer
  Assignee: unassignedb...@nondot.org
  Reporter: mikael.hol...@ericsson.com
CC: llvm-bugs@lists.llvm.org

Created attachment 23902
  --> https://bugs.llvm.org/attachment.cgi?id=23902&action=edit
bbi-46598.ll

Reproduce with:
 opt -loop-vectorize -o /dev/null -S bbi-46598.ll -mtriple=arm64-apple-ios

Result:

PHINode should have one entry for each predecessor of its parent basic block!
  %4 = phi i8* [ %.lcssa, %if.end.us.us.us.preheader ], [ %.lcssa,
%middle.block ]
opt: ../lib/Transforms/Vectorize/LoopVectorize.cpp:8472: bool
llvm::LoopVectorizePass::processLoop(llvm::Loop *): Assertion
`!verifyFunction(*L->getHeader()->getParent(), &dbgs())' failed.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace.
Stack dump:
0.  Program arguments: /data/repo/master/llvm/build-all/bin/opt
-loop-vectorize -o /dev/null -S bbi-46598.ll -mtriple=arm64-apple-ios -debug
-print-after-all 
1.  Running pass 'Function Pass Manager' on module 'bbi-46598.ll'.
2.  Running pass 'Loop Vectorization' on function '@f'
/data/repo/master/llvm/build-all/bin/opt[0x47c4c14]
/data/repo/master/llvm/build-all/bin/opt(_ZN4llvm3sys17RunSignalHandlersEv+0xee)[0x47c279e]
/data/repo/master/llvm/build-all/bin/opt[0x47c4f2c]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12890)[0x7f2c20115890]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0xc7)[0x7f2c1ebbee97]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x141)[0x7f2c1ebc0801]
/lib/x86_64-linux-gnu/libc.so.6(+0x3039a)[0x7f2c1ebb039a]
/lib/x86_64-linux-gnu/libc.so.6(+0x30412)[0x7f2c1ebb0412]
/data/repo/master/llvm/build-all/bin/opt(_ZN4llvm17LoopVectorizePass11processLoopEPNS_4LoopE+0x4768)[0x4951b88]
/data/repo/master/llvm/build-all/bin/opt(_ZN4llvm17LoopVectorizePass7runImplERNS_8FunctionERNS_15ScalarEvolutionERNS_8LoopInfoERNS_19TargetTransformInfoERNS_13DominatorTreeERNS_18BlockFrequencyInfoEPNS_17TargetLibraryInfoERNS_12DemandedBitsERNS_9AAResultsERNS_15AssumptionCacheERSt8functionIFRKNS_14LoopAccessInfoERNS_4LoopEEERNS_25OptimizationRemarkEmitterEPNS_18ProfileSummaryInfoE+0x1d2)[0x49526b2]
/data/repo/master/llvm/build-all/bin/opt[0x4958288]
/data/repo/master/llvm/build-all/bin/opt(_ZN4llvm13FPPassManager13runOnFunctionERNS_8FunctionE+0x47f)[0x3ff888f]
/data/repo/master/llvm/build-all/bin/opt(_ZN4llvm13FPPassManager11runOnModuleERNS_6ModuleE+0x38)[0x3fff128]
/data/repo/master/llvm/build-all/bin/opt(_ZN4llvm6legacy15PassManagerImpl3runERNS_6ModuleE+0x35d)[0x3ff8e5d]
/data/repo/master/llvm/build-all/bin/opt(main+0x339f)[0x26e3d0f]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x7f2c1eba1b97]
/data/repo/master/llvm/build-all/bin/opt(_start+0x2a)[0x26ca02a]
Abort (core dumped)


When it fails the function looks like this:

define void @f() {
entry:
  br label %for.body3.lr.ph.outer

for.body3.lr.ph.outer:; preds = %cleanup, %entry
  %0 = load i8*, i8** @d, align 1
  br i1 true, label %if.end.us.us.us.preheader, label %land.end.preheader

land.end.preheader:   ; preds =
%for.body3.lr.ph.outer
  br label %land.end

if.end.us.us.us.preheader:; preds =
%for.body3.lr.ph.outer
  %.lcssa = phi i8* [ %0, %for.body3.lr.ph.outer ]
  br i1 false, label %scalar.ph, label %vector.memcheck

vector.memcheck:  ; preds =
%if.end.us.us.us.preheader
  %scevgep = getelementptr i8, i8* %.lcssa, i64 1
  %bound0 = icmp ult i8* bitcast (i32* @f.e to i8*), %scevgep
  %bound1 = icmp ult i8* %0, getelementptr (i8, i8* bitcast (i32* @f.e to i8*),
i64 1)
  %found.conflict = and i1 %bound0, %bound1
  %memcheck.conflict = and i1 %found.conflict, true
  br i1 %memcheck.conflict, label %scalar.ph, label %vector.ph

vector.ph:; preds = %vector.memcheck
  br label %vector.body

vector.body:  ; preds = %vector.body,
%vector.ph
  %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = add i32 undef, %index
  %1 = add i32 %offset.idx, 0
  %2 = add i32 %offset.idx, 4
  store i32 0, i32* @f.e, align 1, !alias.scope !0, !noalias !3
  store i32 0, i32* @f.e, align 1, !alias.scope !0, !noalias !3
  store i32 0, i32* @f.e, align 1, !alias.scope !0, !noalias !3
  store i32 0, i32* @f.e, align 1, !alias.scope !0, !noalias !3
  store i32 0, i32* @f.e, align 1, !alias.scope !0, !noalias !3
  store i32 0, i32* @f.e, align 1, !alias.scope !0, !noalias !3
  store i32 0, i32* @f.e, align 1, !alias.scope !0, !noalias !3

[llvm-bugs] [Bug 47344] New: ICE on x86_64-linux-gnu at `-O3` (Instruction Combining seems stuck in an infinite loop after 100 iterations.)

2020-08-28 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=47344

Bug ID: 47344
   Summary: ICE on x86_64-linux-gnu at `-O3` (Instruction
Combining seems stuck in an infinite loop after 100
iterations.)
   Product: new-bugs
   Version: trunk
  Hardware: PC
OS: All
Status: NEW
  Severity: enhancement
  Priority: P
 Component: new bugs
  Assignee: unassignedb...@nondot.org
  Reporter: cn...@uwaterloo.ca
CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org

$ clang-trunk -w t.c -O3
fatal error: error in backend: Instruction Combining seems stuck in an infinite
loop after 100 iterations.
clang-12: error: clang frontend command failed with exit code 70 (use -v to see
invocation)
clang version 12.0.0 (https://github.com/llvm/llvm-project.git
5feca7c9c336ed70c57e44a43f2677498480a56f)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/cnsun/usr/bin
clang-12: note: diagnostic msg: 


PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-12: note: diagnostic msg: /tmp/t-766683.c
clang-12: note: diagnostic msg: /tmp/t-766683.sh
clang-12: note: diagnostic msg: 


$ 
$ cat t.c
int a, b, c, e, f;
unsigned short d;
int main() {
  while (f) {
int h;
b = 0;
for (; b <= 29; b++)
  if (e >= (e && (h = c)))
d = (a = d) >> c;
h;
  }
}
$ 
$ clang-trunk -v
clang version 12.0.0 (https://github.com/llvm/llvm-project.git
5feca7c9c336ed70c57e44a43f2677498480a56f)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/cnsun/usr/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/10
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/10
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
$

-- 
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 47345] New: Constexpr constructor not initializing a union member is not diagnosed

2020-08-28 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=47345

Bug ID: 47345
   Summary: Constexpr constructor not initializing a union member
is not diagnosed
   Product: clang
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: normal
  Priority: P
 Component: C++14
  Assignee: unassignedclangb...@nondot.org
  Reporter: malts...@gmail.com
CC: blitzrak...@gmail.com, erik.pilking...@gmail.com,
llvm-bugs@lists.llvm.org, richard-l...@metafoo.co.uk

Consider the following C++14 code:

template  struct C {
union {
  int i;
};
constexpr C() {}
};
constexpr C c;

This code is ill-formed because the constructor C does not initialize the data
member i, but Clang fails to diagnose the error.

According to C++14 [dcl.constexpr]/4:
"The definition of a constexpr constructor shall satisfy the following
constraints:
- ...
In addition, either its function-body shall be = delete, or it shall satisfy
the following constraints:
- ...
- if the class is a union-like class, but is not a union, for each of its
anonymous union members having variant members, exactly one of them shall be
initialized;"

[dcl.constexpr]/6:
"If the instantiated template specialization of a constexpr function template
or member function of a class template would fail to satisfy the requirements
for a constexpr function or constexpr constructor, that specialization is still
a constexpr function or constexpr constructor, even though a call to such a
function cannot appear in a constant expression."

GCC produces the following diagnostic:
:7:18: error: 'constexpr C<  >::C() [with
 = int]' called in a constant expression

7 | constexpr C c;

  |  ^

:5:15: note: 'constexpr C<  >::C() [with
 = int]' is not usable as a 'constexpr' function
because:

5 | constexpr C() {}

  |   ^

:5:15: error: 'constexpr' constructor for union 'C::' must initialize exactly one non-static data member

-- 
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 47346] New: MS ABI: wrong ABI for returning struct with explicitly defaulted default constructor

2020-08-28 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=47346

Bug ID: 47346
   Summary: MS ABI: wrong ABI for returning struct with explicitly
defaulted default constructor
   Product: clang
   Version: 10.0
  Hardware: PC
OS: Windows NT
Status: NEW
  Severity: enhancement
  Priority: P
 Component: C++
  Assignee: unassignedclangb...@nondot.org
  Reporter: mizve...@gmail.com
CC: blitzrak...@gmail.com, dgre...@apple.com,
erik.pilking...@gmail.com, llvm-bugs@lists.llvm.org,
richard-l...@metafoo.co.uk

Consider this example reproduction:

```
extern void bar() noexcept;

struct ret1 {
bool val;
};

struct ret2 {
ret2() = default;
bool val;
};

template extern T fooret() noexcept;

template  void test() noexcept {
auto ret = fooret();
if (ret.val) bar();
}

template void test() noexcept;
template void test() noexcept;
```

MSVC generates exactly the same code for both `test` and `test`,
expecting the struct to be returned by register from `fooret<>`.

clang generates different code for each, on ret1 case it expects by register,
on ret2 case it passes by implicit pointer parameter.

Workspace for convenience: https://godbolt.org/z/q3194d

Also, and sorry perhaps if this should be a separate bug, but notice on clang
the ret2 case is also suppressed from tail calling into bar.
This should not happen either way, and may be related to
https://bugs.llvm.org/show_bug.cgi?id=46126
But perhaps it's because the implicit parameter does not have the
`[[clang::noescape]]` attribute?

The following code with an explicit reference parameter shows the noescape
attribute makes a difference (even though it should not, but that is probably
related to #46126)

The following code shows this:
```
extern void bar() noexcept;

struct ret_t {
unsigned int val;
};

extern void fooret1(ret_t&) noexcept;
extern void fooret2([[clang::noescape]] ret_t &) noexcept;

void test1() noexcept {
bool val;
{
ret_t ret;
fooret1(ret);
val = ret.val;
}
if (val) bar();
}

void test2() noexcept {
bool val;
{
ret_t ret;
fooret2(ret);
val = ret.val;
}
if (val) bar();
}
```

Another workspace for convenience: https://godbolt.org/z/r3qPsc

And there you can see test1 is suppressed from tail-calling into bar, but not
test2.

-- 
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 47347] New: After 6d485ff455ea, Assertion failed: (i < getNumParams() && "Illegal param #"), function getParamDecl, file clang/include/clang/AST/Decl.h, line 2430.

2020-08-28 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=47347

Bug ID: 47347
   Summary: After 6d485ff455ea, Assertion failed: (i <
getNumParams() && "Illegal param #"), function
getParamDecl, file clang/include/clang/AST/Decl.h,
line 2430.
   Product: new-bugs
   Version: trunk
  Hardware: PC
OS: All
Status: NEW
  Severity: enhancement
  Priority: P
 Component: new bugs
  Assignee: unassignedb...@nondot.org
  Reporter: dimi...@andric.com
CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org

Bulding the FreeBSD graphics/pgplot results in an assertion:

./pgdispd/updatelgtitle.c:31:8: note: 'sprintf' is a builtin with type 'int
(char *, const char *, ...)'
Assertion failed: (i < getNumParams() && "Illegal param #"), function
getParamDecl, file
/usr/local/poudriere/jails/head-i386/usr/src/contrib/llvm-project/clang/include/clang/AST/Decl.h,
line 2430.
PLEASE submit a bug report to https://bugs.freebsd.org/submit/ and include the
crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.  Program arguments: cc -O2 -pipe -fstack-protector-strong
-fno-strict-aliasing -I/usr/local/include -DPGDISP -c ./pgdispd/updatelgtitle.c
-o updatelgtitle.o 
1.  ./pgdispd/updatelgtitle.c:62:8: current parser token ')'
2.  ./pgdispd/updatelgtitle.c:21:1: parsing function body 'updatelgtitle'
3.  ./pgdispd/updatelgtitle.c:21:1: in compound statement ('{}')
4.  ./pgdispd/updatelgtitle.c:37:7: in compound statement ('{}')

Bisection shows this to be caused by https://reviews.llvm.org/D71566 /
https://reviews.llvm.org/rG6d485ff455ea ("Improve static checks for sprintf and
__builtin___sprintf_chk").

Minimized test case:

// clang -cc1 -triple x86_64-- -S updatelgtitle-min.c
int a;
char b;
double c, d;
void e() {
  void sprintf();
  sprintf(b, "line graphics #%d X %.6g Y %.6g", a, c, d);
}

-- 
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 23124 in oss-fuzz: llvm:llvm-dwarfdump-fuzzer: Abrt in llvm::Error::fatalUncheckedError

2020-08-28 Thread sheriffbot via monorail via llvm-bugs
Updates:
Labels: Deadline-Approaching

Comment #1 on issue 23124 by sheriffbot: llvm:llvm-dwarfdump-fuzzer: Abrt in 
llvm::Error::fatalUncheckedError
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=23124#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] [Bug 47348] New: [x86 asm] Assertion failed: (Type == RT32_32), function getRelocType32, file llvm/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp, line 260.

2020-08-28 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=47348

Bug ID: 47348
   Summary: [x86 asm] Assertion failed: (Type == RT32_32),
function getRelocType32, file
llvm/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cp
p, line 260.
   Product: new-bugs
   Version: trunk
  Hardware: PC
OS: All
Status: NEW
  Severity: normal
  Priority: P
 Component: new bugs
  Assignee: unassignedb...@nondot.org
  Reporter: dimi...@andric.com
CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org

Building the FreeBSD port graphics/vulkan-loader [1] results in an assertion:

Assertion failed: (Type == RT32_32), function getRelocType32, file
/usr/src/contrib/llvm-project/llvm/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp,
line 260.
PLEASE submit a bug report to https://bugs.freebsd.org/submit/ and include the
crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.  Program arguments: clang -cc1as -triple i386-unknown-freebsd13.0
-filetype obj -main-file-name unknown_ext_chain_gas.s -target-cpu i686
-mrelocation-model static unknown_ext_chain_gas.s

This is caused by a @GOT relocation in the .s file [2]; minimized test case:

# clang -cc1as -triple i386-- -filetype obj unknown_ext_chain_gas-min.s
.intel_syntax noprefix
push offset termin_error_string@GOT

I could not find any version of clang that was able to compile this without
asserting! GNU as has no problems, obviously:

% as -v unknown_ext_chain_gas-min.s -o unknown_ext_chain_gas-min.o
GNU assembler version 2.33.1 (i386-portbld-freebsd13.0) using BFD version (GNU
Binutils) 2.33.1

% objdump -d -r unknown_ext_chain_gas-min.o

unknown_ext_chain_gas-min.o: file format elf32-i386-freebsd


Disassembly of section .text:

 <.text>:
   0:   68 00 00 00 00  push   $0x0
1: R_386_GOT32  termin_error_string

[1] https://github.com/KhronosGroup/Vulkan-Loader
[2]
https://github.com/KhronosGroup/Vulkan-Loader/blob/master/loader/unknown_ext_chain_gas.S#L103

-- 
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 25272 in oss-fuzz: llvm:llvm-opt-fuzzer--x86_64-instcombine: ASSERT: isa(Val) && "cast() argument of incompatible type!"

2020-08-28 Thread ClusterFuzz-External via monorail via llvm-bugs
Status: New
Owner: 
CC: k...@google.com, masc...@google.com, jdevlieg...@apple.com, 
igm...@gmail.com, d...@google.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 Stability-Memory-AddressSanitizer Reproducible 
Engine-libfuzzer OS-Linux Proj-llvm Reported-2020-08-28
Type: Bug

New issue 25272 by ClusterFuzz-External: 
llvm:llvm-opt-fuzzer--x86_64-instcombine: ASSERT: isa(Val) && "cast() 
argument of incompatible type!"
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=25272

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

Project: llvm
Fuzzing Engine: libFuzzer
Fuzz Target: llvm-opt-fuzzer--x86_64-instcombine
Job Type: libfuzzer_asan_llvm
Platform Id: linux

Crash Type: ASSERT
Crash Address: 
Crash State:
  isa(Val) && "cast() argument of incompatible type!"
  llvm::Constant::getAggregateElement
  llvm::findScalarElement
  
Sanitizer: address (ASAN)

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

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

Issue filed automatically.

See https://google.github.io/oss-fuzz/advanced-topics/reproducing for 
instructions to reproduce this bug locally.
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 need to contact the OSS-Fuzz team with a question, concern, or any other 
feedback, please file an issue at https://github.com/google/oss-fuzz/issues. 
Comments on individual Monorail issues are not monitored.

-- 
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 46768] preprocessor thrown off by continuation in middle of function call argument with $

2020-08-28 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46768

Nichols A. Romero  changed:

   What|Removed |Added

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

--- Comment #2 from Nichols A. Romero  ---
Confirmed that it is 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 47349] New: llvm-10.0 fails to compile on RPi4 using gcc-10.1.0 and glibc-2.31

2020-08-28 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=47349

Bug ID: 47349
   Summary: llvm-10.0 fails to compile on RPi4 using gcc-10.1.0
and glibc-2.31
   Product: new-bugs
   Version: 10.0
  Hardware: PC
OS: Linux
Status: NEW
  Severity: normal
  Priority: P
 Component: new bugs
  Assignee: unassignedb...@nondot.org
  Reporter: john.frank...@outlook.com
CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org

llvm-10.0 and llvm-10.0.1 fail to compile on an RPi4 using gcc-10.1.0 and
glibc-2.31

llvm-10.0 successfully compiles on an RPi4 using gcc-9.2 and glibc-2.30

```
cmake -LAH -DCMAKE_C_FLAGS_RELEASE="-march=armv6zk -mtune=arm1176jzf-s
-mfpu=vfp -Os -pipe" -DCMAKE_CXX_FLAGS_RELEASE="-march=armv6zk
-mtune=arm1176jzf-s -mfpu=vfp -Os -pipe" -DCMAKE_INSTALL_PREFIX=/usr/local
-DLLVM_ENABLE_FFI=ON -DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON
-DLLVM_TARGETS_TO_BUILD="host" -DLLVM_ENABLE_RTTI=ON -DCMAKE_BUILD_TYPE=Release
-DCMAKE_VERBOSE_MAKEFILE=TRUE -DLLVM_BINUTILS_INCDIR=/usr/local/include
-Wno-dev -G Ninja ../
```

```
...
FAILED: lib/libLLVM-10.so 
: && /usr/local/bin/g++ -fPIC -fPIC -fvisibility-inlines-hidden
-Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings
-Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long
-Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-class-memaccess
-Wno-redundant-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment
-fdiagnostics-color -ffunction-sections -fdata-sections -march=armv6zk
-mtune=arm1176jzf-s -mfpu=vfp -Os -pipe  -Wl,-z,defs -Wl,-z,nodelete  
-Wl,-rpath-link,/mnt/sda8/usr/src/llvm-10.0.0.src/build/./lib  -Wl,-O3
-Wl,--gc-sections -shared -Wl,-soname,libLLVM-10.so -o lib/libLLVM-10.so
tools/llvm-shlib/CMakeFiles/LLVM.dir/libllvm.cpp.o 
-Wl,-rpath,"\$ORIGIN/../lib"
-Wl,--version-script,/mnt/sda8/usr/src/llvm-10.0.0.src/build/./lib/tools/llvm-shlib/simple_version_script.map
-Wl,--whole-archive lib/libLLVMDemangle.a lib/libLLVMSupport.a
lib/libLLVMCore.a lib/libLLVMFuzzMutate.a lib/libLLVMIRReader.a
lib/libLLVMCodeGen.a lib/libLLVMSelectionDAG.a lib/libLLVMAsmPrinter.a
lib/libLLVMMIRParser.a lib/libLLVMGlobalISel.a lib/libLLVMBinaryFormat.a
lib/libLLVMBitReader.a lib/libLLVMBitWriter.a lib/libLLVMBitstreamReader.a
lib/libLLVMDWARFLinker.a lib/libLLVMFrontendOpenMP.a
lib/libLLVMTransformUtils.a lib/libLLVMInstrumentation.a
lib/libLLVMAggressiveInstCombine.a lib/libLLVMInstCombine.a
lib/libLLVMScalarOpts.a lib/libLLVMipo.a lib/libLLVMVectorize.a
lib/libLLVMObjCARCOpts.a lib/libLLVMCoroutines.a lib/libLLVMCFGuard.a
lib/libLLVMLinker.a lib/libLLVMAnalysis.a lib/libLLVMLTO.a lib/libLLVMMC.a
lib/libLLVMMCParser.a lib/libLLVMMCDisassembler.a lib/libLLVMMCA.a
lib/libLLVMObject.a lib/libLLVMObjectYAML.a lib/libLLVMOption.a
lib/libLLVMRemarks.a lib/libLLVMDebugInfoDWARF.a lib/libLLVMDebugInfoGSYM.a
lib/libLLVMDebugInfoMSF.a lib/libLLVMDebugInfoCodeView.a
lib/libLLVMDebugInfoPDB.a lib/libLLVMSymbolize.a lib/libLLVMExecutionEngine.a
lib/libLLVMInterpreter.a lib/libLLVMJITLink.a lib/libLLVMMCJIT.a
lib/libLLVMOrcError.a lib/libLLVMOrcJIT.a lib/libLLVMRuntimeDyld.a
lib/libLLVMTarget.a lib/libLLVMARMCodeGen.a lib/libLLVMARMAsmParser.a
lib/libLLVMARMDisassembler.a lib/libLLVMARMDesc.a lib/libLLVMARMInfo.a
lib/libLLVMARMUtils.a lib/libLLVMAsmParser.a lib/libLLVMLineEditor.a
lib/libLLVMProfileData.a lib/libLLVMCoverage.a lib/libLLVMPasses.a
lib/libLLVMTextAPI.a lib/libLLVMDlltoolDriver.a lib/libLLVMLibDriver.a
lib/libLLVMXRay.a lib/libLLVMWindowsManifest.a -Wl,--no-whole-archive
lib/libLLVMObjCARCOpts.a lib/libLLVMDebugInfoPDB.a /usr/lib/libffi.so
lib/libLLVMExecutionEngine.a lib/libLLVMJITLink.a lib/libLLVMOrcError.a
lib/libLLVMRuntimeDyld.a lib/libLLVMipo.a lib/libLLVMIRReader.a
lib/libLLVMAsmParser.a lib/libLLVMInstrumentation.a lib/libLLVMLinker.a
lib/libLLVMVectorize.a lib/libLLVMAsmPrinter.a lib/libLLVMDebugInfoDWARF.a
lib/libLLVMGlobalISel.a lib/libLLVMSelectionDAG.a lib/libLLVMCodeGen.a
lib/libLLVMBitWriter.a lib/libLLVMScalarOpts.a
lib/libLLVMAggressiveInstCombine.a lib/libLLVMInstCombine.a
lib/libLLVMTransformUtils.a lib/libLLVMCFGuard.a lib/libLLVMTarget.a
lib/libLLVMAnalysis.a lib/libLLVMMCDisassembler.a lib/libLLVMProfileData.a
lib/libLLVMOption.a lib/libLLVMObject.a lib/libLLVMBitReader.a
lib/libLLVMCore.a lib/libLLVMRemarks.a lib/libLLVMBitstreamReader.a
lib/libLLVMMCParser.a lib/libLLVMMC.a lib/libLLVMDebugInfoCodeView.a
lib/libLLVMDebugInfoMSF.a lib/libLLVMTextAPI.a lib/libLLVMBinaryFormat.a
lib/libLLVMSupport.a lib/libLLVMDemangle.a -lz -lrt -ldl -lncursesw -lpthread
-lm /usr/local/lib/libxml2.so && :
/usr/local/bin/ld: lib/libLLVMOrcJIT.a(Core.cpp.o): in function
`std::__future_base::_State_baseV2::_M_break_promise(std::unique_ptr)':
Core.cpp:(.text._ZNSt13__future_base13_State_baseV216_M_break_promiseESt10unique_ptrINS_12_Result_baseENS2_8_DeleterEE[_ZNSt13__future_base13_State_base

[llvm-bugs] [Bug 47109] UNREACHABLE executed at llvm/lib/Target/AArch64/GISel/AArch64RegisterBankInfo.cpp:270!

2020-08-28 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=47109

Raul Tambre  changed:

   What|Removed |Added

 Status|CONFIRMED   |RESOLVED
 Resolution|--- |FIXED
 Fixed By Commit(s)||e887d0e89b837be37b4279735a9
   ||c1ac57e90c995

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