[llvm-bugs] [Bug 44110] New: Optimizer for __builtin_bswap32 fails

2019-11-21 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=44110

Bug ID: 44110
   Summary: Optimizer for __builtin_bswap32 fails
   Product: clang
   Version: 8.0
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: C++
  Assignee: unassignedclangb...@nondot.org
  Reporter: ditlef.mart...@gmail.com
CC: blitzrak...@gmail.com, dgre...@apple.com,
erik.pilking...@gmail.com, llvm-bugs@lists.llvm.org,
richard-l...@metafoo.co.uk

The following code runs OK in Compiler Explorer with opts: -std=c++11 -O1
Fails running: -std=c++11 -O3
Byte swapping is omitted.

#include 
#include 

#include 

inline
static void swap(uint32_t & value)
{
value = __builtin_bswap32(value);
}

inline
void swap(float & value)
{
swap(*(reinterpret_cast(&value)));
}

// Swap an array of values
template
inline void swap(PtrType * data, size_t length)
{
for (size_t i = 0; i < length; ++i)
swap(data[i]);
}


template
void output(const char * s, T v) // __attribute__((noinline))
{
  std::cout << s << ": " << v << std::endl;
}

int main()
{
float vec1[2];
vec1[0] = rand(); vec1[1] = rand();
const float vec1Orig = vec1[0];
output("vec1[0] value before swap", vec1[0]);
swap(vec1, 2);
if (vec1[0] == vec1Orig)
output("Failed: vec1[0] value after swap", vec1[0]);
else
output("OK: vec1[0] value after swap", vec1[0]);
}

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


[llvm-bugs] [Bug 44109] New: Backport rGc84c62c50aa8 into 9.0.1

2019-11-21 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=44109

Bug ID: 44109
   Summary: Backport rGc84c62c50aa8 into 9.0.1
   Product: new-bugs
   Version: 9.0
  Hardware: Other
OS: All
Status: NEW
  Severity: release blocker
  Priority: P
 Component: new bugs
  Assignee: unassignedb...@nondot.org
  Reporter: amy.kw...@ibm.com
CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org
Blocks: 43360

Hi, 

Is it possible to backport rGc84c62c50aa8 into 9.0.1? The Phabricator review is
located here: https://reviews.llvm.org/D64817

Thanks.


Referenced Bugs:

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


[llvm-bugs] [Bug 43360] [meta] 9.0.1 Release Blockers

2019-11-21 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=43360
Bug 43360 depends on bug 43830, which changed state.

Bug 43830 Summary: lldb crashes when loading Python 3.6 interpreter
https://bugs.llvm.org/show_bug.cgi?id=43830

   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 43830] lldb crashes when loading Python 3.6 interpreter

2019-11-21 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=43830

Tom Stellard  changed:

   What|Removed |Added

 Status|CONFIRMED   |RESOLVED
 Resolution|--- |FIXED
 Fixed By Commit(s)|9357b5d df3ae1e |9357b5d df3ae1e 186c848
   ||6d7bc60

-- 
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 43308] StackProtector - stack violation not caught

2019-11-21 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=43308

Tom Stellard  changed:

   What|Removed |Added

 Fixed By Commit(s)|r373216 r373219 r373220 |r373216 r373219 r373220
   ||c1d76f4 76817ab 28c1f51
 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #10 from Tom Stellard  ---
Merged: c1d76f4 76817ab 28c1f51

-- 
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 43360] [meta] 9.0.1 Release Blockers

2019-11-21 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=43360
Bug 43360 depends on bug 43308, which changed state.

Bug 43308 Summary: StackProtector - stack violation not caught
https://bugs.llvm.org/show_bug.cgi?id=43308

   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 41926] select statement crashes wasm64 backend

2019-11-21 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=41926

Dan Gohman  changed:

   What|Removed |Added

 CC||dan433...@gmail.com
 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #3 from Dan Gohman  ---
