public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/98481] New: std::vector<std::string>::size_type as return type gets tagged with abi:cxx11
@ 2020-12-30 17:25 Daniel.Riley at cornell dot edu
  2021-01-05 10:48 ` [Bug c++/98481] [10/11 Regression] " rguenth at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Daniel.Riley at cornell dot edu @ 2020-12-30 17:25 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98481
           Summary: std::vector<std::string>::size_type as return type
                    gets tagged with abi:cxx11
           Product: gcc
           Version: 10.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: Daniel.Riley at cornell dot edu
  Target Milestone: ---

Created attachment 49860
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49860&action=edit
demonstration of std::vector<std::string>::size_type mangling inconsistency

In the attached program, S1::asdf() and S2::asdf() are mangled
differently--S1:asdf gets mangled with S1::asdf[abi:cxx11](), despite the two
member functions having the same declared types and compatible types in the
definitions:

        movq    S1::asdf[abi:cxx11]() const, -16(%rbp)
        movq    S2::asdf() const, -32(%rbp)

This seems to break the rule that if T and U are the same type, then 'T x()
const' and 'U x() const' should have the same mangling.  Adding 'abi:cxx11' can
cause linkage errors with separate compilation and breaks compatibility with
other compilers.

According to compiler explorer, this is new behavior in gcc10, see  

https://godbolt.org/z/P7j4We

Still observed in 11.0.0 20201205.

Compilation output:

% g++ -v -save-temps -std=c++17 m.cc
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/cvmfs/cms-ib.cern.ch/nweek-02661/slc7_amd64_gcc10/external/gcc/10.2.0/bin/../libexec/gcc/x86_64-unknown-linux-gnu/10.2.1/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure
--prefix=/build/muz/g10/w/tmp/BUILDROOT/6af2184a61ae4a90cb849a228a342f29/opt/cmssw/slc7_amd64_gcc10/external/gcc/10.2.0
--disable-multilib --disable-nls --disable-dssi
--enable-languages=c,c++,fortran --enable-gnu-indirect-function
--enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object
--enable-plugin --with-linker-hash-style=gnu --enable-linker-build-id
--enable-ld=default --enable-lto --enable-gold=yes
--with-gmp=/build/muz/g10/w/tmp/BUILDROOT/6af2184a61ae4a90cb849a228a342f29/opt/cmssw/slc7_amd64_gcc10/external/gcc/10.2.0
--with-mpfr=/build/muz/g10/w/tmp/BUILDROOT/6af2184a61ae4a90cb849a228a342f29/opt/cmssw/slc7_amd64_gcc10/external/gcc/10.2.0
--enable-bootstrap
--with-mpc=/build/muz/g10/w/tmp/BUILDROOT/6af2184a61ae4a90cb849a228a342f29/opt/cmssw/slc7_amd64_gcc10/external/gcc/10.2.0
--with-isl=/build/muz/g10/w/tmp/BUILDROOT/6af2184a61ae4a90cb849a228a342f29/opt/cmssw/slc7_amd64_gcc10/external/gcc/10.2.0
--enable-checking=release --build=x86_64-unknown-linux-gnu
--host=x86_64-unknown-linux-gnu --enable-libstdcxx-time=rt --enable-shared
--disable-libgcj CC='gcc -fPIC' CXX='c++ -fPIC' CPP=cpp CXXCPP='c++ -E'
CFLAGS=-I/build/muz/g10/w/tmp/BUILDROOT/6af2184a61ae4a90cb849a228a342f29/opt/cmssw/slc7_amd64_gcc10/external/gcc/10.2.0/tmp/sw/include
CXXFLAGS=-I/build/muz/g10/w/tmp/BUILDROOT/6af2184a61ae4a90cb849a228a342f29/opt/cmssw/slc7_amd64_gcc10/external/gcc/10.2.0/tmp/sw/include
LDFLAGS=-L/build/muz/g10/w/tmp/BUILDROOT/6af2184a61ae4a90cb849a228a342f29/opt/cmssw/slc7_amd64_gcc10/external/gcc/10.2.0/tmp/sw/lib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.2.1 20200803 (GCC)
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++17' '-shared-libgcc'
'-mtune=generic' '-march=x86-64'

/cvmfs/cms-ib.cern.ch/nweek-02661/slc7_amd64_gcc10/external/gcc/10.2.0/bin/../libexec/gcc/x86_64-unknown-linux-gnu/10.2.1/cc1plus
-E -quiet -v -iprefix
/cvmfs/cms-ib.cern.ch/nweek-02661/slc7_amd64_gcc10/external/gcc/10.2.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/10.2.1/
-isystem
/cvmfs/cms-ib.cern.ch/nweek-02661/slc7_amd64_gcc10/external/gcc/10.2.0/include
-D_GNU_SOURCE m.cc -mtune=generic -march=x86-64 -std=c++17 -fpch-preprocess
-fabi-version=0 -o m.ii
ignoring nonexistent directory
"/cvmfs/cms-ib.cern.ch/nweek-02661/slc7_amd64_gcc10/external/gcc/10.2.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/10.2.1/../../../../x86_64-unknown-linux-gnu/include"
ignoring duplicate directory
"/cvmfs/cms-ib.cern.ch/nweek-02661/slc7_amd64_gcc10/external/gcc/10.2.0/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/10.2.1/../../../../include/c++/10.2.1"
ignoring duplicate directory
"/cvmfs/cms-ib.cern.ch/nweek-02661/slc7_amd64_gcc10/external/gcc/10.2.0/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/10.2.1/../../../../include/c++/10.2.1/x86_64-unknown-linux-gnu"
ignoring duplicate directory
"/cvmfs/cms-ib.cern.ch/nweek-02661/slc7_amd64_gcc10/external/gcc/10.2.0/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/10.2.1/../../../../include/c++/10.2.1/backward"
ignoring duplicate directory
"/cvmfs/cms-ib.cern.ch/nweek-02661/slc7_amd64_gcc10/external/gcc/10.2.0/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/10.2.1/include"
ignoring duplicate directory
"/cvmfs/cms-ib.cern.ch/nweek-02661/slc7_amd64_gcc10/external/gcc/10.2.0/bin/../lib/gcc/../../include"
ignoring duplicate directory
"/cvmfs/cms-ib.cern.ch/nweek-02661/slc7_amd64_gcc10/external/gcc/10.2.0/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/10.2.1/include-fixed"
ignoring nonexistent directory
"/cvmfs/cms-ib.cern.ch/nweek-02661/slc7_amd64_gcc10/external/gcc/10.2.0/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/10.2.1/../../../../x86_64-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /cvmfs/cms-ib.cern.ch/nweek-02661/slc7_amd64_gcc10/external/gcc/10.2.0/include

/cvmfs/cms-ib.cern.ch/nweek-02661/slc7_amd64_gcc10/external/gcc/10.2.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/10.2.1/../../../../include/c++/10.2.1

/cvmfs/cms-ib.cern.ch/nweek-02661/slc7_amd64_gcc10/external/gcc/10.2.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/10.2.1/../../../../include/c++/10.2.1/x86_64-unknown-linux-gnu

/cvmfs/cms-ib.cern.ch/nweek-02661/slc7_amd64_gcc10/external/gcc/10.2.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/10.2.1/../../../../include/c++/10.2.1/backward

/cvmfs/cms-ib.cern.ch/nweek-02661/slc7_amd64_gcc10/external/gcc/10.2.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/10.2.1/include

/cvmfs/cms-ib.cern.ch/nweek-02661/slc7_amd64_gcc10/external/gcc/10.2.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/10.2.1/include-fixed
 /usr/local/include
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++17' '-shared-libgcc'
'-mtune=generic' '-march=x86-64'

/cvmfs/cms-ib.cern.ch/nweek-02661/slc7_amd64_gcc10/external/gcc/10.2.0/bin/../libexec/gcc/x86_64-unknown-linux-gnu/10.2.1/cc1plus
-fpreprocessed m.ii -quiet -dumpbase m.cc -mtune=generic -march=x86-64 -auxbase
m -std=c++17 -version -fabi-version=0 -o m.s
GNU C++17 (GCC) version 10.2.1 20200803 (x86_64-unknown-linux-gnu)
        compiled by GNU C version 10.2.1 20200803, GMP version 6.2.0, MPFR
version 4.0.2, MPC version 1.1.0, isl version isl-0.22-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C++17 (GCC) version 10.2.1 20200803 (x86_64-unknown-linux-gnu)
        compiled by GNU C version 10.2.1 20200803, GMP version 6.2.0, MPFR
version 4.0.2, MPC version 1.1.0, isl version isl-0.22-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 1cbe278be5220506f693cd99f8934440
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++17' '-shared-libgcc'
'-mtune=generic' '-march=x86-64'

/cvmfs/cms-ib.cern.ch/nweek-02661/slc7_amd64_gcc10/external/gcc/10.2.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/10.2.1/../../../../x86_64-unknown-linux-gnu/bin/as
-v --64 -o m.o m.s
GNU assembler version 2.32 (x86_64-unknown-linux-gnu) using BFD version (GNU
Binutils) 2.32
COMPILER_PATH=/cvmfs/cms-ib.cern.ch/nweek-02661/slc7_amd64_gcc10/external/gcc/10.2.0/bin/../libexec/gcc/x86_64-unknown-linux-gnu/10.2.1/:/cvmfs/cms-ib.cern.ch/nweek-02661/slc7_amd64_gcc10/external/gcc/10.2.0/bin/../libexec/gcc/:/cvmfs/cms-ib.cern.ch/nweek-02661/slc7_amd64_gcc10/external/gcc/10.2.0/:/cvmfs/cms-ib.cern.ch/nweek-02661/slc7_amd64_gcc10/external/gcc/10.2.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/10.2.1/../../../../x86_64-unknown-linux-gnu/bin/
LIBRARY_PATH=/cvmfs/cms-ib.cern.ch/nweek-02661/slc7_amd64_gcc10/external/gcc/10.2.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/10.2.1/:/cvmfs/cms-ib.cern.ch/nweek-02661/slc7_amd64_gcc10/external/gcc/10.2.0/bin/../lib/gcc/:/cvmfs/cms-ib.cern.ch/nweek-02661/slc7_amd64_gcc10/external/gcc/10.2.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/10.2.1/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/cvmfs/cms-ib.cern.ch/nweek-02661/slc7_amd64_gcc10/external/gcc/10.2.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/10.2.1/../../../../x86_64-unknown-linux-gnu/lib/:/cvmfs/cms-ib.cern.ch/nweek-02661/slc7_amd64_gcc10/external/gcc/10.2.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/10.2.1/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++17' '-shared-libgcc'
'-mtune=generic' '-march=x86-64'

/cvmfs/cms-ib.cern.ch/nweek-02661/slc7_amd64_gcc10/external/gcc/10.2.0/bin/../libexec/gcc/x86_64-unknown-linux-gnu/10.2.1/collect2
-plugin
/cvmfs/cms-ib.cern.ch/nweek-02661/slc7_amd64_gcc10/external/gcc/10.2.0/bin/../libexec/gcc/x86_64-unknown-linux-gnu/10.2.1/liblto_plugin.so
-plugin-opt=/cvmfs/cms-ib.cern.ch/nweek-02661/slc7_amd64_gcc10/external/gcc/10.2.0/bin/../libexec/gcc/x86_64-unknown-linux-gnu/10.2.1/lto-wrapper
-plugin-opt=-fresolution=m.res -plugin-opt=-pass-through=-lgcc_s
-plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc
-plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id
--eh-frame-hdr --hash-style=gnu -m elf_x86_64 -dynamic-linker
/lib64/ld-linux-x86-64.so.2 -z common-page-size=4096 -z max-page-size=4096
/lib/../lib64/crt1.o /lib/../lib64/crti.o
/cvmfs/cms-ib.cern.ch/nweek-02661/slc7_amd64_gcc10/external/gcc/10.2.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/10.2.1/crtbegin.o
-L/cvmfs/cms-ib.cern.ch/nweek-02661/slc7_amd64_gcc10/external/gcc/10.2.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/10.2.1
-L/cvmfs/cms-ib.cern.ch/nweek-02661/slc7_amd64_gcc10/external/gcc/10.2.0/bin/../lib/gcc
-L/cvmfs/cms-ib.cern.ch/nweek-02661/slc7_amd64_gcc10/external/gcc/10.2.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/10.2.1/../../../../lib64
-L/lib/../lib64 -L/usr/lib/../lib64
-L/cvmfs/cms-ib.cern.ch/nweek-02661/slc7_amd64_gcc10/external/gcc/10.2.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/10.2.1/../../../../x86_64-unknown-linux-gnu/lib
-L/cvmfs/cms-ib.cern.ch/nweek-02661/slc7_amd64_gcc10/external/gcc/10.2.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/10.2.1/../../..
m.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc
/cvmfs/cms-ib.cern.ch/nweek-02661/slc7_amd64_gcc10/external/gcc/10.2.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/10.2.1/crtend.o
/lib/../lib64/crtn.o
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++17' '-shared-libgcc'
'-mtune=generic' '-march=x86-64'

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/98481] [10/11 Regression] std::vector<std::string>::size_type as return type gets tagged with abi:cxx11
  2020-12-30 17:25 [Bug c++/98481] New: std::vector<std::string>::size_type as return type gets tagged with abi:cxx11 Daniel.Riley at cornell dot edu
@ 2021-01-05 10:48 ` rguenth at gcc dot gnu.org
  2021-01-07 11:08 ` jakub at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-01-05 10:48 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ABI
                 CC|                            |jason at gcc dot gnu.org
            Summary|std::vector<std::string>::s |[10/11 Regression]
                   |ize_type as return type     |std::vector<std::string>::s
                   |gets tagged with abi:cxx11  |ize_type as return type
                   |                            |gets tagged with abi:cxx11
   Target Milestone|---                         |10.3

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/98481] [10/11 Regression] std::vector<std::string>::size_type as return type gets tagged with abi:cxx11
  2020-12-30 17:25 [Bug c++/98481] New: std::vector<std::string>::size_type as return type gets tagged with abi:cxx11 Daniel.Riley at cornell dot edu
  2021-01-05 10:48 ` [Bug c++/98481] [10/11 Regression] " rguenth at gcc dot gnu.org
