[llvm-bugs] [Bug 46247] New: [Simple Register Coalescing] Assertion `VNI && "No live value at use."' failed.

2020-06-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46247

Bug ID: 46247
   Summary: [Simple Register Coalescing]  Assertion `VNI && "No
live value at use."' failed.
   Product: libraries
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: normal
  Priority: P
 Component: Register Allocator
  Assignee: unassignedb...@nondot.org
  Reporter: pauls...@linux.vnet.ibm.com
CC: llvm-bugs@lists.llvm.org, quentin.colom...@gmail.com

Created attachment 23592
  --> https://bugs.llvm.org/attachment.cgi?id=23592&action=edit
reduced testcase

I found a test case which which triggered this assert with machine DCE
disabled. In the reduced test case, it seems that the whole block is in fact
dead and it would normally become an empty block after Machine DCE. However, if
run with 

llc -mtriple=s390x-linux-gnu -mcpu=z15 -O3 -o out.s tc_nolivevalatuse.ll
-disable-machine-dce -misched=shuffle

, the RegisterCoalescer deletes a lot of dead defs, but not all of them. Three
instructions remain, and the mischeduler will then be run and trigger the
assert.

It seems that the RegisterCoalescer is not updating data structures correctly
while deleting instructions.

llvm-project/llvm/lib/CodeGen/MachineScheduler.cpp:1144: void
llvm::ScheduleDAGMILive::updatePressureDiffs(llvm::ArrayRef):
Assertion `VNI && "No live value at use."' failed.
...
#8 0x02aa24927b36 llvm::ScheduleDAGMILive::updatePressureDiffs
...

-- 
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 46248] New: `-fmodules-local-submodule-visibility` does not work correctly with Objective-C

2020-06-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46248

Bug ID: 46248
   Summary: `-fmodules-local-submodule-visibility` does not work
correctly with Objective-C
   Product: clang
   Version: trunk
  Hardware: All
OS: All
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Frontend
  Assignee: unassignedclangb...@nondot.org
  Reporter: mboe...@google.com
CC: llvm-bugs@lists.llvm.org, neeil...@live.com,
richard-l...@metafoo.co.uk

Multiple places in AST/DeclObjC.{h,cpp} and Sema/SemaDeclObjC.cpp use
Decl::isHidden() instead of Sema::isVisible().

These two methods are equivalent only if -fmodules-local-submodule-visibility
is not turned on.

If -fmodules-local-submodule-visibility is turned on, Decl::isHidden() can
return true for declarations that have been made visible by importing the
(sub)module that owns them. (See also the FIXME in the comment for
Decl::isHidden().) As a result, the Objective-C code using Decl::isHidden()
will falsely assume that such declarations are hidden when in fact they are
visible.

For examples of how this causes wrong behavior, witness how adding the
-fmodules-local-submodule-visibility option to tests objc-categories.m,
objc-category-2.m and objc-category-3.m in test/Modules causes these tests to
fail.

Fixing this in Sema/SemaDeclObjC.cpp is easy, as Decl::isHidden() can simply be
replaced by Sema::isVisible().

Fixing this in AST/DeclObjC.{h,cpp} is more difficult as AST is not allowed to
depend on Sema. As a result, the functions in question and all of their callers
need to be moved to Sema. From what I have seen, this is a non-trivial
undertaking.

For more context, see also description on this change:
https://github.com/llvm/llvm-project/commit/90dc5254725e32c0fab65213c554b689a2a0bbbf

Also note this in-review change, which changes the name of Decl::isHidden() to
more accurately reflect what it does:
https://reviews.llvm.org/D81392

-- 
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 46249] New: [X86] VPSHUFD and VPERMQ with immediates combined into VPERMD with variable mask

2020-06-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46249

Bug ID: 46249
   Summary: [X86] VPSHUFD and VPERMQ with immediates combined into
VPERMD with variable mask
   Product: libraries
   Version: trunk
  Hardware: PC
OS: All
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Backend: X86
  Assignee: unassignedb...@nondot.org
  Reporter: craig.top...@gmail.com
CC: craig.top...@gmail.com, llvm-bugs@lists.llvm.org,
llvm-...@redking.me.uk, spatel+l...@rotateright.com

As noted here https://twitter.com/damageboy/status/1270266352406802432

We combined

t45: v16i32 = vector_shuffle<3,2,1,0,7,6,5,4,11,10,9,8,15,14,13,12> t44,
undef:v16i32
t46: v16i32 = vector_shuffle<8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7> t45,
undef:v16i32

into 

t258: v16i32 = vector_shuffle<11,10,9,8,15,14,13,12,3,2,1,0,7,6,5,4>

Which then required vpermd.


This happened before lowering and lowering doesn't know to recreate the two
shuffles. Simon, would hasFastVariableShuffle() also have created a VPERMD if
lowering had managed to make 2 immediate shuffles?

-- 
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 46250] New: Random `parser end of file`

2020-06-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46250

Bug ID: 46250
   Summary: Random `parser end of file`
   Product: clang
   Version: 10.0
  Hardware: PC
OS: other
Status: NEW
  Severity: normal
  Priority: P
 Component: -New Bugs
  Assignee: unassignedclangb...@nondot.org
  Reporter: ste...@profanter.me
CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org,
neeil...@live.com, richard-l...@metafoo.co.uk

-- 
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 46250] Random `parser end of file`

2020-06-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46250

Stefan Profanter  changed:

   What|Removed |Added

 Resolution|--- |INVALID
 Status|NEW |RESOLVED

--- Comment #1 from Stefan Profanter  ---
Sorry, accidentally clicked on submit. Please ignore this!

-- 
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 42986] Load/store combine fails to merge complex address math

2020-06-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=42986

Simon Pilgrim  changed:

   What|Removed |Added

 Resolution|--- |WONTFIX
 Status|NEW |RESOLVED

--- Comment #4 from Simon Pilgrim  ---
Changing the offsets to size_t avoids the problem with overflow semantics.

-- 
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 46251] New: [Matrix] Implement literal initializers for matrix types.

2020-06-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46251

Bug ID: 46251
   Summary: [Matrix] Implement literal initializers for matrix
types.
   Product: clang
   Version: unspecified
  Hardware: PC
OS: All
Status: NEW
  Severity: enhancement
  Priority: P
 Component: C++
  Assignee: unassignedclangb...@nondot.org
  Reporter: florian_h...@apple.com
CC: blitzrak...@gmail.com, dgre...@apple.com,
erik.pilking...@gmail.com, llvm-bugs@lists.llvm.org,
richard-l...@metafoo.co.uk

Define and implement initialization syntax for matrix types (as mentioned in
the TODO section: https://clang.llvm.org/docs/MatrixTypes.html#todos)

Once this is implemented, the commented out test in
https://github.com/llvm/llvm-project/blob/3323a628ec821b8b75d3b60bf1510931f97d3883/clang/test/CodeGenCXX/matrix-type-builtins.cpp#L78
should be enabled.

-- 
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 45886] Wrong variable value change during debugging at Og

2020-06-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=45886

Jan Kratochvil  changed:

   What|Removed |Added

 Fixed By Commit(s)||4515d35f5c9e2bdcdbcb9fe9028
   ||d4a84871958c5
 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 46252] New: New CodeGen/AMDGPU/inline-constraints.ll tests fail on x86 Linux

2020-06-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46252

Bug ID: 46252
   Summary: New CodeGen/AMDGPU/inline-constraints.ll tests fail on
x86 Linux
   Product: new-bugs
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: normal
  Priority: P
 Component: new bugs
  Assignee: unassignedb...@nondot.org
  Reporter: lukebe...@hotmail.com
CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org

After
https://github.com/llvm/llvm-project/commit/b087b91c917087bc53d47282a16ee4af78bfe286
[AMDGPU] Added 'A' constraint for inline assembler

the inline-constraints.ll lit test is failing on x86 Linux. I discovered this
with Arch 32, gcc 9.3.0.


Here is the build log:


llvm-project/llvm/test/CodeGen/AMDGPU/inline-constraints.ll:178:8: error: GCN:
expected string not found in input
; GCN: v_mov_b32 {{v[0-9]+}}, 0xbf00
   ^
:690:25: note: scanning from here
inline_A_constraint_F2: ; @inline_A_constraint_F2
^
:694:2: note: possible intended match here
 v_mov_b32 v0, 0x5f24720bf00
 ^
/llvm-project/llvm/test/CodeGen/AMDGPU/inline-constraints.ll:185:8: error: GCN:
expected string not found in input
; GCN: v_mov_b32 {{v[0-9]+}}, 0x4000
   ^
:722:25: note: scanning from here
inline_A_constraint_F3: ; @inline_A_constraint_F3
^
:726:2: note: possible intended match here
 v_mov_b32 v0, 0x5f247204000
 ^
/llvm-project/llvm/test/CodeGen/AMDGPU/inline-constraints.ll:192:8: error: GCN:
expected string not found in input
; GCN: v_mov_b32 {{v[0-9]+}}, 0xc080
   ^
:754:25: note: scanning from here
inline_A_constraint_F4: ; @inline_A_constraint_F4
^
:758:2: note: possible intended match here
 v_mov_b32 v0, 0x5f24720c080
 ^
/llvm-project/llvm/test/CodeGen/AMDGPU/inline-constraints.ll:207:8: error: GCN:
expected string not found in input
; GCN: v_mov_b32 {{v[0-9]+}}, 0x3f00
   ^
:815:25: note: scanning from here
inline_A_constraint_F6: ; @inline_A_constraint_F6
^
:819:2: note: possible intended match here
 v_mov_b32 v0, 0x5f247203f00
 ^

--


Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. 

Failed Tests (1):
  LLVM :: CodeGen/AMDGPU/inline-constraints.ll

-- 
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 22790 in oss-fuzz: llvm:clang-fuzzer: Stack-overflow in ComplexExprEvaluator::VisitBinaryOperator

2020-06-09 Thread ClusterFuzz-External via monorail via llvm-bugs
Updates:
Labels: ClusterFuzz-Verified
Status: Verified

Comment #1 on issue 22790 by ClusterFuzz-External: llvm:clang-fuzzer: 
Stack-overflow in ComplexExprEvaluator::VisitBinaryOperator
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=22790#c1

ClusterFuzz testcase 4809915205156864 is verified as fixed in 
https://oss-fuzz.com/revisions?job=libfuzzer_asan_llvm&range=202006080300:202006090257

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 46253] New: malloc analyzer check crashes

2020-06-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46253

Bug ID: 46253
   Summary: malloc analyzer check crashes
   Product: clang
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Static Analyzer
  Assignee: dcough...@apple.com
  Reporter: hok...@google.com
CC: dcough...@apple.com, llvm-bugs@lists.llvm.org

./clang-tidy -checks="-*,clang-analyzer*" /tmp/crash.cpp


crash.cpp:

class a {
  void realloc(int, bool = false) { realloc(1); }
};


assert.h assertion failed at
llvm-project/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp:427 in
clang::ento::SVal
clang::ento::SValBuilder::evalBinOp(clang::ento::ProgramStateRef,
BinaryOperator::Opcode, clang::ento::SVal, clang::ento::SVal, clang::QualType):
op == BO_Add
*** Check failure stack trace: ***
@ 0x564aecc437c6  __assert_fail
@ 0x564aeb336cbf  clang::ento::SValBuilder::evalBinOp()
@ 0x564aeb336efc  clang::ento::SValBuilder::evalEQ()
@ 0x564aeb13e777  (anonymous namespace)::MallocChecker::ReallocMemAux()
@ 0x564aeb135ba2  (anonymous namespace)::MallocChecker::checkRealloc()
@ 0x564aeb1454bd  clang::ento::check::PostCall::_checkCall<>()
@ 0x564aeb29b3f2 
clang::ento::CheckerManager::runCheckersForCallEvent()
@ 0x564aeb2e067e  clang::ento::ExprEngine::evalCall()
@ 0x564aeb2e0333  clang::ento::ExprEngine::VisitCallExpr()
@ 0x564aeb2bfe8d  clang::ento::ExprEngine::Visit()
@ 0x564aeb2bb96c  clang::ento::ExprEngine::ProcessStmt()
@ 0x564aeb2bb648  clang::ento::ExprEngine::processCFGElement()

-- 
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 25078] [Analyzer] Assertion "System is over constrained" after truncating 64 bits integers to 32 bits.

2020-06-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=25078

pierre gousseau  changed:

   What|Removed |Added

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

--- Comment #3 from pierre gousseau  ---
Thanks Denys for checking, yes closing as fixed now!

-- 
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 46254] New: [clang-format] BreakBeforeBraces: Whitesmiths ; In a ‘switch’ block, the ‘default’ case is always missing and indentation level.

2020-06-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46254

Bug ID: 46254
   Summary: [clang-format] BreakBeforeBraces: Whitesmiths ; In a
‘switch’ block, the ‘default’ case is always missing
and indentation level.
   Product: clang
   Version: trunk
  Hardware: PC
OS: Windows NT
Status: NEW
  Severity: release blocker
  Priority: P
 Component: Formatter
  Assignee: unassignedclangb...@nondot.org
  Reporter: smass...@matrox.com
CC: djas...@google.com, kli...@google.com,
llvm-bugs@lists.llvm.org

Bug found in upcoming llvm 11.0.
https://prereleases.llvm.org/win-snapshots/ClangFormat-2663a25f.vsix

In ‘clang-format’, when using "BreakBeforeBraces: Whitesmiths".
In a ‘switch’ block, the ‘default’ case is always missing and indentation
level. See below.
(It seems related to: https://reviews.llvm.org/D67627)

   switch(x)
  {
  case 0:
 {
 foo(x + 1);
 }
  break;

  case 1:
 {
 goo(x % 42);
 }
  break;

   default:
 {
 printf("the default case");
 }
  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
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 46255] New: Anonymous structs/unions can violate "Last member element" constraint on flexible arrays

2020-06-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46255

Bug ID: 46255
   Summary: Anonymous structs/unions can violate "Last member
element" constraint on flexible arrays
   Product: clang
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: normal
  Priority: P
 Component: C
  Assignee: unassignedclangb...@nondot.org
  Reporter: vaib...@linux.ibm.com
CC: blitzrak...@gmail.com, dgre...@apple.com,
erik.pilking...@gmail.com, llvm-bugs@lists.llvm.org,
richard-l...@metafoo.co.uk

Description:

In 'C' mode defining a struct containing 2 or more structs having flexible
arrays should result in 'gnu-variable-sized-type-not-at-end' warning getting
triggered as flexible arrays should always be at the end of the containing
struct.

However if the member struct elements are wrapped in an anonymous union or a
struct then clang erroneously ignores this violation.

Example:
Consider following struct definitions ( https://godbolt.org/z/7nnBGz ):

struct A { int a; int b[]; };
struct B { int a; int b[]; };

struct C {
/* warning: field 'a' with variable sized type 'struct A' not at
 * the end of a struct or class is a GNU extension 
 * [-Werror,-Wgnu-variable-sized-type-not-at-end]
 */ 
struct A a;  
struct B b;
};

struct C_U { 
 /* No warning reported */
struct A a;
union {
  struct B b;  
};
};

struct C_S { 
/* No warning reported */
struct A a;
struct {
  struct B b;  
};
};

struct C_SU { 
/* No warning reported */
struct A a;
struct {
  struct B b;  
};
union {
  struct A aa;  
};
};


Exception:
This issue is not observed in 'C++' mode ( https://godbolt.org/z/3nNzap )

-- 
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 46078] out-of-tree build can't find runtime/config.h

2020-06-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46078

Tim Keith  changed:

   What|Removed |Added

   Assignee|unassignedb...@nondot.org   |isu...@gmail.com
 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 46256] New: [coroutines] coroutines with potentially-throwing 'co_await promise.final_suspend()' expressions should be ill-formed

2020-06-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46256

Bug ID: 46256
   Summary: [coroutines] coroutines with potentially-throwing
'co_await promise.final_suspend()' expressions should
be ill-formed
   Product: clang
   Version: trunk
  Hardware: All
OS: All
Status: NEW
  Severity: normal
  Priority: P
 Component: C++2a
  Assignee: unassignedclangb...@nondot.org
  Reporter: lewissba...@gmail.com
CC: blitzrak...@gmail.com, erik.pilking...@gmail.com,
llvm-bugs@lists.llvm.org, richard-l...@metafoo.co.uk

The wording of [dcl.fct.def.coroutine]/15 states:
> The expression co_­await promise.final_­suspend() shall not be 
> potentially-throwing ([except.spec]).


See http://eel.is/c++draft/dcl.fct.def.coroutine#15
and http://eel.is/c++draft/except.spec#6

I believe this means that the compiler should reject with a diagnostic any
coroutine with a promise_type where `co_await promise.final_suspend()` is not
noexcept. ie. all of the following must be declared noexcept (if they form part
of the await-expression):
- promise_type::final_suspend()
- finalSuspendObj.operator co_await()
- finalSuspendAwaiter.await_ready()
- finalSuspendAwaiter.await_suspend()
- finalSuspendAwaiter.await_resume()
- finalSuspedObj destructor
- finalSuspendAwaiter destructor

Clang (and GCC) currently accepts code that that does not declare
final_suspend() as
noexcept.

e.g. see https://godbolt.org/z/Et_5eo

-- 
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 45594] lld resolves reloc to sym in discarded section to 0 if sym_name < originating_sym_name

2020-06-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=45594

Fangrui Song  changed:

   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 40971] [Coverage] Assertion when using _Pragma("unroll()")

2020-06-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=40971

Yuanfang Chen  changed:

   What|Removed |Added

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

--- Comment #2 from Yuanfang Chen  ---
Fixed with 9c2e770034d04a0966b84cac14a9e3fb3b0d4ab7

-- 
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 46257] New: data race in libomptarget

2020-06-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46257

Bug ID: 46257
   Summary: data race in libomptarget
   Product: OpenMP
   Version: unspecified
  Hardware: PC
OS: Linux
Status: NEW
  Severity: normal
  Priority: P
 Component: Runtime Library
  Assignee: unassignedb...@nondot.org
  Reporter: xw111lu...@gmail.com
CC: llvm-bugs@lists.llvm.org

My code offloads from multiple host threads simultaneously.
I'm running on x86-64 + NVIDIA GPU.

git clone https://github.com/ye-luo/miniqmc.git
cd miniqmc/build
cmake -DCMAKE_CXX_COMPILER=clang++ -DENABLE_OFFLOAD=1 -DUSE_OBJECT_TARGET=ON ..

make -j15 miniqmc_sync_move

OMP_NUM_THREADS=8 ./bin/miniqmc_sync_move -w 80 -c 2 -n 1

Libomptarget fatal error 1: failure of target construct while offloading is
mandatory
Libomptarget fatal error 1: failure of target construct while offloading is
mandatory
Segmentation fault (core dumped)

OMP_NUM_THREADS=1 runs fine.

The same code runs well on Power9+V100 and XL compiler.

-- 
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 46237] Size regression -Os constant propagation difference results in larger code

2020-06-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46237

Sanjay Patel  changed:

   What|Removed |Added

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

--- Comment #3 from Sanjay Patel  ---
https://github.com/llvm/llvm-project/commit/6f6d2d238360883039cd17986c9ef598d04995a3

-- 
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 46255] Anonymous structs/unions can violate "Last member element" constraint on flexible arrays

2020-06-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46255

Erich Keane  changed:

   What|Removed |Added

 Status|CONFIRMED   |RESOLVED
 Fixed By Commit(s)||113b0d7d0bd637743efb050ad61
   ||9dd0c6d306e96/90ee8cf63613d
   ||f525c4dab5e715fbae5f7310a78
 Resolution|--- |FIXED

--- Comment #1 from Erich Keane  ---
113b0d7d0bd637743efb050ad619dd0c6d306e96

Fixed in that commit, but that had a mistake in it, so THAT was fixed in:
90ee8cf63613df525c4dab5e715fbae5f7310a78

-- 
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 46258] New: [AArch64] Some functions compiled without BTI with -fsanitize=cfi

2020-06-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46258

Bug ID: 46258
   Summary: [AArch64] Some functions compiled without BTI with
-fsanitize=cfi
   Product: new-bugs
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: normal
  Priority: P
 Component: new bugs
  Assignee: pe...@pcc.me.uk
  Reporter: samitolva...@google.com
CC: htmldevelo...@gmail.com, keesc...@chromium.org,
llvm-bugs@lists.llvm.org

When compiling a binary with both -mbranch-protection=bti and -fsanitize=cfi,
LLVM warns about functions being compiled without BTI:

$ echo "void a() {}" > test.c
$ clang -target aarch64-linux-gnu- -mbranch-protection=bti \
   -flto=thin -fvisibility=default -fsanitize=cfi -fsanitize-cfi-cross-dso \
   -c test.c
$ ld.lld  -r -o test.lto.o test.o
warning: some functions compiled with BTI and some compiled without BTI
warning: not setting BTI in feature flags

Looking at the disassembly of test.o, it looks like the compiler generated
__cfi_check and __cfi_check_fail functions don't have the
"branch-target-enforcement" attribute.

-- 
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 46259] New: Clang pointer to VLA conversions disallowed in C++ mode.

2020-06-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46259

Bug ID: 46259
   Summary: Clang pointer to VLA conversions disallowed in C++
mode.
   Product: clang
   Version: trunk
  Hardware: PC
OS: Windows NT
Status: NEW
  Severity: enhancement
  Priority: P
 Component: C++
  Assignee: unassignedclangb...@nondot.org
  Reporter: erich.ke...@intel.com
CC: blitzrak...@gmail.com, dgre...@apple.com,
erik.pilking...@gmail.com, llvm-bugs@lists.llvm.org,
richard-l...@metafoo.co.uk

See https://godbolt.org/z/dBvJLK


void foo(void *a, int x) {
int (*VLA) [x] = (int(*)[x]) a;
VLA = (int(*)[x]) a;
}

:4:11: error: cannot initialize a variable of type 'int (*)[x]' with an
rvalue of type 'int (*)[x]'

int (*VLA) [x] = (int(*)[x]) a;

  ^  ~

:5:11: error: incompatible pointer types assigning to 'int (*)[x]' from
'int (*)[x]'

VLA = (int(*)[x]) a;

  ^

2 errors generated.

Compiler returned: 1



The two types listed in both error message (despite syntactically and textually
identical) are actually pointers to different types, thus conversions aren't
allowed.  In C mode the IsPointerConversion goes through typesAreConvertible
and mergeTypes and decides they are the compatible.  However, the rules in C++
disallow these compatible conversions.

GCC allows these, and it seems to me that these two types should be allowed as
they are effectively the 'same' type despite being represented as different
types in our AST.

SO, to fix this I think we either need to 

a: better canonicalize VLA types based on their represented types/bounds,
though this wouldn't fix the situation where the value of 'x' above could
change between them, so it would accept some incompatible types (where hte
value of "x" changed between the two), and disallow others.


b: Simply treat these as 'same-type' as a condition in isPointerConversion. I
think we can just do a minimal reproduction of mergeTypes to recursively check
ONLY VLA and element types.  C mode ALSO allows fixed-size arrays on either
side of the conversion, so we may consider making this work for all array
types?

-- 
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 42783] Add a way to avoid calls to noreturn functions from being merged

2020-06-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=42783

Zequan Wu  changed:

   What|Removed |Added

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

--- Comment #5 from Zequan Wu  ---
A new attribute called "nomerge" has been introduced to prevent callsites
merging.

You can read more about it on
https://clang.llvm.org/docs/AttributeReference.html#nomerge

-- 
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 46260] New: Using builtin_assume to optimize pointer "ptr + size / sizeof(Struct)" does not work

2020-06-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46260

Bug ID: 46260
   Summary: Using builtin_assume to optimize pointer "ptr + size /
sizeof(Struct)" does not work
   Product: clang
   Version: trunk
  Hardware: All
OS: All
Status: NEW
  Severity: normal
  Priority: P
 Component: C++
  Assignee: unassignedclangb...@nondot.org
  Reporter: mv...@google.com
CC: blitzrak...@gmail.com, dgre...@apple.com,
erik.pilking...@gmail.com, llvm-bugs@lists.llvm.org,
richard-l...@metafoo.co.uk

Background: for some vector logic, I attempted to minimize the code for keeping
the distance for some 'begin' vs 'end' span.

i.e.:
void SomeFunction() {
  size_type size = byte_size(begin_, end_);
  begin_ = grow_or_something(begin_, );
  end_ = add_byte_size(begin_, size);
}

auto byte_size(S* begin, S* end) {
return (end - begin) * sizeof(S);
}

auto add_byte_size(S* begin, size_t n) {
__builtin_assume((n % sizeof(S)) == 0);
return begin + n / sizeof(S);
}

The 'add_byte_size()' method refuses to do the raw add, despite my 'assume this
is a multiple of sizeof(S)'. The only think that works (reliably) is cast it
through intptr, which I'd prefer not to. (especially as the real code works
with pointer traits / pointer types making it even more verbose / boilerplate.

See examples / attempts / what works at https://gcc.godbolt.org/z/94Upor

-- 
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 46261] New: [SLP] SLP vectorizer change causes performance loss

2020-06-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46261

Bug ID: 46261
   Summary: [SLP] SLP vectorizer change causes performance loss
   Product: libraries
   Version: trunk
  Hardware: PC
OS: Windows NT
Status: NEW
  Severity: normal
  Priority: P
 Component: Scalar Optimizations
  Assignee: unassignedb...@nondot.org
  Reporter: wolfgang_p...@playstation.sony.com
CC: llvm-bugs@lists.llvm.org

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

After the commit
https://github.com/llvm/llvm-project/commit/6a18a9548761b266b28a49f705a568677c24b59b
the attached test experiences a roughly 50% slowdown.

Compile with clang -O2 -march=btver2.

The IR dump after SLP shows that, before the commit, a substantial number of
shuffle instructions are present, e.g.

%shuffle = shufflevector <2 x float> %14, <2 x float> undef, <4 x i32>  

whereas after the commit, the IR dump does not show any.

-- 
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 45624] clang fails to detect using an object before it is initialized

2020-06-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=45624

Zequan Wu  changed:

   What|Removed |Added

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

--- Comment #11 from Zequan Wu  ---
A new flag -Wuninitialized-const-reference has been introduced to diagnose a
warning when passing uninitialized variables as const reference parameters to a
function.

https://reviews.llvm.org/rG170b6869b563dd3393d99f3e03d389b9058d5f24

-- 
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 46005] Name mangling problem when initializing inline std::function with lambda

2020-06-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46005

Zequan Wu  changed:

   What|Removed |Added

 Resolution|--- |DUPLICATE
 Status|NEW |RESOLVED
 CC||zequa...@google.com

--- Comment #1 from Zequan Wu  ---


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

-- 
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 46262] New: Miscompilation leads to system out to memory

2020-06-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46262

Bug ID: 46262
   Summary: Miscompilation leads to system out to memory
   Product: clang
   Version: trunk
  Hardware: PC
OS: Windows NT
Status: NEW
  Severity: release blocker
  Priority: P
 Component: -New Bugs
  Assignee: unassignedclangb...@nondot.org
  Reporter: changoch...@gmail.com
CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org,
neeil...@live.com, richard-l...@metafoo.co.uk

We found a bug that can exhaust the memory of the os.

POC:
---
int a;
int b() {
  int c;
  short d, *e = b();
  switch (c)
do {
case 3:
  if (a)
e = &d;
case 6:
  e++;
} while (e);

  return 1;
}
---

Cmdline:
---
clang-11 -cc1 -emit-obj -O3 -o /dev/null -x c poc.c
---

Clang-version:
---
clang version 11.0.0 (https://github.com/llvm/llvm-project.git
641d5ac4d1965990fcf981f153369b038816cd16)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home//llvm-project/build_clean/bin
---

The compilation exhausts the 256G on my system. Tested on the latest
update-to-date master branch of clang.

-- 
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 46263] New: The lld cannot identify LMA overlapping when the VMA is not specified.

2020-06-09 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46263

Bug ID: 46263
   Summary: The lld cannot identify LMA overlapping when the VMA
is not specified.
   Product: lld
   Version: unspecified
  Hardware: PC
OS: Windows NT
Status: NEW
  Severity: enhancement
  Priority: P
 Component: ELF
  Assignee: unassignedb...@nondot.org
  Reporter: 2077213...@qq.com
CC: llvm-bugs@lists.llvm.org, smithp...@googlemail.com

I used the latest lld and one of the versions of lld and found that the latest
version had a problem.

MEMORY  {
  DDR : o = 0xfb0, l = 185M
  TCM : o = 0x1F40, l = 128K
}

SECTIONS {
  .text 0xfb0 : {
* (.text);
_etext = .;
   } > DDR
  .mdata : AT(LOADADDR(.text) + SIZEOF(.text)) {
_data = .;
*(.data);
_edata = .;
  } > TCM
  .bss : { // This is not reasonable because the LMA of .bss overlaps that of
.mdata.
_bstart = .;
*(.bss) * (COMMON);
_bend = .;
  } > DDR
  .ARM.exidx : {
*(.ARM.exidx);
  } > DDR
}

// The latest linker. from https://github.com/llvm/llvm-project Source code
compilation

ld.lld -T my.ld test.o
objdump -hw a.out

## the .bss LMA is a Strange numbers.

Idx Name  Size  VMA   LMA   File off  Algn  Flags
  0 .text 0008  0fb0  0fb0  1000  2**2  CONTENTS,
ALLOC, LOAD, READONLY, CODE
  1 .mdata0004  1f40  0fb8  2000  2**2  CONTENTS,
ALLOC, LOAD, DATA
  2 .bss  0008  0fb8  00200010  2004  2**2  ALLOC
  3 .ARM.exidx0010  0fb00010  00200018  2010  2**2  CONTENTS,
ALLOC, LOAD, READONLY, DATA
  4 .comment  00bc      2020  2**0  CONTENTS,
READONLY
  5 .ARM.attributes 003e      20dc  2**0  CONTENTS,
READONLY

// one of version lld. The overlap can be identified.
//./ld.lld -v
//LLD 11.0.0 (https://github.com/llvm/llvm-project.git
07d68c24aa19483e44db4336b0935b00a5d69949) (compatible with GNU linkers)

ld.lld -T gcc.ld test.o
ld.lld: warning: lld uses blx instruction, no object with architecture
supporting feature detected
ld.lld: error: section .mdata load address range overlaps with .bss
>>> .mdata range is [0xFB8, 0xFBB]
>>> .bss range is [0xFB8, 0xFBF]

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