Bug 80790 - Symbol defined but should be referenced in ACATS 4.1 c732b02
Summary: Symbol defined but should be referenced in ACATS 4.1 c732b02
Status: RESOLVED DUPLICATE of bug 80784
Alias: None
Product: gcc
Classification: Unclassified
Component: ada (show other bugs)
Version: 7.1.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-16 19:46 UTC by simon
Modified: 2017-05-17 12:54 UTC (History)
1 user (show)

See Also:
Host: x86_64-apple-darwin15
Target:
Build:
Known to work: 5.2.0, 6.1.0
Known to fail:
Last reconfirmed:


Attachments
Reproducer (12.81 KB, application/zip)
2017-05-16 19:47 UTC, simon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description simon 2017-05-16 19:46:55 UTC
In the attached code, the symbol _f732b00__change_discriminated_typeInvariant is generated as defined (T) in a code unit that should only reference it (U).

$ gnatmake -gnatws -O2 c732b02.adb 
gcc -c -gnatws -O2 c732b02.adb
gcc -c -gnatws -O2 f732b00.adb
gcc -c -gnatws -O2 report.adb
gnatbind -x c732b02.ali
gnatlink c732b02.ali -O2
duplicate symbol _f732b00__change_discriminated_typeInvariant in:
    ./f732b00.o
    ./c732b02.o
ld: 1 duplicate symbol for architecture x86_64
collect2: error: ld returned 1 exit status
gnatlink: error when calling /opt/gcc-7.1.0/bin/gcc
gnatmake: *** link failed.

The same failure occurs with GNAT GPL 2016, but not with GCC 6.1.0, 5.2.0 (for which the test passes).
Comment 1 simon 2017-05-16 19:47:48 UTC
Created attachment 41370 [details]
Reproducer
Comment 2 Eric Botcazou 2017-05-17 12:54:53 UTC
.

*** This bug has been marked as a duplicate of bug 80784 ***