> So the one and only type of optimization not done by leaving the
> optmization level at -O2 (like Wine is doing), is the 
> 'flag_inline_functions' 
> - from the only piece of code using it, it seems that 
> flag_inline_functions
> is making  the compiler trying to inline a function even if 
> the programmer
> has not asked for it. 
> 
> I don't know if this optimisation is dangerous; such knowledge could
> only be acquired by reading and understanding the gcc code. There is
> always the quick solution for the slow-witted; I have not much choice
> in the matter so I have hitten www.deja.com with 'bug gcc inline' and
> got 32 pages and about 800 results. Feel free to do the same and
> actually read them :-)

I don't believe inlining is dangerous in itself.
The problem is that if the optimizer doesn't know
(or ignore) how a function is used or what a piece
of inline assembler code does, it might do a mistake
which was the case here.

The big question that is whether __attribute__((unused))
should be considered something that the optimizer should
be aware of and in that case what it should do.

What GNU C currently does is to remove it if it can't
detect any use, by design or by mistake.

Ove claims it is by design, I claim it is by mistake or
possibly by short sighted design. In any case I believe
that GNU C should be changed since the current meaning
doesn't really make sense, it just hides a problem, 
that can AFAICS always quite easily be fixed otherwise,
as I have tried to explain.

Reply via email to