This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/24333] New: missed div optimizations?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]