This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
-Os vs move_moveables
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: gcc at gcc dot gnu dot org, Dale Johannesen <dalej at apple dot com>
- Cc: Andrew Pinski <pinskia at physics dot uc dot edu>
- Date: Mon, 9 Dec 2002 22:08:03 -0800
- Subject: -Os vs move_moveables
Dale,
The original discussion of the matter and why it is turned off for
optimize_size:
http://gcc.gnu.org/ml/gcc/1998-04/msg00995.html
The message which commented the patch:
http://gcc.gnu.org/ml/gcc/1998-05/msg00495.html
When it was done:
Revision 1.50 / (download) - annotate - [select for diffs] , Thu May
14 00:50:07 1998 UTC (4 years, 6 months ago) by law
Branch: MAIN
Changes since 1.49: +7 -3 lines
Diff to previous 1.49 (colored)
* loop.c (scan_loop): Don't call move_moveables for
optimize_size.
On Monday, Dec 9, 2002, at 11:36 US/Pacific, Dale Johannesen wrote:
Currently the loop optimizer disables pulling things out of loops with
-Os:
/* Now consider each movable insn to decide whether it is worth
moving.
Store 0 in regs->array[I].set_in_loop for each reg I that is
moved.
Generally this increases code size, so do not move moveables when
optimizing for code size. */
if (! optimize_size)
{
move_movables (loop, movables, threshold, insn_count);
This was true in 2.95 as well. Can somebody explain why it's doing
this?
I don't believe the comment is correct in general, at least for RISCs.
If you're going to compute something into a register, it is no bulkier
to
do it outside the loop. I do see that pulling things out increases
register
lifetimes and makes spilling more likely, but that consideration is
not specific
to -Os.