Re: keep code simple

From: Aldy Hernandez (aldyh@redhat.com)
Date: Sat Jul 27 2002 - 15:24:32 EST


>> A bit offtopic, but: I heard M$ and Intel compilers beat GCC
>> by 20-40% in terms of code size. Why GCC is so much behind?
>>
> er...

> one big reason is that gcc is cross platform, while
> ms and intel can cut corners and optimize for x86

That and most of gcc's optimizations are done at the RTL level, which
is just a glorified assembler. IIRC the original GCC optimizer was
based on the U of Arizona optimizer which was just an assembly
optimizer. Consequently higher lever optimizations, which every
serious compiler (but gcc) do, are unbeknownst to gcc.

If you lower the high level code too much (like gcc does), you loose
certain abstractions such as loops, that could benefit enormously from
high lever optimizations.

Diego Novillo is doing a lot of infrastructure work for gcc so we can
do these high level optimizations, but that's a bit far in the
horizon.

Cheers.

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



This archive was generated by hypermail 2b29 : Tue Jul 30 2002 - 14:00:27 EST