[llvm-bugs] [Bug 31304] New: Wrongly detected Called C++ object pointer is null for QModelIndex

2016-12-07 Thread via llvm-bugs
https://llvm.org/bugs/show_bug.cgi?id=31304

Bug ID: 31304
   Summary: Wrongly detected Called C++ object pointer is null for
QModelIndex
   Product: clang
   Version: 3.9
  Hardware: PC
OS: Linux
Status: NEW
  Severity: normal
  Priority: P
 Component: Static Analyzer
  Assignee: kreme...@apple.com
  Reporter: xiangzha...@gmail.com
CC: llvm-bugs@lists.llvm.org
Classification: Unclassified

Hi llvm developers,

Clang Static Analyzer consider: 

QModelIndex firstColIndex = index.model()->index(index.row(), 0,
index.parent());
might Called C++ object pointer is null

*BUT* let's see the code about line 14:

Node* Node::createNodeForOriginalIndex( const QModelIndex& index ) 
{   
if ( !index.isValid() && isPlace() ) {  
return this;
}   

Q_ASSERT( index.isValid() );

// all the node mapping is done on the first col, so make sure we use   
// an index on the first col
//  
// A valid index belongs to a model, and has non-negative row and
column numbers
// so index.model() is NOT nullptr if index.isValid()   
---> QModelIndex firstColIndex = index.model()->index(index.row(), 0,
index.parent());
Node* node = findNodeForOriginalIndex( firstColIndex ); 
if ( !node ) {  
Node* parentNode = createNodeForOriginalIndex(
firstColIndex.parent() );
node = parentNode->getChildNode( firstColIndex );   
}   

return node;
}

It might be a wrong detect!

Regards,
Leslie Zhai

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


[llvm-bugs] [Bug 31305] New: Incorrect code generated for llvm.masked.store <2 x i1> with a variable mask

2016-12-07 Thread via llvm-bugs
https://llvm.org/bugs/show_bug.cgi?id=31305

Bug ID: 31305
   Summary: Incorrect code generated for llvm.masked.store <2 x
i1> with a variable mask
   Product: libraries
   Version: trunk
  Hardware: PC
OS: Windows NT
Status: NEW
  Severity: normal
  Priority: P
 Component: Backend: X86
  Assignee: unassignedb...@nondot.org
  Reporter: zvi.racko...@intel.com
CC: llvm-bugs@lists.llvm.org
Classification: Unclassified

define void @unmasked(<2 x i1> %x, <2 x i1>* %ptr) nounwind {
   store <2 x i1> %x, <2 x i1>* %ptr
   ret void
 }

 define void @masked_const(<2 x i1> %x, <2 x i1>* %ptr) nounwind {
   call void @llvm.masked.store.v2i1.p0v2i1(<2 x i1> %x, <2 x i1>* %ptr, i32 0,
<2 x i1> )
   ret void
 }


For both functions above we generate:
llc -mcpu=skx

  vpsllq  $63, %xmm0, %xmm0
  vptestmq%xmm0, %xmm0, %k0
  kmovb   %k0, (%rdi)
  retq

But in the case of a variable mask:

 define void @masked_var(<2 x i1> %x, <2 x i1>* %ptr) nounwind {
   call void @llvm.masked.store.v2i1.p0v2i1(<2 x i1> %x, <2 x i1>* %ptr, i32 0,
<2 x i1> %x)
   ret void
 }

the generated code stores each vector element in a distinct byte:
vpsllq  $63, %xmm0, %xmm0
vptestmq%xmm0, %xmm0, %k0
kshiftlw$15, %k0, %k1
kshiftrw$15, %k1, %k1
kmovw   %k1, %eax
andl$1, %eax
testb   %al, %al
je  .LBB2_2
# BB#1: # %cond.store
kmovb   %k1, (%rdi)
.LBB2_2:# %else
kshiftlw$14, %k0, %k0
kshiftrw$15, %k0, %k0
kmovw   %k0, %eax
andl$1, %eax
testb   %al, %al
je  .LBB2_4
# BB#3: # %cond.store1
kmovb   %k0, 1(%rdi)
.LBB2_4:# %else2
retq

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


[llvm-bugs] [Bug 20796] GCC's -Wstrict-prototypes warning not implemented in Clang

2016-12-07 Thread via llvm-bugs
https://llvm.org/bugs/show_bug.cgi?id=20796

arpha...@gmail.com changed:

   What|Removed |Added

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

