This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
-Os vs moveables
- From: Dale Johannesen <dalej at apple dot com>
- To: gcc at gcc dot gnu dot org
- Cc: Dale Johannesen <dalej at apple dot com>
- Date: Mon, 9 Dec 2002 11:36:02 -0800
- Subject: -Os vs moveables
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.