<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 --- - Regression in Clang-4.0.0's optimizer"
href="https://llvm.org/bugs/show_bug.cgi?id=30375">30375</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Regression in Clang-4.0.0's optimizer
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</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>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>ishiura-compiler@ml.kwansei.ac.jp
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>We compiled a program (A.c) by clang-4.0.0 and clang-3.6.2 with -O3 option.
clang-3.6.2 performed better optimization than clang-4.0.0.
(A.c)
int x0 = 1;
int main ()
{
int x1 = 1;
int t0 = 2 / ((1 / x0) && x1);
if (t0 != 2) __builtin_abort();
return 0;
}
+-------------------------------+--------------------------------+
|clang-4.0.0.s |clang-3.6.2.s |
|(clang-4.0.0 A.c -O3 -S) |(clang-3.6.2 A.c -O3 -S) |
+-------------------------------+--------------------------------+
|main: |main: |
| .cfi_startproc | .cfi_startproc |
|# BB#0: |# BB#0: |
| movl x0(%rip), %eax | |
| leal 1(%rax), %ecx | |
| cmpl $3, %ecx | |
| sbbb %cl, %cl | |
| testl %eax, %eax | |
| setne %al | |
| andb %cl, %al | |
| movzbl %al, %ecx | |
| movl $2, %eax | |
| xorl %edx, %edx | |
| divl %ecx | |
| cmpl $2, %eax | |
| jne .LBB0_2 | |
|# BB#1: | |
| xorl %eax, %eax | xorl %eax, %eax |
| retq | retq |
|.LBB0_2: | |
| pushq %rax | |
|.Ltmp0: |.Ltmp0: |
| .cfi_def_cfa_offset 16 | .size main, .Ltmp0-...|
| callq abort | |
|.Lfunc_end0: | |
| .size main, .Lfunc...| |
| .cfi_endproc | .cfi_endproc |
| | |
| .type x0,@object | .type x0,@object |
| .data | .data |
| .globl x0 | .globl x0 |
| .p2align 2 | .align 4 |
|x0: |x0: |
| .long 1 | .long 1 |
| .size x0, 4 | .size x0, 4 |
| | |
| | |
| .ident "clang versi...| .ident "Ubuntu clang...|
| .section ".no...| .section ".not...|
+-------------------------------+--------------------------------+
using built-in specs.
clang version 4.0.0 (<a href="https://github.com/llvm-mirror/clang.git">https://github.com/llvm-mirror/clang.git</a>
359c45534e46a8ef263db1a8b855740bbeca6998)
(<a href="https://github.com/llvm-mirror/llvm.git">https://github.com/llvm-mirror/llvm.git</a>
990fea5450379639c1e21f456d44a9e95eabaff3)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.2.1
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.2.1
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.2.1
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
using built-in specs.
Ubuntu clang version 3.6.2-1 (tags/RELEASE_362/final) (based on LLVM 3.6.2)
Target: x86_64-pc-linux-gnu
Thread model: posix
Found candidate GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/5.2.1
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.7
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.7.4
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8.5
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9.3
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/5.2.1
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.2.1
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.2.1
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/5.2.1
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
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>