Re: nasm over gas?

From: Jamie Lokier
Date: Sat Sep 13 2003 - 14:26:42 EST


Jörn Engel wrote:
> - Why has Alan measured faster kernels with -Os than with -O2?
>
> Code size *does* matter.

That's not just i-cache pressure. It is partly a GCC problem, and
it's possible -Os would run faster than -O2 even with no i-cache.

I've observed -Os emitting exactly the same code as -O2 for some
trivial functions, except that -O2 has a few extra redundant
instructions.

Obvious the _intent_ of -O2 is to compile for speed, but it's clear
that GCC often emits trivially redundant instructions (like stack
adjustments) that don't serve to speed up the program at all.

-- Jamie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/