@ 2021-01-07 11:08 ` jakub at gcc dot gnu.org
  2021-01-07 11:13 ` jakub at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-01-07 11:08 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
                 CC|                            |jakub at gcc dot gnu.org
   Last reconfirmed|                            |2021-01-07
     Ever confirmed|0                           |1

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
This boils down to:
inline namespace N __attribute ((__abi_tag__ ("cxx11")))
{
  struct A {};
}
template <typename T>
struct B { typedef int size_type; };
struct S1 { B<A>::size_type foo () const { return 1; } };
struct S2 { B<A>::size_type foo () const; };
int S2::foo () const { return 2; }

int
main ()
{
  auto f1 = &S1::foo;
  auto f2 = &S2::foo;
}

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/98481] [10/11 Regression] std::vector<std::string>::size_type as return type gets tagged with abi:cxx11
  2020-12-30 17:25 [Bug c++/98481] New: std::vector<std::string>::size_type as return type gets tagged with abi:cxx11 Daniel.Riley at cornell dot edu
  2021-01-05 10:48 ` [Bug c++/98481] [10/11 Regression] " rguenth at gcc dot gnu.org
  2021-01-07 11:08 ` jakub at gcc dot gnu.org
@ 2021-01-07 11:13 ` jakub at gcc dot gnu.org
  2021-01-07 11:13 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-01-07 11:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r10-6517-g1e042b396e2a84e3ee17bc52def1bf241cb7d248

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/98481] [10/11 Regression] std::vector<std::string>::size_type as return type gets tagged with abi:cxx11
  2020-12-30 17:25 [Bug c++/98481] New: std::vector<std::string>::size_type as return type gets tagged with abi:cxx11 Daniel.Riley at cornell dot edu
                   ` (2 preceding siblings ...)
  2021-01-07 11:13 ` jakub at gcc dot gnu.org
@ 2021-01-07 11:13 ` jakub at gcc dot gnu.org
  2021-01-07 11:39 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-01-07 11:13 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/98481] [10/11 Regression] std::vector<std::string>::size_type as return type gets tagged with abi:cxx11
  2020-12-30 17:25 [Bug c++/98481] New: std::vector<std::string>::size_type as return type gets tagged with abi:cxx11 Daniel.Riley at cornell dot edu
                   ` (3 preceding siblings ...)
  2021-01-07 11:13 ` jakub at gcc dot gnu.org
