[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [avr-gcc-list] dev and mod may not be optimized

From: Nathan Moore
Subject: RE: [avr-gcc-list] dev and mod may not be optimized
Date: Tue, 11 Dec 2007 11:25:52 -0500

Thank you for your explination Bjoern.
I have looked at GCC internals before, but never worked on them, so I'm
likely to say something stupid.
I would have thought that an optimization pattern for just this type of
thing would have already been in GCC, especially since on the internal
helper function is not unlike the divide instruction on x86, returning 2
values rather than one.  I would think that peephole optimization would
be all over this.


-----Original Message-----
From: Haase Bjoern (PT/EMM1) [mailto:address@hidden 
Sent: Tuesday, December 11, 2007 9:16 AM
To: Nathan Moore; address@hidden
Subject: AW: [avr-gcc-list] dev and mod may not be optimized

The source of this problem is a deeply buried internal issue of the RTL
handling within the compiler.

Description of the internal problem:

The expand pass generates strange RTL sequences refering to hard
registers for the div and mod operations and uses specific insn RTL for
calling the respective functions. This way the compiler does not need to
save and restore all of the call-clobbered registers but only those that
the functions alter.

Unfortunately div and mod could not be optimized this way because the
combine and CSE passes do not operate on hard registers :-(.

Unfortunately there is no easy solution of this issue :-(.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]