This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/53916] [mips16] divide operation compiled result incorrect with GCC-4.6.3 '-O2' option
- From: "anmin_deng at yahoo dot com.tw" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 13 Jul 2012 11:41:37 +0000
- Subject: [Bug rtl-optimization/53916] [mips16] divide operation compiled result incorrect with GCC-4.6.3 '-O2' option
- Auto-submitted: auto-generated
- References: <bug-53916-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53916
--- Comment #1 from anmin_deng at yahoo dot com.tw 2012-07-13 11:41:37 UTC ---
I recently tried the very same configurations and codes and tests with
GCC-4.7.1. It seems that the generated disassemble by GCC-4.7.1 is OK (I have
not yet checked very closely to confirm).
However, the generated results by GCC-4.7.1 with '-O2' and '-Os' are not very
optimal compared to the results by GCC-4.6.3 with '-Os'. The generated code by
GCC-4.6.3 with '-Os' runs 'divu' instruction once (per loop) and using HI and
LO registers resulted from the same 'divu' as remainder and quotient. The
generated code by GCC-4.7.1 runs 'divu' instruction twice, one 'divu' for HI
(remainder) and the other 'divu' for LO (quotient).