This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/24333] New: missed div optimizations?
- From: "pluto at agmk dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Oct 2005 15:39:10 -0000
- Subject: [Bug tree-optimization/24333] New: missed div optimizations?
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
unsigned foo(const unsigned x) { return (x / x); }
double bar(const double x) { return (x / x); }
$ gcc -Wall -O2 -mregparm=3 -fomit-frame-pointer tmp.c -S
foo: xorl %edx, %edx
divl %eax
ret
bar: fldl 4(%esp)
fdiv %st(0), %st
ret
I think optimizer should return 1 for both cases.
--
Summary: missed div optimizations?
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pluto at agmk dot net
GCC build triplet: i686-pld-linux
GCC host triplet: i686-pld-linux
GCC target triplet: i686-pld-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24333