inline char Check(const char& v) {
return v ? 1 : 0;
}
__attribute((noinline))
char foo(char *X) {
return Check(X[0]) | Check(X[1]) | Check(X[2]);
}
static const int kPageSize = 4096;
int main() {
// poor man's electric fence:
// allocate two pages and lock the second one.
char *mem = (char*)mmap(0, kPageSize * 2, PROT_READ | PROT_WRITE,
MAP_PRIVATE|MAP_ANON, 0, 0);
assert(mem != (char*)-1);
mprotect(mem + kPageSize, kPageSize, PROT_NONE);
fprintf(stderr, "mem = %p\n", mem);
char *X = mem + kPageSize - 3;
fprintf(stderr, "X = %p\n", X);
// We can access X[0], X[1], X[2], but not X[3].
char res = foo(X);
fprintf(stderr, "PASSED %d\n", res);
}
% clang++ t.cc -O2 ; ./a.out
mem = 0x7f1313ca0000
X = 0x7f1313ca0ffd
Segmentation fault
00000000004006b0 <_Z3fooPc>:
4006b0: 8b 07 mov (%rdi),%eax <<<<<<<<<<<<<<<
4006b2: 89 c1 mov %eax,%ecx
4006b4: c1 e9 08 shr $0x8,%ecx
4006b7: 09 c1 or %eax,%ecx
4006b9: c1 e8 10 shr $0x10,%eax
4006bc: 08 c8 or %cl,%al
4006be: 0f 95 c0 setne %al
4006c1: 0f b6 c0 movzbl %al,%eax
4006c4: c3 retq
4006c5: 66 66 2e 0f 1f 84 00 nopw %cs:0x0(%rax,%rax,1)
4006cc: 00 00 00 00
The same test passes at O1.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
From bugzilla-daemon at llvm.org Mon Nov 14 18:21:23 2011
From: bugzilla-daemon at llvm.org (bugzilla-daemon at llvm.org)
Date: Tue, 15 Nov 2011 00:21:23 +0000
Subject: [LLVMbugs] [Bug 11377] New: Unhelpful error message on template typo
Message-ID:
http://llvm.org/bugs/show_bug.cgi?id=11377
Bug #: 11377
Summary: Unhelpful error message on template typo
Product: clang
Version: trunk
Platform: Macintosh
OS/Version: MacOS X
Status: NEW
Severity: enhancement
Priority: P
Component: C++
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: mclow at qualcomm.com
CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
Classification: Unclassified
Created attachment 7611
--> http://llvm.org/bugs/attachment.cgi?id=7611
program showing error.
When compiling the attached file, I get the following mystifying error message:
$ clang++ huh2.cpp
huh2.cpp:23:2: error: no matching function for call to 'test_sequence'
test_sequence ( v, lessThan10, v.begin () + 5 );
^~~~~~~~~~~~~
huh2.cpp:7:6: note: candidate template ignored: substitution failure [with
Container = std::vector >, Predicate = bool
(*)(int)]
void test_sequence ( Container &v, Predicate comp, typename ...
^
1 error generated.
I passed three parameters to the template - not two, like the compiler is
claiming. What's up with that?
The answer, btw, is that in the template declaration, I misspelled "iterator"
as "interator". If clang would tell me that std::vector doesn't have a type
named "interator", I would have gone right to the problem.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
From bugzilla-daemon at llvm.org Mon Nov 14 18:34:21 2011
From: bugzilla-daemon at llvm.org (bugzilla-daemon at llvm.org)
Date: Tue, 15 Nov 2011 00:34:21 +0000
Subject: [LLVMbugs] [Bug 11378] New: Assertion failed: (isMetadata() &&
"Wrong MachineOperand accessor")
Message-ID:
http://llvm.org/bugs/show_bug.cgi?id=11378
Bug #: 11378
Summary: Assertion failed: (isMetadata() && "Wrong
MachineOperand accessor")
Product: libraries
Version: trunk
Platform: PC
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P
Component: Common Code Generator Code
AssignedTo: unassignedbugs at nondot.org
ReportedBy: dpatel at apple.com
CC: llvmbugs at cs.uiuc.edu
Classification: Unclassified
$llc -O0 /tmp/cplus-dem.ll -o /tmp/cplus-dem.s
Assertion failed: (isMetadata() && "Wrong MachineOperand accessor"), function
getMetadata, file /Users/Work/llvm/include/llvm/CodeGen/MachineOperand.h, line
416.
0 llc 0x0000000100ec8055 PrintStackTrace(void*) + 53
1 llc 0x0000000100ec870b SignalHandler(int) + 379
2 libSystem.B.dylib 0x00007fff8a58f1ba _sigtramp + 26
3 libSystem.B.dylib 0x000000010324d2b8 _sigtramp + 2026627352
4 llc 0x0000000100ec83db raise + 27
5 llc 0x0000000100ec849a abort + 26
6 llc 0x0000000100ec8474 __assert_rtn + 132
7 llc 0x0000000100160989 llvm::MachineOperand::getMetadata()
const + 105
8 llc 0x00000001009c92b4 (anonymous
namespace)::RAFast::spillVirtReg(llvm::ilist_iterator,
llvm::DenseMapIterator, llvm::DenseMapInfo<(anonymous
namespace)::RAFast::LiveReg>, false>) + 1204
9 llc 0x00000001009c6cf1 (anonymous
namespace)::RAFast::spillAll(llvm::MachineInstr*) + 273
10 llc 0x00000001009c48e3 (anonymous
namespace)::RAFast::AllocateBasicBlock() + 8067
11 llc 0x00000001009c27f9 (anonymous
namespace)::RAFast::runOnMachineFunction(llvm::MachineFunction&) + 489
12 llc 0x0000000100949080
llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 112
13 llc 0x0000000100e26071
llvm::FPPassManager::runOnFunction(llvm::Function&) + 513
14 llc 0x0000000100e26403
llvm::FPPassManager::runOnModule(llvm::Module&) + 131
15 llc 0x0000000100e266a2
llvm::MPPassManager::runOnModule(llvm::Module&) + 530
16 llc 0x0000000100e26ebb
llvm::PassManagerImpl::run(llvm::Module&) + 187
17 llc 0x0000000100e2738d llvm::PassManager::run(llvm::Module&) +
29
18 llc 0x0000000100002207 main + 4231
19 llc 0x0000000100001134 start + 52
Stack dump:
0. Program arguments: ./Debug+Asserts/bin/llc -O0 /tmp/cplus-dem.ll -o
/tmp/cplus-dem.s
1. Running pass 'Function Pass Manager' on module '/tmp/cplus-dem.ll'.
2. Running pass 'Fast Register Allocator' on function '@do_type'
Illegal instruction
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
From bugzilla-daemon at llvm.org Mon Nov 14 19:00:46 2011
From: bugzilla-daemon at llvm.org (bugzilla-daemon at llvm.org)
Date: Tue, 15 Nov 2011 01:00:46 +0000
Subject: [LLVMbugs] [Bug 11379] New: llvm.org/pubs needs a maintainer
Message-ID:
http://llvm.org/bugs/show_bug.cgi?id=11379
Bug #: 11379
Summary: llvm.org/pubs needs a maintainer
Product: Website
Version: unspecified
Platform: PC
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P
Component: General Website
AssignedTo: unassignedbugs at nondot.org
ReportedBy: clattner at apple.com
CC: llvmbugs at cs.uiuc.edu
Classification: Unclassified
There are no papers listed for 2011, this can't be so. It would be great for
someone to take over responsibility for maintaining/updating this page.
-Chris
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
From bugzilla-daemon at llvm.org Mon Nov 14 23:55:59 2011
From: bugzilla-daemon at llvm.org (bugzilla-daemon at llvm.org)
Date: Tue, 15 Nov 2011 05:55:59 +0000
Subject: [LLVMbugs] [Bug 11370] AVX2 vpxor instruction generated with AVX1
target
In-Reply-To:
References:
Message-ID:
http://llvm.org/bugs/show_bug.cgi?id=11370
Craig Topper changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
--- Comment #1 from Craig Topper 2011-11-14 23:55:59 CST ---
Fixed in r144622.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
From bugzilla-daemon at llvm.org Tue Nov 15 00:01:23 2011
From: bugzilla-daemon at llvm.org (bugzilla-daemon at llvm.org)
Date: Tue, 15 Nov 2011 06:01:23 +0000
Subject: [LLVMbugs] [Bug 11370] AVX2 vpxor instruction generated with AVX1
target
In-Reply-To:
References:
Message-ID:
http://llvm.org/bugs/show_bug.cgi?id=11370
Craig Topper changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|FIXED |
--- Comment #2 from Craig Topper 2011-11-15 00:01:23 CST ---
Or maybe it isn't.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
From bugzilla-daemon at llvm.org Tue Nov 15 00:39:20 2011
From: bugzilla-daemon at llvm.org (bugzilla-daemon at llvm.org)
Date: Tue, 15 Nov 2011 06:39:20 +0000
Subject: [LLVMbugs] [Bug 11370] AVX2 vpxor instruction generated with AVX1
target
In-Reply-To:
References:
Message-ID:
http://llvm.org/bugs/show_bug.cgi?id=11370
Craig Topper changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|REOPENED |RESOLVED
Resolution| |FIXED
--- Comment #3 from Craig Topper