<html>
<head>
<base href="https://llvm.org/bugs/" />
</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 --- - -fsanitize=signed-integer-overflow breaks under optimization" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D23624&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=Id5w7YfU1hKk7sjB3R6orVj-e72DY8L5jUSaVYlVa3M&s=Wrh3gOTkpMtXk_WPqFtvToe0Wiy9p-QqG47BzBALey8&e=">23624</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>-fsanitize=signed-integer-overflow breaks under optimization
</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>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>vonosmas@gmail.com
</td>
</tr>
<tr>
<th>Reporter</th>
<td>vonosmas@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu, richard-llvm@metafoo.co.uk
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>$ cat tmp/ubsan-overflow/a.cc
int one();
int main() {
int x = one(); // 1
int y = x - 0; // 1
return x - y;
}
$ cat tmp/ubsan-overflow/b.cc
int one() { return 1; }
$ ./bin/clang++ -fsanitize=signed-integer-overflow -O1 tmp/ubsan-overflow/*.cc
&& ./a.out
tmp/ubsan-overflow/a.cc:6:12: runtime error: signed integer overflow: 1 - 0
cannot be represented in type 'int'
Seriously?
I will investigate this issue, reporting here to track progress and share the
link.</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>