Fix code size estimates wrt variadic functions

Jan Hubicka hubicka@ucw.cz
Tue Jun 1 09:08:00 GMT 2010


> 
> I think this whole chain of different ways to look at argument cost
> should go away by simply always looking at the call stmt arguments
> (where the !VOID_TYPE_P (TREE_TYPE (arg)) check is useless as well).
> 
> Can you rework the patch that way?

There was always problem with --combine and other places leading to ICE
on function size being negative after inlining.  Problem is that when
prototype mismatch in between declaration and call statement, we compute
the cost once based on statement here and second time in inliner based on
declaratio (we don't have the statement there) and when the second happens
to be greater, we get to ICE.  I think this still holds for both --combine and
LTO even when we disable inlining for some type of mismatches.

In the case of stdarg we should be safe as I explained in the comment.

Honza
> 
> Ok with this change.
> 
> Thanks,
> Richard.



More information about the Gcc-patches mailing list