On LLVM master, there's now an error message when using wasm64, as it indeed is
experimental and generally not usable yet.

https://github.com/llvm/llvm-project/commit/5b74c39d7222d6a8e449d63e7b5eeada712e6fcb

-- 
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 43354] Crash when compiling a simple hello world into webassembly

2019-11-21 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=43354

Dan Gohman  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 CC||dan433...@gmail.com
 Status|CONFIRMED   |RESOLVED

--- Comment #8 from Dan Gohman  ---
A warning for this has now been added on LLVM master:

https://github.com/llvm/llvm-project/commit/5b74c39d7222d6a8e449d63e7b5eeada712e6fcb

-- 
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 44106] New: clang_getCursorExtent yields invalid range for macro expansions

2019-11-21 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=44106

Bug ID: 44106
   Summary: clang_getCursorExtent yields invalid range for macro
expansions
   Product: clang
   Version: trunk
  Hardware: PC
OS: Windows NT
Status: NEW
  Severity: enhancement
  Priority: P
 Component: libclang
  Assignee: unassignedclangb...@nondot.org
  Reporter: ta...@outlook.com
CC: kli...@google.com, llvm-bugs@lists.llvm.org,
richard-l...@metafoo.co.uk

Currently libclang exposes `CXSourceRange clang_getCursorExtent(CXCursor C)`,
this function
(https://github.com/llvm/llvm-project/blob/master/clang/tools/libclang/CIndex.cpp#L6129)
gets the raw extent and then calls cxloc::translateSourceRange.
cxloc::translateSourceRange
(https://github.com/llvm/llvm-project/blob/master/clang/tools/libclang/CIndex.cpp#L142)
currently has the following comment:

/// Translate a Clang source range into a CIndex source range.
///
/// Clang internally represents ranges where the end location points to the
/// start of the token at the end. However, for external clients it is more
/// useful to have a CXSourceRange be a proper half-open interval. This routine
/// does the appropriate translation.

This comment makes sense and gives an understanding that for an expression
like: `x + 2000` the range used by clang is `x + 2` and it will translate it to
be the full `x + 2000`.
However, the logic the method runs includes some special handling for macro
expansions that ultimately gives you a range of ‘macro start’ to ‘expansion
end’.
This conversion means that for a given macro the range you get back can include
thousands of in-between tokens that are unrelated.

An example of this is the following code where the range of the APPROX_PI
literal in the method starts at the 3 in the macro but ends just before the
semicolon in the method.
That is, the returned range is “Line 1, Column 19” to “Line 5, Column 21”; when
it is expected to be “Line 1, Column 19” to “Line 1, Column 26”.

#define APPROX_PI 3.14159

double getApproxPI()
{
return APPROX_PI;
}

-- 
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 44107] New: class template argument deduction does not perform pointer decay

2019-11-21 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=44107

Bug ID: 44107
   Summary: class template argument deduction does not perform
pointer decay
   Product: clang
   Version: 9.0
  Hardware: All
OS: All
Status: NEW
  Severity: normal
  Priority: P
 Component: C++17
  Assignee: unassignedclangb...@nondot.org
  Reporter: alisda...@me.com
CC: blitzrak...@gmail.com, erik.pilking...@gmail.com,
llvm-bugs@lists.llvm.org, richard-l...@metafoo.co.uk

This simple program shows the fail:

#include 

void func() {}

int main() {
std::pair y{"hello", func};
}


'func' is deduced as a function type, not decayed to a function pointer type. 
Similarly, the diagnostic message suggests that the string literal is deducing
as an array, rather than decaying to a pointer-to-element.

This same test compiles cleanly with gcc and Intel/EDG front ends in the online
compilers at Compiler Explorer:
   https://godbolt.org/z/dP38XN

-- 
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 44105] New: Clang generates @PLT branches for powerpc, even when built without -fPIC

2019-11-21 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=44105

