IMA corner case with forward declarations of statics

Geoff Keating geoffk@geoffk.org
Thu Jun 24 04:30:00 GMT 2004


On 23/06/2004, at 8:12 PM, Mark Mitchell wrote:

> Geoff Keating wrote:
>
>>
>> On 23/06/2004, at 7:58 PM, Mark Mitchell wrote:
>>
>>> Zack Weinberg wrote:
>>>
>>>> Now, GCC 3.4's IMA doesn't do the right thing with this either; no
>>>> matter which order the files are given in, you get
>>>>
>>>> Assembler messages:
>>>> Error: symbol `foo' is already defined
>>>>
>>>> No one has noticed, which leads me to believe that this will not be 
>>>> a
>>>> problem in real life.  So I propose to detect the case where we 
>>>> would
>>>> generate incorrect code, and call sorry() instead.
>>>>
>>> I think that's fine; it's certainly a progression.
>>>
>>> If IMA were implemented as in other compilers (i.e., parse entire 
>>> translation units in isolation, and then have a separate merge step) 
>>> things would not get confused.
>>
>>
>> By a strange coincidence, that's what the original implementation did.
>
> So, in Zack's test case we just failed to rename the things apart 
> before emitting assembly?

Yes; if we wanted to support this case we'd have to use unit-at-a-time, 
and take care not to commit too early to the assembler name.



More information about the Gcc mailing list