Bug 38394 - [4.3/4.4 regression] clashing assembler symbols
[4.3/4.4 regression] clashing assembler symbols
Status: RESOLVED FIXED
Product: gcc
Classification: Unclassified
Component: ada
4.3.2
: P4 normal
: 4.5.0
Assigned To: Not yet assigned to anyone
: wrong-code
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-12-04 09:25 UTC by Michael Völske
Modified: 2010-05-24 21:49 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.2.4 4.5.0
Known to fail: 4.3.2 4.4.0 4.4.4
Last reconfirmed: 2008-12-04 10:52:06


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Völske 2008-12-04 09:25:26 UTC
The following program results in clashing assembler symbols when compiled
with gnat-4.3.  This does not happen when using gnat-4.2.

-- file: pkg.ads --
package Pkg is
   procedure Foo;

   Max : Natural := 1;
   type Arr is array(Natural range 0..Max) of Natural;

   type T is record
         A : Arr := (others => 0); 
      end record;
end;

-- file: pkg.adb --
package body Pkg is
   procedure Foo is
      X, Y : T;
   begin
      null;
   end;
end;

-- compilation --

gcc-4.3 -c pkg.adb
/tmp/ccP5RYSw.s: Assembler messages:
/tmp/ccP5RYSw.s:76: Error: symbol `pkg__foo__T3scc___U' is already defined
End of compilation
gnatmake: "pkg.adb" compilation error
Comment 1 Laurent GUERBY 2008-12-04 10:52:06 UTC
Confirmed that it works with 4.2.4 but fails with 4.3.2 and trunk on x86_64-linux at least.

gcc version 4.4.0 20081118 (experimental) [trunk revision 141967] (GCC) 
$ gcc -c pkg.adb
/tmp/ccF1O7nh.s: Assembler messages:
/tmp/ccF1O7nh.s:86: Error: symbol `pkg__foo__T3scc___U' is already defined
Comment 2 Richard Biener 2009-01-24 10:21:03 UTC
GCC 4.3.3 is being released, adjusting target milestone.
Comment 3 Michael Völske 2009-05-28 18:24:33 UTC
FYI, this issue seems to be fixed in GNAT GPL 2009, released today.
Comment 4 Laurent GUERBY 2009-05-28 19:30:04 UTC
The issue is present on 4.4.0

guerby@gcc16:~/tmp$ /opt/cfarm/release/4.4.0/bin/gcc -c pkg.adb
/tmp/cc6tnj9K.s: Assembler messages:
/tmp/cc6tnj9K.s:86: Error: symbol `pkg__foo__T3scc___U' is already defined

But fixed on trunk as of revision 147903
Comment 5 Richard Biener 2009-08-04 12:29:39 UTC
GCC 4.3.4 is being released, adjusting target milestone.
Comment 6 Richard Biener 2010-05-22 18:12:53 UTC
GCC 4.3.5 is being released, adjusting target milestone.
Comment 7 Eric Botcazou 2010-05-24 21:43:49 UTC
Subject: Bug 38394

Author: ebotcazou
Date: Mon May 24 21:43:31 2010
New Revision: 159798

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=159798
Log:
	PR ada/38394
	* gnat.dg/array13.ad[sb]: New test.

Added:
    trunk/gcc/testsuite/gnat.dg/array13.adb
    trunk/gcc/testsuite/gnat.dg/array13.ads
Modified:
    trunk/gcc/testsuite/ChangeLog

Comment 8 Eric Botcazou 2010-05-24 21:46:17 UTC
Subject: Bug 38394

Author: ebotcazou
Date: Mon May 24 21:46:05 2010
New Revision: 159799

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=159799
Log:
	PR ada/38394
	* gnat.dg/array13.ad[sb]: New test.

Added:
    branches/gcc-4_5-branch/gcc/testsuite/gnat.dg/array13.adb
      - copied unchanged from r159798, trunk/gcc/testsuite/gnat.dg/array13.adb
    branches/gcc-4_5-branch/gcc/testsuite/gnat.dg/array13.ads
      - copied unchanged from r159798, trunk/gcc/testsuite/gnat.dg/array13.ads
Modified:
    branches/gcc-4_5-branch/gcc/testsuite/ChangeLog

Comment 9 Eric Botcazou 2010-05-24 21:49:12 UTC
Too delicate to fix on the older branches.