--- Comment #12 from arpha...@gmail.com ---
I committed the fix in r288896.

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


[llvm-bugs] [Bug 31256] Assertion failed: SrcReg and DstReg cannot be the same

2016-12-07 Thread via llvm-bugs
https://llvm.org/bugs/show_bug.cgi?id=31256

Dylan McKay  changed:

   What|Removed |Added

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

--- Comment #8 from Dylan McKay  ---
Fixed in r288897

Thanks for all the suggestions!

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


[llvm-bugs] [Bug 31296] Incorrect shuffles produced with XOP

2016-12-07 Thread via llvm-bugs
https://llvm.org/bugs/show_bug.cgi?id=31296

Simon Pilgrim  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Simon Pilgrim  ---
Fixed in rL288898

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


[llvm-bugs] [Bug 26131] clang-format needs more than 10GB virtual memory to format 700 Byte file

2016-12-07 Thread via llvm-bugs
https://llvm.org/bugs/show_bug.cgi?id=26131

Daniel Jasper  changed:

   What|Removed |Added

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

--- Comment #1 from Daniel Jasper  ---
This specific pattern of code should be fixed. Re-open if you find others.

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


[llvm-bugs] [Bug 31226] Regression crash for alpha.core.CastSize and cplusplus.NewDelete

2016-12-07 Thread via llvm-bugs
https://llvm.org/bugs/show_bug.cgi?id=31226

Artem Dergachev  changed:

   What|Removed |Added

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

--- Comment #5 from Artem Dergachev  ---
Thanks! Pushed the fix in r288914.

I disabled the checker earlier, and also added the target triple to the run
line of the test, because otherwise it doesn't fail before the patch.

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


[llvm-bugs] [Bug 31220] broken -Wweak-vtables for clang-cl

2016-12-07 Thread via llvm-bugs
https://llvm.org/bugs/show_bug.cgi?id=31220

Reid Kleckner  changed:

   What|Removed |Added

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

--- Comment #3 from Reid Kleckner  ---
Disabled on Windows in r288850.

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


[llvm-bugs] [Bug 31306] New: [AVX-512] Compiler crash: Cannot select: t41: v8i64 = X86ISD::SUBV_BROADCAST

2016-12-07 Thread via llvm-bugs
https://llvm.org/bugs/show_bug.cgi?id=31306

Bug ID: 31306
   Summary: [AVX-512] Compiler crash: Cannot select: t41: v8i64 =
X86ISD::SUBV_BROADCAST
   Product: new-bugs
   Version: trunk
  Hardware: PC
OS: All
Status: NEW
  Severity: normal
  Priority: P
 Component: new bugs
  Assignee: unassignedb...@nondot.org
  Reporter: babo...@gmail.com
CC: llvm-bugs@lists.llvm.org, vsevolod.livins...@frtk.ru
Classification: Unclassified

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

This is recently introduced bug in trunk. It's reproduced with skx and knl
targets.

> clang++ -c -O2 -march=skx subv_broadcast.cpp
fatal error: error in backend: Cannot select: t41: v8i64 =
X86ISD::SUBV_BROADCAST t40
  t40: v4i64,ch = load t0, t49, undef:i64
t49: i64 = X86ISD::Wrapper TargetConstantPool:i64<<4 x i64> > 0
  t48: i64 = TargetConstantPool<<4 x i64> > 0
t3: i64 = undef
In function: _Z1ov
clang-4.0: error: clang frontend command failed with exit code 70 (use -v to
see invocation)
clang version 4.0.0 (trunk 288907)
Target: x86_64-unknown-linux-gnu

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


[llvm-bugs] [Bug 31307] New: "PHI nodes not grouped at top of basic block" when using coroutine builtins

2016-12-07 Thread via llvm-bugs
https://llvm.org/bugs/show_bug.cgi?id=31307

Bug ID: 31307
   Summary: "PHI nodes not grouped at top of basic block" when
using coroutine builtins
   Product: clang
   Version: unspecified
  Hardware: PC
OS: Linux
Status: NEW
  Severity: normal
  Priority: P
 Component: -New Bugs
  Assignee: unassignedclangb...@nondot.org
  Reporter: georgios.psaropou...@epfl.ch
CC: llvm-bugs@lists.llvm.org
Classification: Unclassified

Created attachment 17733
  --> https://llvm.org/bugs/attachment.cgi?id=17733&action=edit
crash backtrace, preprocessed source, and associated run script

Front-end fails to generate sane IR.

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