Bug ID: 44105
   Summary: Clang generates @PLT branches for powerpc, even when
built without -fPIC
   Product: clang
   Version: unspecified
  Hardware: Macintosh
OS: All
Status: NEW
  Severity: enhancement
  Priority: P
 Component: LLVM Codegen
  Assignee: unassignedclangb...@nondot.org
  Reporter: chmeeed...@gmail.com
CC: llvm-bugs@lists.llvm.org, neeil...@live.com,
richard-l...@metafoo.co.uk

A simple program:

int main(int);

int __start(void) {
  return main(0);
}

When built with clang for powerpc: cc -m32 -ffreestanding -o freestanding.o

generates R_PPC_PLTREL24 relocations, when it should be generating only
R_PPC_REL32 relocations, and letting the linker do the fixups.  These
R_PPC_PLTREL24 relocations appear to be forcing GNU ld to use BSS-PLT instead
of secure-PLT.  Generating to asm, hand-removing the @PLT annotation, GNU ld
does not choose bss-plt.

Not sure if this is a clang bug or LLVM bug, as the intermediate LLVM listing
is difficult to decipher.

-- 
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 37728] [meta] Make llvm passes debug info invariant

2019-11-21 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=37728
Bug 37728 depends on bug 43964, which changed state.

Bug 43964 Summary: BranchFolder not debug invariant
https://bugs.llvm.org/show_bug.cgi?id=43964

   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 43964] BranchFolder not debug invariant

2019-11-21 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=43964

Jeremy Morse  changed:

   What|Removed |Added

 CC||apra...@apple.com,
   ||v...@apple.com

bjorn.a.petters...@ericsson.com changed:

   What|Removed |Added

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

--- Comment #4 from Jeremy Morse  ---
Hi,

Bjorn wrote:
> It seems like BlockFolder (BlockFolding.cpp) isn't caring that much about 
> CFI instruction inside the tail, but it does make sure it isn't chopping of 
> CFI instructions in the beginning of the block.

I get the impression that this might be an artefact of its "advance then
rewind" approach, rather than something deliberate. One of the comments in the
large block you delete in D70091 illustrates a CFI_INSTRUCTION inside a tail
that shouldn't be "chopped off".

Then again, I know pretty much nothing about CFI anyway.

Paul wrote:
> CFI (call frame information) is emitted whenever unwinding is a possibility.
> That can be with -g, it can also be with -fexceptions (and other similar
> codegen options).

This sounds unpleasant -- if I understand correctly, then if only '-g' was
specified then we want to prioritise not changing codegen; but if -fexceptions
was specified then codegen _should_ change to make exceptions operate
correctly? That could then (potentially) mean two different ways of treating
CFI_INSTRUCTION.