@ 2021-01-07 11:39 ` jakub at gcc dot gnu.org
  2021-01-07 12:01 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-01-07 11:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
So, likely during
1598      cp_walk_tree_without_duplicates (&subtype, find_abi_tags_r, &data);
we should avoid walking into the template parameters.
I guess either it can be done by setting *walk_subtrees in find_abi_tags_r for
TYPE_P and handling it manually without the walking into template args, but
we'd need to repeat what walk_type_fields and cp_walk_subtrees does on types,
or perhaps some global variable that will temporarily disable walking into the
template parameters, or perhaps abuse the fact that *walk_subtrees is int
rather than bool and for TYPE_P set *walk_subtrees to 2 rather than 1 if
non-zero and treat that in cp_walk_subtrees as a request not to walk template
parameters.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/98481] [10/11 Regression] std::vector<std::string>::size_type as return type gets tagged with abi:cxx11
  2020-12-30 17:25 [Bug c++/98481] New: std::vector<std::string>::size_type as return type gets tagged with abi:cxx11 Daniel.Riley at cornell dot edu
                   ` (4 preceding siblings ...)
  2021-01-07 11:39 ` jakub at gcc dot gnu.org
@ 2021-01-07 12:01 ` jakub at gcc dot gnu.org
  2021-01-11 16:15 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-01-07 12:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 49910
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49910&action=edit
gcc11-pr98481.patch