[llvm-bugs] [Bug 31308] New: po sometimes prints blank instead of object

2016-12-07 Thread via llvm-bugs
https://llvm.org/bugs/show_bug.cgi?id=31308

Bug ID: 31308
   Summary: po sometimes prints blank instead of object
   Product: lldb
   Version: 3.6
  Hardware: Macintosh
OS: MacOS X
Status: NEW
  Severity: normal
  Priority: P
 Component: All Bugs
  Assignee: lldb-...@lists.llvm.org
  Reporter: m...@xmission.com
CC: llvm-bugs@lists.llvm.org
Classification: Unclassified

My debug environment is Xcode 8.1 stopped at a breakpoint while debugging an
iOS application (usually 9.3.5 or 10.1) written in Objective C.  Sometimes when
I use po to print an object, all it prints is a blank line. Printing with
different syntax will sometimes make it work.  In this particular example the
object was a property of the argument to a simple method:

- (void)handleDataModelChange: (NSNotification *)nt
{
NSSet *updatedObjects = [[nt userInfo] objectForKey: NSUpdatedObjectsKey];
...
}

The breakpoint was set near the end of the method.  Here is the output of some
po commands I tried.  The last po command prints the object as it should be
printed by the first two po commands.  Instead they just give blank lines.

(lldb) po nt.object

(lldb) po [nt object]

(lldb) po [nt.object class]
NSManagedObjectContext

(lldb) po (NSManagedObject *)nt.object
: defaultMainQueueContext



[lldb --version prints lldb-360.1.65]

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


[llvm-bugs] [Bug 31280] .section ... @progbits not accepted on arm/thumb

2016-12-07 Thread via llvm-bugs
https://llvm.org/bugs/show_bug.cgi?id=31280

Evgeniy Stepanov  changed:

   What|Removed |Added

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

--- Comment #3 from Evgeniy Stepanov  ---
Yes. GAS accepts this directive (with @), silently ignoring the @progbits part
as a comment; llvm-mc treats it as an error.

We can easily switch to %progbits, and I think llvm-mc behaviour is preferable
(a section directive should not end with a comma). Feel free to re-open this
bug if you disagree.

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


[llvm-bugs] [Bug 31299] lld prints basename of source file name in error messages

2016-12-07 Thread via llvm-bugs
https://llvm.org/bugs/show_bug.cgi?id=31299

Rui Ueyama  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||r...@google.com
 Resolution|--- |FIXED

--- Comment #2 from Rui Ueyama  ---
Fixed in r288966.

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


[llvm-bugs] [Bug 31309] New: Failure to combine scalar load+zext into vector load+zext

2016-12-07 Thread via llvm-bugs
https://llvm.org/bugs/show_bug.cgi?id=31309

Bug ID: 31309
   Summary: Failure to combine scalar load+zext into vector
load+zext
   Product: libraries
   Version: trunk
  Hardware: PC
OS: Windows NT
Status: NEW
  Severity: normal
  Priority: P
 Component: Backend: X86
  Assignee: unassignedb...@nondot.org
  Reporter: llvm-...@redking.me.uk
CC: llvm-bugs@lists.llvm.org
Classification: Unclassified

define <4 x i32> @load_i32_zext_i128_v4i32(i32* %in) {
  %1 = load i32, i32* %in
  %2 = zext i32 %1 to i128
  %3 = bitcast i128 %2 to <4 x i32>
  ret <4 x i32> %3
}

Current output:

load_i32_zext_i128_v4i32:
movl(%rdi), %eax
vmovq   %rax, %xmm0
retq

It would be better if we managed:

load_i32_zext_i128_v4i32:
vmovd(%rdi), %xmm0
retq

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


[llvm-bugs] [Bug 31310] New: SROA fails to propagate debug location annotation

2016-12-07 Thread via llvm-bugs
https://llvm.org/bugs/show_bug.cgi?id=31310

Bug ID: 31310
   Summary: SROA fails to propagate debug location annotation
   Product: libraries
   Version: trunk
  Hardware: PC
OS: All
Status: NEW
  Severity: normal
  Priority: P
 Component: Scalar Optimizations
  Assignee: unassignedb...@nondot.org
  Reporter: ane...@apple.com
CC: llvm-bugs@lists.llvm.org
Classification: Unclassified

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

The testcase s.ll demonstrates the problem.  The phis generated by SROA carry
no debug location MD:

