This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/43529] G++ doesn't optimize away empty loop when index is a double
- From: "changpeng dot fang at amd dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Jun 2010 23:29:39 -0000
- Subject: [Bug tree-optimization/43529] G++ doesn't optimize away empty loop when index is a double
- References: <bug-43529-18958@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from changpeng dot fang at amd dot com 2010-06-04 23:29 -------
(In reply to comment #2)
> Interesting! What's the difference between 17 and 18?
> ------------
> int main()
> {
> double i;
> for(i=0; i<18; i+=1); /* gcc -O3, empty loop not removed */
> }
The funny thing occurs in gcc 4, not gcc 6:
.file "empty.c"
.text
.p2align 4,,15
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
xorl %eax, %eax
.p2align 4,,10
.p2align 3
.L2:
addl $1, %eax
cmpl $18, %eax
jne .L2
rep
ret
.cfi_endproc
.LFE0:
.size main, .-main
.ident "GCC: (Ubuntu 4.4.1-4ubuntu9) 4.4.1"
.section .note.GNU-stack,"",@progbits
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43529