Untested fix.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/98481] [10/11 Regression] std::vector<std::string>::size_type as return type gets tagged with abi:cxx11
  2020-12-30 17:25 [Bug c++/98481] New: std::vector<std::string>::size_type as return type gets tagged with abi:cxx11 Daniel.Riley at cornell dot edu
                   ` (5 preceding siblings ...)
  2021-01-07 12:01 ` jakub at gcc dot gnu.org
@ 2021-01-11 16:15 ` cvs-commit at gcc dot gnu.org
  2021-04-01 11:38 ` [Bug c++/98481] [10 " cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-01-11 16:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

https://gcc.gnu.org/g:3dd0d3ee1d2a988e7f3a3e8f009fcf328f16d2ed

commit r11-6592-g3dd0d3ee1d2a988e7f3a3e8f009fcf328f16d2ed
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Jan 7 17:47:18 2021 +0100

    c++, abi: Fix abi_tag attribute handling [PR98481]

    In GCC10 cp_walk_subtrees has been changed to walk template arguments.
    As the following testcase, that changed the mangling of some functions.
    I believe the previous behavior that find_abi_tags_r doesn't recurse into
    template args has been the correct one, but setting *walk_subtrees = 0
    for the types and handling the types subtree walking manually in
    find_abi_tags_r looks too hard, there are a lot of subtrees and details
what
    should and shouldn't be walked, both in tree.c (walk_type_fields there,
    which is static) and in cp_walk_subtrees itself.

    The following patch abuses the fact that *walk_subtrees is an int to
    tell cp_walk_subtrees it shouldn't walk the template args.

    Co-authored-by: Jason Merrill <jason@redhat.com>

    gcc/cp/ChangeLog:

            PR c++/98481
            * class.c (find_abi_tags_r): Set *walk_subtrees to 2 instead of 1
            for types.
            (mark_abi_tags_r): Likewise.
            * decl2.c (min_vis_r): Likewise.
            * tree.c (cp_walk_subtrees): If *walk_subtrees_p is 2, look through
            typedefs.

    gcc/testsuite/ChangeLog:

            PR c++/98481
            * g++.dg/abi/abi-tag24.C: New test.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/98481] [10 Regression] std::vector<std::string>::size_type as return type gets tagged with abi:cxx11
  2020-12-30 17:25 [Bug c++/98481] New: std::vector<std::string>::size_type as return type gets tagged with abi:cxx11 Daniel.Riley at cornell dot edu
                   ` (6 preceding siblings ...)
  2021-01-11 16:15 ` cvs-commit at gcc dot gnu.org
