This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Been Looking how gcc operates there is a major weaknesses in its optimiser.


On Mon, Mar 17, 2008 at 7:34 PM, Andrew Haley <aph@redhat.com> wrote:
> Peter Dolding wrote:
>  > Ian Lance Taylor wrote:
>  >> "Peter Dolding" <oiaohm@gmail.com> writes:
>  >>
>  >>
>  >>> Since test is in a different object file it gets completely skiped
>  >>> from optimising even that it should be optimised out.
>  >>>
>  >>
>  >> http://gcc.gnu.org/wiki/LTO_Driver
>  >>
>  >> Ian
>  >>
>  > Ok that is half my idea.  Let it sort out at link stage.  But that does
>  > not cover like libc and dynamic dependencies.
>
>  And it can't, either, at least not on GNU/Linux.  When a bug fix is
>  imported into glibc, every user of glibc immediately benefits.  That's one
>  of the reasons we don't link statically on that system.  This is far
>  more important than the performance issue.
>
>  Andrew.
>
That would be in the same class as saying cannot optimize out sqrt out
of libm because a update might change it.

Not all uses of GNU/Linux are like Distributions Andrew.  Sections of
glibc passed constants should give 100 percent constant results.

I am just proposing a automatic system to find and built data to allow
them to be optimize out.  Of course even  just in a advisement roll to
a programmer could be handy.  Ok you have just asked for a constant
here to be converted to a MD5 password hash.  Might be a good idea to
make that a internal constant instead of wasting processor time every
time at this point.  Adviser option or full blown both can be useful
to coders.   At least some of the same data would have to remain for
Adviser.  Ie what functions optimize out when passed constants.  Full
blown could even tell the coder what the possible replacement is even
if it don't do it automatically.

Its in the same class as lot of  other optimizations.  Almost no
Distribution go and build with every optimization option on.  So this
one will be no different.  Usefulness to programmers looking for
blocks of code that should not be there is high as well as useful for
speed hunters.

I guess you want it done like math functions.  Functions selected 1 at
a time to be added to the optimizer fix.  This is not really useful to
a person doing there own internal projects.

Peter Dolding


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]