https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80790

            Bug ID: 80790
           Summary: Symbol defined but should be referenced in ACATS 4.1
                    c732b02
           Product: gcc
           Version: 7.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: simon at pushface dot org
  Target Milestone: ---
              Host: x86_64-apple-darwin15

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).

Reply via email to