[Bug c++/93643] [10 Regression] Static function pointer inside inline function with "C" linkage is not mangled

2020-02-13 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93643

--- Comment #6 from CVS Commits  ---
The master branch has been updated by Jason Merrill :

https://gcc.gnu.org/g:abc79c6498a99e9c39e6056f432796c6dde3a887

commit r10-6628-gabc79c6498a99e9c39e6056f432796c6dde3a887
Author: Jason Merrill 
Date:   Thu Feb 13 16:42:04 2020 +0100

c++: Fix static local vars in extern "C".

Since my patch for PR 91476 moved visibility determination sooner, a local
static in a vague linkage function now gets TREE_PUBLIC set before
retrofit_lang_decl calls set_decl_linkage, which was making decl_linkage
think that it has external linkage.  It still has no linkage according to
the standard.

gcc/cp/ChangeLog
2020-02-13  Jason Merrill  

PR c++/93643
PR c++/91476
* tree.c (decl_linkage): Always lk_none for locals.

[Bug c++/93643] [10 Regression] Static function pointer inside inline function with "C" linkage is not mangled

2020-02-13 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93643

Jason Merrill  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from Jason Merrill  ---
Fixed.

[Bug c++/93643] [10 Regression] Static function pointer inside inline function with "C" linkage is not mangled

2020-02-13 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93643

Jason Merrill  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |jason at gcc dot gnu.org

[Bug c++/93643] [10 Regression] Static function pointer inside inline function with "C" linkage is not mangled

2020-02-10 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93643

--- Comment #4 from Andrew Pinski  ---
(In reply to Iñaki Ucar from comment #3)
> I got no backtrace, just the output shown in my first comment, at least with
> the gcc version included in Fedora Rawhide. I've just attached the test.ii
> file too. With -v:


Yes that is because the GCC is configured with "--enable-checking=release".

[Bug c++/93643] [10 Regression] Static function pointer inside inline function with "C" linkage is not mangled

2020-02-10 Thread iucar at fedoraproject dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93643

--- Comment #3 from Iñaki Ucar  ---
I got no backtrace, just the output shown in my first comment, at least with
the gcc version included in Fedora Rawhide. I've just attached the test.ii file
too. With -v:

$ g++ -v -save-temps test.cpp 
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/10/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap
--enable-languages=c,c++,fortran,objc,obj-c++,ada,go,d,lto --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info
--with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared
--enable-threads=posix --enable-checking=release --enable-multilib
--with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions
--enable-gnu-unique-object --enable-linker-build-id
--with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin
--enable-initfini-array --with-isl --enable-offload-targets=nvptx-none
--without-cuda-driver --enable-gnu-indirect-function --enable-cet
--with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.0.1 20200130 (Red Hat 10.0.1-0.7) (GCC) 
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-shared-libgcc' '-mtune=generic'
'-march=x86-64'
 /usr/libexec/gcc/x86_64-redhat-linux/10/cc1plus -E -quiet -v -D_GNU_SOURCE
test.cpp -mtune=generic -march=x86-64 -fpch-preprocess -o test.ii
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-redhat-linux/10/include-fixed"
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-redhat-linux/10/../../../../x86_64-redhat-linux/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-redhat-linux/10/../../../../include/c++/10

/usr/lib/gcc/x86_64-redhat-linux/10/../../../../include/c++/10/x86_64-redhat-linux
 /usr/lib/gcc/x86_64-redhat-linux/10/../../../../include/c++/10/backward
 /usr/lib/gcc/x86_64-redhat-linux/10/include
 /usr/local/include
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-shared-libgcc' '-mtune=generic'
'-march=x86-64'
 /usr/libexec/gcc/x86_64-redhat-linux/10/cc1plus -fpreprocessed test.ii -quiet
-dumpbase test.cpp -mtune=generic -march=x86-64 -auxbase test -version -o
test.s
GNU C++14 (GCC) version 10.0.1 20200130 (Red Hat 10.0.1-0.7)
(x86_64-redhat-linux)
compiled by GNU C version 10.0.1 20200130 (Red Hat 10.0.1-0.7), GMP
version 6.1.2, MPFR version 4.0.2-p1, MPC version 1.1.0, isl version
isl-0.16.1-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C++14 (GCC) version 10.0.1 20200130 (Red Hat 10.0.1-0.7)
(x86_64-redhat-linux)
compiled by GNU C version 10.0.1 20200130 (Red Hat 10.0.1-0.7), GMP
version 6.1.2, MPFR version 4.0.2-p1, MPC version 1.1.0, isl version
isl-0.16.1-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 80355902cebbb142e87c9570dbf4f6a2
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-shared-libgcc' '-mtune=generic'
'-march=x86-64'
 as -v --64 -o test.o test.s
GNU assembler version 2.34 (x86_64-redhat-linux) using BFD version version
2.34-1.fc32
test.s: Assembler messages:
test.s:41: Error: symbol `f' is already defined

[Bug c++/93643] [10 Regression] Static function pointer inside inline function with "C" linkage is not mangled

2020-02-10 Thread iucar at fedoraproject dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93643

--- Comment #2 from Iñaki Ucar  ---
Created attachment 47811
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47811=edit
test.ii

[Bug c++/93643] [10 Regression] Static function pointer inside inline function with "C" linkage is not mangled

2020-02-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93643

Jakub Jelinek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2020-02-10
 CC||jakub at gcc dot gnu.org,
   ||jason at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Jakub Jelinek  ---
Started with r10-6110-g8158a4640819dbb3210326e37786fb874f450272 , before that
the vars have been mangled - _ZZ2f1E1f, _ZZ2f2E1f .
BTW, I get an ICE instead of assembler-failure:
pr93643.C:25:1: error: Two symbols with same comdat_group are not linked by the
same_comdat_group list.
   25 | }
  | ^
f/2 (void (* f)()) @0x7f7f7a699200
  Type: variable definition analyzed
  Visibility: no_reorder public weak comdat comdat_group:f one_only
  previous sharing asm name: 0
  References: 
  Referring: f2/3 (write)f2/3 (read)
  Availability: not-ready
  Varpool flags:
f/0 (void (* f)()) @0x7f7f7a699180
  Type: variable definition analyzed
  Visibility: no_reorder public weak comdat comdat_group:f one_only
  next sharing asm name: 2
  References: 
  Referring: f1/1 (write)f1/1 (read)
  Availability: not-ready
  Varpool flags:
pr93643.C:25:1: internal compiler error: symtab_node::verify failed
0xe54eff symtab_node::verify_symtab_nodes()
../../gcc/symtab.c:1342
0xe7cf94 symtab_node::checking_verify_symtab_nodes()
../../gcc/cgraph.h:667
0xe7b065 symbol_table::compile()
../../gcc/cgraphunit.c:2720
0xe7b696 symbol_table::finalize_compilation_unit()
../../gcc/cgraphunit.c:2984
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.
assembler-failure only if -fno-checking.

[Bug c++/93643] [10 Regression] Static function pointer inside inline function with "C" linkage is not mangled

2020-02-10 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93643

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P1

[Bug c++/93643] [10 Regression] Static function pointer inside inline function with "C" linkage is not mangled

2020-02-09 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93643

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||assemble-failure,
   ||wrong-code
   Target Milestone|--- |10.0
Summary|Static function pointer |[10 Regression] Static
   |inside inline function with |function pointer inside
   |"C" linkage is not mangled  |inline function with "C"
   ||linkage is not mangled
   Severity|normal  |blocker