This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/81388] New: Incorrect code generation with -O1 -fno-strict-overflow
- From: "terrelln at fb dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 11 Jul 2017 02:55:39 +0000
- Subject: [Bug tree-optimization/81388] New: Incorrect code generation with -O1 -fno-strict-overflow
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81388
Bug ID: 81388
Summary: Incorrect code generation with -O1
-fno-strict-overflow
Product: gcc
Version: 7.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: terrelln at fb dot com
Target Milestone: ---
gcc 7.1 on x86 produces incorrect output for correct code. gcc 6.3 produced
correct assembly. See https://godbolt.org/g/mLyxGz or below for the code and
generated assembly.
code:
.----
// -O1 -fno-strict-overflow
void bar();
void foo(char *dst)
{
char *const end = dst;
do {
bar();
dst += 2;
} while (dst < end);
}
`----
assembly:
.----
foo(char*):
push rbx
movabs rbx, -9223372036854775808
.L2:
call bar()
sub rbx, 1
jne .L2
pop rbx
ret
`----