@ 2021-04-01 11:38 ` cvs-commit at gcc dot gnu.org
  2021-04-01 14:05 ` cvs-commit at gcc dot gnu.org
  2021-04-05 21:36 ` jason at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-04-01 11:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Richard Biener
<rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:892024d4af83b258801ff7484bf28f0cf1a1a999

commit r10-9651-g892024d4af83b258801ff7484bf28f0cf1a1a999
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Apr 1 09:59:47 2021 +0200

    c++, abi: Fix abi_tag attribute handling [PR98481]

    In GCC10 cp_walk_subtrees has been changed to walk template arguments.
    As the following testcase, that changed the mangling of some functions.
    I believe the previous behavior that find_abi_tags_r doesn't recurse into
    template args has been the correct one, but setting *walk_subtrees = 0
    for the types and handling the types subtree walking manually in
    find_abi_tags_r looks too hard, there are a lot of subtrees and details
what
    should and shouldn't be walked, both in tree.c (walk_type_fields there,
    which is static) and in cp_walk_subtrees itself.

    The following patch abuses the fact that *walk_subtrees is an int to
    tell cp_walk_subtrees it shouldn't walk the template args.

    But we don't want to introduce an ABI change in the middle of the GCC 10
    cycle, so the GCC 10 version of this patch introduces ABI v15 for the fix,
    which will be available but not default in GCC 10.3.

    Co-authored-by: Jason Merrill <jason@redhat.com>

    gcc/cp/ChangeLog:

            PR c++/98481
            * class.c (find_abi_tags_r): Set *walk_subtrees to 2 instead of 1
            for types.
            (mark_abi_tags_r): Likewise.
            * tree.c (cp_walk_subtrees): If *walk_subtrees_p is 2, look through
            typedefs.

    gcc/testsuite/ChangeLog:

            PR c++/98481
            * g++.dg/abi/abi-tag24.C: New test.
            * g++.dg/abi/abi-tag24a.C: New test.
            * g++.dg/abi/macro0.C: Adjust expected value.

    gcc/ChangeLog:

            PR c++/98481
            * common.opt (fabi-version): Default to 14.

    gcc/c-family/ChangeLog:

            PR c++/98481
            * c-opts.c (c_common_post_options): Bump latest_abi_version.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/98481] [10 Regression] std::vector<std::string>::size_type as return type gets tagged with abi:cxx11
  2020-12-30 17:25 [Bug c++/98481] New: std::vector<std::string>::size_type as return type gets tagged with abi:cxx11 Daniel.Riley at cornell dot edu
                   ` (7 preceding siblings ...)
  2021-04-01 11:38 ` [Bug c++/98481] [10 " cvs-commit at gcc dot gnu.org
@ 2021-04-01 14:05 ` cvs-commit at gcc dot gnu.org
  2021-04-05 21:36 ` jason at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-04-01 14:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

https://gcc.gnu.org/g:5f00df5925082c7b66da91270f2ed29bf4818c93

commit r11-7951-g5f00df5925082c7b66da91270f2ed29bf4818c93
Author: Jason Merrill <jason@redhat.com>
Date:   Wed Mar 31 17:48:50 2021 -0400

    c++: Add ABI version for PR98481 fix

    The PR98481 fix corrects an ABI regression in GCC 10, but we don't want to
    introduce an ABI change in the middle of the GCC 10 cycle.  This patch
    introduces ABI v15 for the fix, which will be available but not default in
    GCC 10.3; the broken behavior remains in ABI v14.  Compatibility aliases
    will not be generated for this change.

    gcc/ChangeLog:

            PR c++/98481
            * common.opt: Document v15 and v16.

    gcc/c-family/ChangeLog:

            PR c++/98481
            * c-opts.c (c_common_post_options): Bump latest_abi_version.

    gcc/cp/ChangeLog:

            PR c++/98481
            * mangle.c (write_expression): Adjust.
            * class.c (find_abi_tags_r): Disable PR98481 fix for ABI v14.
            (mark_abi_tags_r): Likewise.

    gcc/testsuite/ChangeLog:

            PR c++/98481
            * g++.dg/abi/abi-tag24a.C: New test.
            * g++.dg/abi/macro0.C: Adjust expected value.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/98481] [10 Regression] std::vector<std::string>::size_type as return type gets tagged with abi:cxx11
  2020-12-30 17:25 [Bug c++/98481] New: std::vector<std::string>::size_type as return type gets tagged with abi:cxx11 Daniel.Riley at cornell dot edu
                   ` (8 preceding siblings ...)
  2021-04-01 14:05 ` cvs-commit at gcc dot gnu.org
@ 2021-04-05 21:36 ` jason at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: jason at gcc dot gnu.org @ 2021-04-05 21:36 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #8 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed in 10.3 with explicit -fabi-version=0 or =15.
Fixed in 11 by default.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-04-05 21:36 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-30 17:25 [Bug c++/98481] New: std::vector<std::string>::size_type as return type gets tagged with abi:cxx11 Daniel.Riley at cornell dot edu
2021-01-05 10:48 ` [Bug c++/98481] [10/11 Regression] " rguenth at gcc dot gnu.org
2021-01-07 11:08 ` jakub at gcc dot gnu.org
2021-01-07 11:13 ` jakub at gcc dot gnu.org
2021-01-07 11:13 ` jakub at gcc dot gnu.org
2021-01-07 11:39 ` jakub at gcc dot gnu.org
2021-01-07 12:01 ` jakub at gcc dot gnu.org
2021-01-11 16:15 ` cvs-commit at gcc dot gnu.org
2021-04-01 11:38 ` [Bug c++/98481] [10 " cvs-commit at gcc dot gnu.org
2021-04-01 14:05 ` cvs-commit at gcc dot gnu.org
2021-04-05 21:36 ` jason at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).