public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/57227] New: Two function with identical signature but different calling convention seem to be symbol-encoded by the same string
@ 2013-05-09 13:23 ondrej.kolacek at centrum dot cz
  2021-07-27  2:20 ` [Bug c++/57227] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: ondrej.kolacek at centrum dot cz @ 2013-05-09 13:23 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57227

            Bug ID: 57227
           Summary: Two function with identical signature but different
                    calling convention seem to be symbol-encoded by the
                    same string
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ondrej.kolacek at centrum dot cz

Consider following snippet in which we specialize Decider template with dummyd
and dummye functions which only differ in calling convention:

int dummyd()
{
    return 110;
}

int __attribute__((__stdcall__)) dummye()
{
    return 1;
}

template<typename T>
bool Decider(T && )
{
    return true;
}

int main()
{
    Decider(dummyd);
    Decider(dummye);
    return 0;
}

trying to compile this results into assembler error:
test2.s: Assembler messages:
test2.s:112: Error: symbol `_Z7DeciderIRFivEEbOT_' is already defined

It seems to me that while g++ knows about dummyd and dummye having different
calling convention, it hands to the assembler two equal symbol names.

I have seen one bug which may be duplicate of this - bug 29328, but
1) the issue may be slightly different, as in my case compiler evidently treats
the two specializations as different types
2) the bug is rotting there for 7 years now so making a new one could stir
things up

g++-4.7 -v -save-temps -g test2.cpp -std=c++11 -m32 -Wall -Wextra
Using built-in specs.
COLLECT_GCC=g++-4.7
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.7/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.7.2-5'
--with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs
--enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.7 --enable-shared --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object
--enable-plugin --enable-objc-gc --with-arch-32=i586 --with-tune=generic
--enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu
Thread model: posix
gcc version 4.7.2 (Debian 4.7.2-5)
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-g' '-std=c++11' '-m32' '-Wall'
'-Wextra' '-shared-libgcc' '-mtune=generic' '-march=i586'
 /usr/lib/gcc/x86_64-linux-gnu/4.7/cc1plus -E -quiet -v -imultilib 32
-imultiarch i386-linux-gnu -D_GNU_SOURCE test2.cpp -m32 -mtune=generic
-march=i586 -std=c++11 -Wall -Wextra -g -fworking-directory -fpch-preprocess -o
test2.ii
ignoring nonexistent directory "/usr/local/include/i386-linux-gnu"
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/4.7
 /usr/include/c++/4.7/x86_64-linux-gnu/32
 /usr/include/c++/4.7/backward
 /usr/lib/gcc/x86_64-linux-gnu/4.7/include
 /usr/local/include
 /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed
 /usr/include/i386-linux-gnu
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-g' '-std=c++11' '-m32' '-Wall'
'-Wextra' '-shared-libgcc' '-mtune=generic' '-march=i586'
 /usr/lib/gcc/x86_64-linux-gnu/4.7/cc1plus -fpreprocessed test2.ii -quiet
-dumpbase test2.cpp -m32 -mtune=generic -march=i586 -auxbase test2 -g -Wall
-Wextra -std=c++11 -version -o test2.s
GNU C++ (Debian 4.7.2-5) version 4.7.2 (x86_64-linux-gnu)
        compiled by GNU C version 4.7.2, GMP version 5.0.5, MPFR version
3.1.0-p10, MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C++ (Debian 4.7.2-5) version 4.7.2 (x86_64-linux-gnu)
        compiled by GNU C version 4.7.2, GMP version 5.0.5, MPFR version
3.1.0-p10, MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 66d178dd81da8c975e003e06d9f5e782
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-g' '-std=c++11' '-m32' '-Wall'
'-Wextra' '-shared-libgcc' '-mtune=generic' '-march=i586'
 as -v --32 -o test2.o test2.s
GNU assembler version 2.22 (x86_64-linux-gnu) using BFD version (GNU Binutils
for Debian) 2.22
test2.s: Assembler messages:
test2.s:112: Error: symbol `_Z7DeciderIRFivEEbOT_' is already defined
[kolaceko@lce:~/proj/2/avg/mk]$


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

* [Bug c++/57227] Two function with identical signature but different calling convention seem to be symbol-encoded by the same string
  2013-05-09 13:23 [Bug c++/57227] New: Two function with identical signature but different calling convention seem to be symbol-encoded by the same string ondrej.kolacek at centrum dot cz
@ 2021-07-27  2:20 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-07-27  2:20 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 44282.

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

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

end of thread, other threads:[~2021-07-27  2:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-09 13:23 [Bug c++/57227] New: Two function with identical signature but different calling convention seem to be symbol-encoded by the same string ondrej.kolacek at centrum dot cz
2021-07-27  2:20 ` [Bug c++/57227] " pinskia 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).