public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/17958] New: expand_divmod fails to optimize division of 64-bit quantity by small constant when BITS_PER_WORD is 32
@ 2004-10-12 22:48 zack at gcc dot gnu dot org
  2004-10-12 22:55 ` [Bug middle-end/17958] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 4+ messages in thread
From: zack at gcc dot gnu dot org @ 2004-10-12 22:48 UTC (permalink / raw)
  To: gcc-bugs

expand_divmod cannot optimize code such as

long long div10(long long n) { return n / 10; }

when BITS_PER_WORD is 32.  A call to __divdi3 gets generated.  By contrast, when
BITS_PER_WORD is 64, this is optimized to a multiply and a shift.  I noticed
this problem on powerpc32, but it ought to affect any 32-bit target.

-- 
           Summary: expand_divmod fails to optimize division of 64-bit
                    quantity by small constant when BITS_PER_WORD is 32
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P2
         Component: rtl-optimization
        AssignedTo: roger at eyesopen dot com
        ReportedBy: zack at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: powerpc-*-*


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17958


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-08-15 12:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-17958-4@http.gcc.gnu.org/bugzilla/>
2012-06-12 20:52 ` [Bug middle-end/17958] expand_divmod fails to optimize division of 64-bit quantity by small constant when BITS_PER_WORD is 32 pinskia at gcc dot gnu.org
2021-05-04 12:32 ` rguenth at gcc dot gnu.org
2021-08-15 12:14 ` pinskia at gcc dot gnu.org
2004-10-12 22:48 [Bug rtl-optimization/17958] New: " zack at gcc dot gnu dot org
2004-10-12 22:55 ` [Bug middle-end/17958] " pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).