--- Comment #5 from bjorn.a.petters...@ericsson.com ---
The -g invariance introduced by https://reviews.llvm.org/D66467 has now been
fixed in rG898de302919b (https://reviews.llvm.org/D70091).

The fix restores the old behavior to say that a found common tail cover the
whole basic block even if debug instructions are found before the tail.

As the earlier comments talk a lot about CFI directives I want to highlight
that the fix does not change anything related to CFI directives. If such
instructions are found before the common tail, then we still need to split the
BB when doing a tail merge.

-- 
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 16867 in oss-fuzz: llvm:clangd-fuzzer: Stack-overflow in llvm::json::Parser::parseValue

2019-11-21 Thread sheriff… via monorail via llvm-bugs

Updates:
Labels: Deadline-Approaching

Comment #2 on issue 16867 by sheriff...@chromium.org: llvm:clangd-fuzzer:  
Stack-overflow in llvm::json::Parser::parseValue

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16867#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] [Bug 44104] New: LLDB looking for wrong version of lldb-server

2019-11-21 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=44104

Bug ID: 44104
   Summary: LLDB looking for wrong version of lldb-server
   Product: Packaging
   Version: unspecified
  Hardware: PC
OS: Linux
Status: NEW
  Severity: normal
  Priority: P
 Component: deb packages
  Assignee: unassignedb...@nondot.org
  Reporter: peterhul...@gmail.com
CC: llvm-bugs@lists.llvm.org

Using the LLVM 9 packages from https://apt.llvm.org/ for Debian 10 Buster.

Attempting to debug an executable fails:

$ lldb --version
lldb version 9.0.1
$ lldb myprog 
(lldb) target create "myprog"
Current executable set to 'myprog' (x86_64).
(lldb) run
error: process launch failed: unable to locate lldb-server-9.0.1

I would expect this to run "myprog" under the debugger.

I have these (2nd & 3rd are symlinks to lldb-server)

$ ls /usr/lib/llvm-9/bin/lldb-server*
/usr/lib/llvm-9/bin/lldb-server/usr/lib/llvm-9/bin/lldb-server-9.0.0
/usr/lib/llvm-9/bin/lldb-server-9 

The exact version is 

$ apt list lldb-9
Listing... Done
lldb-9/unknown,now 1:9~+20191120043105+0f34f1b9318-1~exp1~20191120153646.83
amd64 [installed]

Work-around (untested) is to create the missing symlink "lldb-server-9.0.1"
manually.

Related to bug #35292 but that is quite old and applies to a different version.

-- 
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 44090] Corrupt test cases discovered with improved verifier

2019-11-21 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=44090

Krzysztof Parzyszek  changed:

   What|Removed |Added

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

--- Comment #1 from Krzysztof Parzyszek  ---
Fixed in 824b25fc02 and e8d1578131.

-- 
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 44103] New: labels emitted twice

2019-11-21 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=44103

Bug ID: 44103
   Summary: labels emitted twice
   Product: libraries
   Version: 7.0
  Hardware: All
OS: All
Status: NEW
  Severity: normal
  Priority: P
 Component: MC
  Assignee: unassignedb...@nondot.org
  Reporter: baem...@gmx.de
CC: llvm-bugs@lists.llvm.org

-- 
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 39464] __builtin_ia32_addcarry_u64 produces better code then __builtin_addcll.

2019-11-21 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=39464

Simon Pilgrim  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED
 Fixed By Commit(s)||rG002625113ba8,rG257acbf6ae
   ||e9

--- Comment #5 from Simon Pilgrim  ---
Test coverage was added at rG002625113ba8

Confirmed fixed in rG257acbf6aee9

-- 
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 44102] New: Missed canonicalizations for losslessness checks of signed integer demotions

2019-11-21 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=44102

Bug ID: 44102
   Summary: Missed canonicalizations for losslessness checks of
signed integer demotions
   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

Much like https://bugs.llvm.org/show_bug.cgi?id=44100
we have a missed canonicalization for signed pattern:

Given 

signed short t4(signed short x) {
  x+=1;
  return x;
}
signed short t5(signed short x) {
  x-=1;
  return x;
}

With -fsanitize=implicit-conversion we produce:

  %2 = sext i16 %0 to i32, !dbg !15
  %5 = add nsw i32 %2, 32769, !dbg !15
  %6 = icmp ult i32 %5, 65536, !dbg !15

and 

  %2 = sext i16 %0 to i32, !dbg !22
  %5 = add nsw i32 %2, 32767, !dbg !22
  %6 = icmp ult i32 %5, 65536, !dbg !22

https://godbolt.org/z/eyc6qN

But in these cases we can simply check the original %0:

Name: sext-signed-trunc-check - increment
Pre: C2 == 65536 && C1 == (C2/2)+C3 && C3 > 0 && C3 u<= C2
  %ZZ_IGNOREME = C3
  %conv = sext i16 %x to i32
  %zz = add i32 %conv, C1
  %cmp = icmp ult i32 %zz, C2
=>
  %ZZ_IGNOREME = C3
  %cmp = icmp slt i16 %x, (trunc (C2/2) - trunc (C3))

