<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - Request to hook up -fno-builtin-aligned_alloc"
href="https://bugs.llvm.org/show_bug.cgi?id=45655">45655</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Request to hook up -fno-builtin-aligned_alloc
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>C11
</td>
</tr>
<tr>
<th>Assignee</th>
<td>uday@polymagelabs.com
</td>
</tr>
<tr>
<th>Reporter</th>
<td>chang-sun.lin.jr@intel.com
</td>
</tr>
<tr>
<th>CC</th>
<td>blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>For users that have a different aligned_alloc implementation such as jemalloc:
<a href="http://jemalloc.net/">http://jemalloc.net/</a>
it might be desirable to turn off TLI recognition of aligned_alloc (commit
D76970) without having to turn off all builtins with -fno-builtin or
-ffreestanding. -fno-builtin-aligned_alloc doesn't look like it's recognized by
the front end (and doesn't result in a nobuiltin attribute on the call).
As an example of a difference, the above jemalloc library is strict POSIX and
will set errno if a non-power-of-2 alignment is given. When the code below is
compiled with clang -O2 and jemalloc, the printf will print "(nil) 0" because
jemalloc will produce NULL, but InstCombine assumes the call will succeed and
replaces errno with 0. Having a way to turn off recognition just for this
function, would be very helpful to fix the inconsistency.
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
int main() {
void *p;
errno = 0;
p = (int *)aligned_alloc(0x81,1);
printf("%p %d\n", p, errno);
return 0;
}</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>