This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/27007] Missed optimization of comparison with 'limited range'
- From: "tkoenig at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Dec 2008 10:51:45 -0000
- Subject: [Bug c/27007] Missed optimization of comparison with 'limited range'
- References: <bug-27007-4397@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #9 from tkoenig at gcc dot gnu dot org 2008-12-06 10:51 -------
This is now fixed:
$ cat foo.c
int foo(unsigned char x)
{
return (x+1) != 0;
}
$ gcc -O3 -fdump-tree-optimized -S foo.c
$ cat foo.s
.file "foo.c"
.text
.p2align 4,,15
.globl foo
.type foo, @function
foo:
pushl %ebp
movl $1, %eax
movl %esp, %ebp
popl %ebp
ret
.size foo, .-foo
.ident "GCC: (GNU) 4.4.0 20081122 (experimental)"
.section .note.GNU-stack,"",@progbits
$ cat foo.c.123t.optimized
;; Function foo (foo)
Analyzing Edge Insertions.
foo (unsigned char x)
{
<bb 2>:
return 1;
}
I'm not sure how to write a test case for this.
Should it just be closed?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27007