Name: sext-signed-trunc-check - decrement
Pre: C2 == 65536 && C1 == (C2/2)+C3 && C3 < 0 && C3 > -C2
  %ZZ_IGNOREME = C3
  %conv = sext i16 %x to i32
  %zz = add i32 %conv, C1
  %cmp = icmp ult i32 %zz, C2
=>
  %ZZ_IGNOREME = C3
  %cmp = icmp sge i16 %x, (-(trunc (C2/2)) - (trunc (C3)))


https://rise4fun.com/Alive/GC57

-- 
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 44101] New: PowerPC64: clang crash during compilation of crafty

2019-11-21 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=44101

Bug ID: 44101
   Summary: PowerPC64: clang crash during compilation of crafty
   Product: clang
   Version: 9.0
  Hardware: Other
OS: FreeBSD
Status: NEW
  Severity: enhancement
  Priority: P
 Component: C
  Assignee: unassignedclangb...@nondot.org
  Reporter: pku...@anongoth.pl
CC: blitzrak...@gmail.com, dgre...@apple.com,
erik.pilking...@gmail.com, llvm-bugs@lists.llvm.org,
richard-l...@metafoo.co.uk

Created attachment 22852
  --> https://bugs.llvm.org/attachment.cgi?id=22852&action=edit
patch

Happens during compilation of games/crafty port on FreeBSD/powerpc64-elfv2:
cc -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing  -Wall
-Wno-array-bounds -pipe -O3 \
-mpopcnt -pthread -DHASHSTATS -DTRACE -DBOOKDIR=\"/usr/local/lib/crafty\" 
-DLOGDIR=\"/tmp\"  -DRCDIR=\"~/\"  -DTBDIR=\"/usr/local/lib/crafty/TB\" 
-DPERSDIR=\"/usr/local/lib/crafty/cpf\" -DSKILL -DCPUS=1 -DSYZYGY -DTEST
-DCPUS=4 -DUNIX -c crafty.c
cc: warning: argument unused during compilation: '-mpopcnt'
[-Wunused-command-line-argument]
In file included from :338:
:12:9: warning: 'CPUS' macro redefined [-Wmacro-redefined]
#define CPUS 4
^
:9:9: note: previous definition is here
#define CPUS 1
^
Assertion failed: ((OpInfo.ConstraintType == TargetLowering::C_RegisterClass ||
OpInfo.ConstraintType == TargetLowering::C_Register || OpInfo.ConstraintType ==
TargetLowering::C_Immediate) && "Unknown constraint type!"), function
visitInlineAsm, file
/usr/src/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp, line
8274.
Stack dump:
0.  Program arguments: /usr/bin/cc -cc1 -triple
powerpc64-unknown-freebsd13.0 -emit-obj -disable-free -main-file-name crafty.c
-mrelocation-model pic -pic-level 2 -mthread-model posix -relaxed-aliasing
-masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array
-target-cpu ppc64 -target-feature +secure-plt -mfloat-abi hard
-dwarf-column-info -debugger-tuning=gdb -momit-leaf-frame-pointer
-coverage-notes-file /tmp/usr/ports/games/crafty/work/crafty-25.2_1/crafty.gcno
-resource-dir /usr/lib/clang/9.0.0 -D HASHSTATS -D TRACE -D
BOOKDIR="/usr/local/lib/crafty" -D LOGDIR="/tmp" -D RCDIR="~/" -D
TBDIR="/usr/local/lib/crafty/TB" -D PERSDIR="/usr/local/lib/crafty/cpf" -D
SKILL -D CPUS=1 -D SYZYGY -D TEST -D CPUS=4 -D UNIX -O3 -Wall -Wno-array-bounds
-fdebug-compilation-dir /tmp/usr/ports/games/crafty/work/crafty-25.2_1
-ferror-limit 19 -fmessage-length 106 -pthread -stack-protector 2
-fno-signed-char -fobjc-runtime=gnustep -fdiagnostics-show-option
-fcolor-diagnostics -vectorize-loops -vectorize-slp -faddrsig -o crafty.o -x c
crafty.c 
1.   parser at end of file
2.  Code generation
3.  Running pass 'Function Pass Manager' on module 'crafty.c'.
4.  Running pass 'PowerPC DAG->DAG Pattern Instruction Selection' on
function '@RootMoveList'
#0 0x136f5e50 PrintStackTrace
/usr/src/contrib/llvm/lib/Support/Unix/Signals.inc:533:13
#1 0x136f64cc /usr/src/contrib/llvm/lib/Support/Unix/Signals.inc:593:3
#2 0x136f3790 RunSignalHandlers
/usr/src/contrib/llvm/lib/Support/Signals.cpp:67:5
#3 0x136f6c44 SignalHandler
/usr/src/contrib/llvm/lib/Support/Unix/Signals.inc:375:3
#4 0x0008151d176c handle_signal /usr/src/lib/libthr/thread/thr_sig.c:248:3
cc: error: unable to execute command: Abort trap (core dumped)
cc: error: clang frontend command failed due to signal (use -v to see
invocation)
FreeBSD clang version 9.0.0 (tags/RELEASE_900/final 372316) (based on LLVM
9.0.0)
Target: powerpc64-unknown-freebsd13.0
Thread model: posix
InstalledDir: /usr/bin


