<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 - [OPENMP] positive loop step not recognized as such"
href="https://bugs.llvm.org/show_bug.cgi?id=33062">33062</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[OPENMP] positive loop step not recognized as such
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Keywords</th>
<td>compile-fail
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Frontend
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>hstong@ca.ibm.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>The increment expression in the code below increases the loop counter by 1.
Clang generates diagnostics which claim otherwise.
### SOURCE (<stdin>):
int main(void) {
#pragma omp for
for (unsigned i = 0; i < 10; i -= 0u - 1u) { }
}
### COMPILER INVOCATION:
clang -fsyntax-only -x c -std=c99 -fopenmp -
### OUTPUT:
<stdin>:3:40: error: increment expression must cause 'i' to increase on each
iteration of OpenMP for loop
for (unsigned i = 0; i < 10; i -= 0u - 1u) { }
~~~^~~~
<stdin>:3:26: note: loop step is expected to be positive due to this condition
for (unsigned i = 0; i < 10; i -= 0u - 1u) { }
~~^~~~
1 error generated.
### EXPECTED OUTPUT:
(Compiles successfully).
### COMPILER VERSION INFO (clang -v):
clang version 5.0.0 (<a href="https://github.com/llvm-mirror/clang.git">https://github.com/llvm-mirror/clang.git</a>
600a9e6e11f067dbb921c742b6fb676e0ac045bd)
(<a href="https://github.com/llvm-mirror/llvm.git">https://github.com/llvm-mirror/llvm.git</a>
f0a3e25eca945f00368b68c9aa006b95b92fafaf)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/wandbox/clang-head/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.0.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
Candidate multilib: .;@m64
Selected multilib: .;@m64</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>