[cfe-dev] linux/i386 and mregparm

Eli Friedman eli.friedman at gmail.com
Wed Mar 2 10:22:28 PST 2011


On Wed, Mar 2, 2011 at 6:12 AM, Dimitry Andric <dimitry at andric.com> wrote:
> On 2011-03-01 02:30, Eli Friedman wrote:
>>>
>>> 6. weak functions and optimization
>>>
>>> it appears to be yet another bug in that when a weak function with an
>>> empty body
>>> is encountered in a compilation unit, the optimizer assumes that that's
>>> there is
>>> to this function and omits passing arguments to calls to the weak
>>> function (and
>>> presumably non-empty bodies would trigger other kind of optimizations not
>>> necessarily
>>> valid for the overrides).
>>>
>>> obviously this is incorrect since the whole point of a weak function is
>>> that it
>>> can be overridden in another compilation unit and therefore no
>>> assumptions can be
>>> made about it in the optimizer. this particular problem arises in linux
>>> in a few
>>> places as weak functions are sometimes used to implement arch specific
>>> overrides.
>>
>> Fixed in r126720.
>
> I had hoped r126720 would also fix the problem I've reported in PR 9352,
> but unfortunately it did not.  But it seems to be an issue of the same
> type, maybe this is just as easy to fix? :)

Completely different layer.

-Eli




More information about the cfe-dev mailing list