Obviously, passing -mpopcnt is a bug in crafty, but the point here is clang's
crash. I've attached the preprocessed souce file and the running script.

-- 
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 44100] New: Missed canonicalizations for losslessness checks of unsigned integer demotions

2019-11-21 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=44100

Bug ID: 44100
   Summary: Missed canonicalizations for losslessness checks of
unsigned integer demotions
   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

Given

unsigned short t0(unsigned short x) {
  x+=1;
  return x;
}
unsigned short t1(unsigned short x) {
  x-=1;
  return x;
}

With -fsanitize=implicit-conversion we produce:

  %3 = add nuw nsw i32 %2, 1, !dbg !15
  %4 = trunc i32 %3 to i16, !dbg !15
  %5 = icmp ult i32 %3, 65536, !dbg !15

and

  %2 = zext i16 %0 to i32, !dbg !22
  %3 = add nsw i32 %2, -1, !dbg !22
  %4 = trunc i32 %3 to i16, !dbg !22
  %5 = icmp ult i32 %3, 65536, !dbg !22

https://godbolt.org/z/Us33sA

But in these cases we can simply check the original %2:

Name: unsigned truncation check - increment
Pre: C2 u>= C1
  %add = add nuw i32 %conv, C1 ; has extra uses
  %cmp = icmp ult i32 %add, C2 ; is truncation NUW?
=>
  %cmp = icmp ult i32 %conv, (C2-C1)

Name: unsigned truncation check - decrement
Pre: C1 <= 0 ; C1 is non-positive
  %conv = zext i16 %x to i32
  %add = add i32 %conv, C1 ; has extra uses
  %cmp = icmp ult i32 %add, 65536 ; is truncation NUW?
=>
  %cmp = icmp uge i32 %conv, -C1

https://rise4fun.com/Alive/x35G

-- 
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 18118 in oss-fuzz: llvm:llvm-opt-fuzzer--x86_64-indvars: Timeout in llvm-opt-fuzzer--x86_64-indvars

2019-11-21 Thread ClusterFuzz-External via monorail via llvm-bugs

Updates:
Status: WontFix

Comment #3 on issue 18118 by ClusterFuzz-External:  
llvm:llvm-opt-fuzzer--x86_64-indvars: Timeout in  
llvm-opt-fuzzer--x86_64-indvars

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

ClusterFuzz testcase 5652023936024576 is flaky and no longer crashes, so  
closing issue.


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