/org/llvm/build$ grep phi s.ll
/org/llvm/build$ ./bin/opt -sroa s.ll -S | grep phi
  %a.addr.0 = phi i32 [ %a, %entry ], [ %0, %for.inc ]
  %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.inc ]

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


[llvm-bugs] [Bug 31311] New: undef doesn't work well with pch files

2016-12-07 Thread via llvm-bugs
https://llvm.org/bugs/show_bug.cgi?id=31311

Bug ID: 31311
   Summary: undef doesn't work well with pch files
   Product: clang
   Version: unspecified
  Hardware: PC
OS: All
Status: NEW
  Severity: normal
  Priority: P
 Component: Frontend
  Assignee: unassignedclangb...@nondot.org
  Reporter: nicolaswe...@gmx.de
CC: llvm-bugs@lists.llvm.org
Classification: Unclassified

$ cat foo2.h
#undef ARG
$ cat foo2.c
const int i = ARG;
$ ./bin/clang -cc1 -DARG -include foo2.h foo2.c -emit-obj -o a.o
foo2.c:1:15: error: use of undeclared identifier 'ARG'
const int i = ARG;
  ^
1 error generated.
$ ./bin/clang -cc1 -emit-pch -o foo2.h.pch foo2.h
$ ./bin/clang -cc1 -DARG -include-pch foo2.h.pch foo2.c -emit-obj -o a.o


This should err when going through a pch as well.


Similar but slightly more difficult to fix: The same with a builtin macro:

$ cat foo2.h
#undef __FILE__
$ cat foo2.c
const char s[] = __FILE__;
s$ bin/clang -cc1 -include foo2.h foo2.c -emit-obj -o a.o
In file included from :1:
./foo2.h:1:8: warning: undefining builtin macro
#undef __FILE__
   ^
foo2.c:1:18: error: use of undeclared identifier '__FILE__'
const char s[] = __FILE__;
 ^
1 warning and 1 error generated.

$ ./bin/clang -cc1 -emit-pch -o foo2.h.pch foo2.h
foo2.h:1:8: warning: undefining builtin macro
#undef __FILE__
   ^
1 warning generated.
$ ./bin/clang -cc1 -include-pch foo2.h.pch foo2.c -emit-obj -o a.o


This too should error out but doesn't.


Problems, partial list:

1. shouldIgnoreMacro() in ASTWriter.cpp stops at isBuiltinMacro(), but that's
true for undefs of builtin macros as well. It probably should have `if
(MD->getKind() != MacroDirective::MD_Define) return false;` as its first line.

2. ASTWriter only writes out identifiers with a ref (see AddIdentifierRef).
ASTWriter::WritePreprocessor() only calls this for macros with a MacroInfo, and
macros that are only #undef'd but never defined (at pch creation time) get
dropped.

3. It seems that pch files get loaded before commandline -D flags are
processed, and Preprocessor::HandleUndefDirective() ignores undefs for macros
without a MacroInfo (which makes sense) (not really sure if the ordering here
is like I say, but if it weren't then `#define FOO` in the .h and -DFOO on the
command passing -include-pch would behave differently)

(Spin-off from bug 29119)

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


[llvm-bugs] [Bug 31312] New: clang talks about C++1z in diagnostic for C file

2016-12-07 Thread via llvm-bugs
https://llvm.org/bugs/show_bug.cgi?id=31312

Bug ID: 31312
   Summary: clang talks about C++1z in diagnostic for C file
   Product: clang
   Version: unspecified
  Hardware: PC
OS: All
Status: NEW
  Severity: normal
  Priority: P
 Component: C++14
  Assignee: unassignedclangb...@nondot.org
  Reporter: nicolaswe...@gmx.de
CC: llvm-bugs@lists.llvm.org
Classification: Unclassified

Nicos-MBP:llvm-build thakis$ cat asdf.c
_Static_assert(1);
Nicos-MBP:llvm-build thakis$ bin/clang -c asdf.c
asdf.c:1:17: warning: static_assert with no message is a C++1z extension
[-Wc++1z-extensions]
_Static_assert(1);
^
, ""
1 warning generated.

a) This should say _Static_assert, not static_assert
b) It shouldn't talk about C++1z in C mode.

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


[llvm-bugs] [Bug 30323] Header "limits": const int max_digits10 calculation won't compile if "int" is 16 bit long

2016-12-07 Thread via llvm-bugs
https://llvm.org/bugs/show_bug.cgi?id=30323

Eric Fiselier  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from Eric Fiselier  ---
Fixed in r289029.

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