gcc iussue or ... ?

Loren James Rittle rittle at latour.rsch.comm.mot.com
Mon Apr 14 15:43:30 PDT 2003


In article <20030413124626.5e782421.kabaev at bellatlantic.net>,
Alexander Kabaev<kabaev at bellatlantic.net> writes:

> On Sat, 12 Apr 2003 18:26:36 -0700
> "David O'Brien" <obrien at freebsd.org> wrote:

>> I'm not sure we should change FreeBSD to do something that purposfully
>> produces wrong semantics. [...]

> I think there is a slight confusion here. It is -fconserve-space flag
> what introduces wrong semantics, [...]

Agreed (with Alex).  David, for the record: Here is the short test
which displays the exact change:

; cat >t.C
int t;
<EOF>
; /usr/bin/g++ -c t.C # gcc 2.95.4 20020320 [FreeBSD]
; size t.o
   text    data     bss     dec     hex filename
      0       4       0       4       4 t.o
; /usr/local/beta-gcc/bin/g++ -c t.C # FSF mainline
; size t.o
   text    data     bss     dec     hex filename
      0       0       4       4       4 t.o

This is OK since there is no concept of "common merging" in C++.  At
one point, I knew the reason why older g++ assigned no data to BSS.
Either way, this was a purposeful change in g++ (I can't cite the
thread off-hand but I read it at the time).  The system compiler on
ref5/beast is doing section assignment for C++ the "new way".

David, I do think that you found a section of code (which was
originally written in 1996 before g++ used BSS) that could be
tightened up in light of the new section rules used by g++.  Anyone
willing to post the patch ``attn: Mark Mitchell/Jason Merrill'' to
gcc-patches?  Tree munging is outside my area of expertise.

Regards,
Loren


More information about the freebsd-hackers mailing list