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

            Bug ID: 107347
           Summary: Sun Studio 12.6 assembler emits "warning: use of DCTI
                    couples is deprecated" on sparc-sun-solaris2.11
           Product: gcc
           Version: 12.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: andrew at ishiboo dot com
  Target Milestone: ---

Created attachment 53744
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53744&action=edit
Preprocessed source and generated assembler, compressed due to size

Since upgrading to Studio 12.6 /usr/ccs/bin/as as the platform assembler for
GCC on the sparc-sun-solaris2.11 target, the assembler emits warnings for all
relevant versions of GCC (tested at least 12, 11, 10, 9, 8, 7).

    $ /usr/ccs/bin/as -V
    /usr/ccs/bin/as: Studio 12.6 Compiler Common 12.6 SunOS_sparc s11_3sru27_3
11/22/2017

    $ g++-12 -mcpu=niagara4 -O3 -c -o /dev/null
output_test_helper-preprocessed-12.cc 
    /usr/ccs/bin/as: "/tmp/ccNN6N_b.s", line 7021: warning: use of DCTI couples
is deprecated

(Not sure if relevant, but different versions of GCC emit different numbers of
the warning for the same file. The same command line using GCC 9 emits 3
warnings. The same command line using GCC 7 emits 2 warnings.)

The Linux kernel was patched to fix this in 2017:

    https://lkml.org/lkml/2017/3/17/615

The binutils gas assembler was taught to emit the same warning in this commit:

   
https://github.com/bminor/binutils-gdb/commit/46a2d504dd875caf60f9be191a55c9ff676bcd5c

The complete text from the SPARC Architecture guide is in the LKML link above.

GCC still generates assembler output that triggers this warning on the platform
assembler, and I assume on a sufficiently new gas that was taught to emit the
same warning. I've attached the preprocessed source and generated assembler for
the file above. It generates the warning when the platform assembler is invoked
as:

    $ /usr/ccs/bin/as -xarch=sparc4 -o output_test_helper-preprocessed-12.o
output_test_helper-preprocessed-12.s
    /usr/ccs/bin/as: "output_test_helper-preprocessed-12.s", line 7021:
warning: use of DCTI couples is deprecated

The relevant generated assembler is:

        .LL1699:
                ld      [%fp-2928], %o0
                add     %fp, -2920, %g1
                cwbne   %o0, %g1, .+16
                nop
                ba,pt   %xcc, .LL1902
                nop
                call    _ZdlPv, 0
                 mov    %l0, %i0
                ba,a,pt %xcc, .LL1999
        .LL1782:
    --->        call    __cxa_guard_abort, 0
                 or     %i5,
%lo(_ZGVZN8internal12_GLOBAL__N_116GetSubstitutionsEvE13percentage_re), %o0
        .LLEHB124:
                call    _Unwind_Resume, 0
                 mov    %i0, %o0

The arrow points to the line generating the warning. The programming note in
the architecture manual spells out the issue:

    Programming Note
    As noted in TABLE 6-5 on page 115, an annulled branch-always
    (branch-always with a = 1) instruction is not architecturally a DCTI.
    However, since not all implementations make that distinction, for
    optimal performance, a DCTI should not be placed in the instruction word
    immediately following an annulled branch-always instruction (BA,A or
    BPA,A)."

Reply via email to