public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/106820] New: internal compiler error: in function_and_variable_visibility [for std::dynamic_pointer_cast use via <memory> module]
@ 2022-09-02 20:48 markmigm at gmail dot com
  2022-09-03 20:56 ` [Bug c++/106820] " markmigm at gmail dot com
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: markmigm at gmail dot com @ 2022-09-02 20:48 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 106820
           Summary: internal compiler error: in
                    function_and_variable_visibility [for
                    std::dynamic_pointer_cast use via <memory> module]
           Product: gcc
           Version: 12.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: markmigm at gmail dot com
  Target Milestone: ---

Failing command sequence (from a FreeBSD context) for a reduced/small test
case:

// g++12 -std=c++20 -fmodules-ts -xc++-system-header memory
// g++12 -std=c++20 -freport-bug -fmodules-ts -c
gpp12_module_dynamic_pointer_cast_failure.cpp

For:

# more /tmp/ccvYB09K.out
// Target: aarch64-portbld-freebsd14.0
// Configured with: /wrkdirs/usr/ports/lang/gcc12/work/gcc-12.2.0/configure
--disable-multilib --disable-bootstrap --disable-nls
--enable-gnu-indirect-function --enable-host-shared --enable-plugin
--libdir=/usr/local/lib/gcc12 --libexecdir=/usr/local/libexec/gcc12
--program-suffix=12 --with-as=/usr/local/bin/as --with-gmp=/usr/local
--with-gxx-include-dir=/usr/local/lib/gcc12/include/c++/
--with-gxx-libcxx-include-dir=/usr/include/c++/v1 --with-ld=/usr/local/bin/ld
--with-pkgversion='FreeBSD Ports Collection' --with-system-zlib --without-zstd
--enable-languages=c,c++,objc,fortran,jit --prefix=/usr/local
--localstatedir=/var --mandir=/usr/local/man
--infodir=/usr/local/share/info/gcc12 --build=aarch64-portbld-freebsd14.0
// Thread model: posix
// Supported LTO compression algorithms: zlib
// gcc version 12.2.0 (FreeBSD Ports Collection) 
// 
// during IPA pass: visibility
// gpp12_module_dynamic_pointer_cast_failure.cpp:21:1: internal compiler error:
in function_and_variable_visibility, at ipa-visibility.cc:716
//    21 | }
//       | ^
// Please submit a full bug report, with preprocessed source.
// See <https://gcc.gnu.org/bugs/> for instructions.

// /usr/local/libexec/gcc12/gcc/aarch64-portbld-freebsd14.0/12.2.0/cc1plus
-quiet gpp12_module_dynamic_pointer_cast_failure.cpp -quiet -dumpbase
gpp12_module_dynamic_pointer_cast_failure.cpp -dumpbase-ext .cpp
-mlittle-endian -mabi=lp64 -std=c++20 -freport-bug -fmodules-ts -o -
-frandom-seed=0 -fdump-noaddr

# 0 "gpp12_module_dynamic_pointer_cast_failure.cpp"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "gpp12_module_dynamic_pointer_cast_failure.cpp"
# 11 "gpp12_module_dynamic_pointer_cast_failure.cpp"
import  "/usr/local/lib/gcc12/include/c++/memory";

struct data
{
 virtual ~data() = default;
};

void test(std::shared_ptr<data> b)
{
 auto dpc = std::dynamic_pointer_cast<data>(b);
}

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

* [Bug c++/106820] internal compiler error: in function_and_variable_visibility [for std::dynamic_pointer_cast use via <memory> module]
  2022-09-02 20:48 [Bug c++/106820] New: internal compiler error: in function_and_variable_visibility [for std::dynamic_pointer_cast use via <memory> module] markmigm at gmail dot com
@ 2022-09-03 20:56 ` markmigm at gmail dot com
  2022-09-05  8:01 ` [Bug c++/106820] internal compiler error: in function_and_variable_visibility [for std::shared_ptr<data>{b,??} " markmigm at gmail dot com
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: markmigm at gmail dot com @ 2022-09-03 20:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Mark Millard <markmigm at gmail dot com> ---
(In reply to Mark Millard from comment #0)
> Failing command sequence (from a FreeBSD context) for a reduced/small test
> case:
> 
> // g++12 -std=c++20 -fmodules-ts -xc++-system-header memory
> // g++12 -std=c++20 -freport-bug -fmodules-ts -c
> gpp12_module_dynamic_pointer_cast_failure.cpp
. . .

I've now tried this on fedora 36 with copies of the source code
and got no failure in the fedora context. This was with:

# c++ -v
Using built-in specs.
COLLECT_GCC=c++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/aarch64-redhat-linux/12/lto-wrapper
Target: aarch64-redhat-linux
Configured with: ../configure --enable-bootstrap
--enable-languages=c,c++,fortran,objc,obj-c++,ada,go,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 --enable-libstdcxx-backtrace
--with-linker-hash-style=gnu --enable-plugin --enable-initfini-array
--with-isl=/builddir/build/BUILD/gcc-12.2.1-20220819/obj-aarch64-redhat-linux/isl-install
--enable-gnu-indirect-function --build=aarch64-redhat-linux
--with-build-config=bootstrap-lto --enable-link-serialization=1
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.2.1 20220819 (Red Hat 12.2.1-1) (GCC) 

# uname -ap
Linux usbfedora 5.17.8-300.fc36.aarch64 #1 SMP Mon May 16 00:40:35 UTC 2022
aarch64 aarch64 aarch64 GNU/Linux

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

* [Bug c++/106820] internal compiler error: in function_and_variable_visibility [for std::shared_ptr<data>{b,??} use via <memory> module]
  2022-09-02 20:48 [Bug c++/106820] New: internal compiler error: in function_and_variable_visibility [for std::dynamic_pointer_cast use via <memory> module] markmigm at gmail dot com
  2022-09-03 20:56 ` [Bug c++/106820] " markmigm at gmail dot com
@ 2022-09-05  8:01 ` markmigm at gmail dot com
  2022-09-07 20:10 ` markmigm at gmail dot com
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: markmigm at gmail dot com @ 2022-09-05  8:01 UTC (permalink / raw)
  To: gcc-bugs

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

Mark Millard <markmigm at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|internal compiler error: in |internal compiler error: in
                   |function_and_variable_visib |function_and_variable_visib
                   |ility [for                  |ility [for
                   |std::dynamic_pointer_cast   |std::shared_ptr<data>{b,??}
                   |use via <memory> module]    |use via <memory> module]

--- Comment #2 from Mark Millard <markmigm at gmail dot com> ---
I've produced a more reduced example source:

import <memory>;

struct data
{
        virtual ~data() = default;
};

auto test(std::shared_ptr<data> b)
{
        return std::shared_ptr<data>{b,nullptr};
}


nullptr is not special here: other alternative raw pointers also get
the "internal compiler error: in function_and_variable_visibility"
notice. nullptr is just the simplest example.

Using a #include instead also gets the error (as expected) --unless
the -fmodules-ts command line option is then omitted. -fmodules-ts
is important to getting the message in the FreeBSD lang/gcc12 context.

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

* [Bug c++/106820] internal compiler error: in function_and_variable_visibility [for std::shared_ptr<data>{b,??} use via <memory> module]
  2022-09-02 20:48 [Bug c++/106820] New: internal compiler error: in function_and_variable_visibility [for std::dynamic_pointer_cast use via <memory> module] markmigm at gmail dot com
  2022-09-03 20:56 ` [Bug c++/106820] " markmigm at gmail dot com
  2022-09-05  8:01 ` [Bug c++/106820] internal compiler error: in function_and_variable_visibility [for std::shared_ptr<data>{b,??} " markmigm at gmail dot com
@ 2022-09-07 20:10 ` markmigm at gmail dot com
  2022-09-07 20:43 ` markmigm at gmail dot com
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: markmigm at gmail dot com @ 2022-09-07 20:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Mark Millard <markmigm at gmail dot com> ---
(In reply to Mark Millard from comment #2)

I managed to build lang/gcc12 with -g -O0 in use and so
can report:

The failing assert looks like:

      gcc_assert ((!DECL_WEAK (node->decl)
                  && !DECL_COMDAT (node->decl))
                  || TREE_PUBLIC (node->decl)
                  || node->weakref

                  || DECL_EXTERNAL (node->decl));

And in a debugger I see:

(lldb) print node->decl->decl_with_vis.weak_flag
(unsigned int) $2 = 1
(lldb) print node->decl->decl_with_vis.comdat_flag
(unsigned int) $3 = 0
(lldb) print node->weakref
(unsigned int) $4 = 0
(lldb) print node->decl->decl_common.decl_flag_1
(unsigned int) $5 = 0

and:

(lldb) call debug_tree(node->decl)
 <function_decl 0x9986ca00 __gthrw_pthread_mutex_unlock
    type <function_type 0x939e7e70
        type <integer_type 0x8cd415e8 int sizes-gimplified public type_6 SI
            size <integer_cst 0x8cd40258 constant 32>
            unit-size <integer_cst 0x8cd40270 constant 4>
            align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x8cd415e8 precision:32 min <integer_cst 0x8cd40210 -2147483648> max
<integer_cst 0x8cd40228 2147483647>
            pointer_to_this <pointer_type 0x8cd48a80> reference_to_this
<reference_type 0x9bb63000>>
        SI size <integer_cst 0x8cd40258 32> unit-size <integer_cst 0x8cd40270
4>
        align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x939e7f18
        arg-types <tree_list 0x9986d168 value <pointer_type 0x939e7a80>
            chain <tree_list 0x8cd2b938 value <void_type 0x8cd41f18 void>>>
        pointer_to_this <pointer_type 0x99870150>>
    addressable used static tree_3 weak in_system_header decl_5 decl_6 DI
/usr/local/lib/gcc12/include/c++/aarch64-portbld-freebsd14.0/bits/gthr-default.h:121:1
align:32 warn_if_not_align:0 context <translation_unit_decl 0x8cd3e000
module_shared_ptr_alias_construction_failure.cpp>
    attributes <tree_list 0x9986d230
        purpose <identifier_node 0x939ca980 alias
            normal local bindings <0x0>>
        value <tree_list 0x9986d258
            value <string_cst 0x939c6d80 type <array_type 0x939e77e0>
                readonly constant static "pthread_mutex_unlock\000">>
        chain <tree_list 0x9986d280
            purpose <identifier_node 0x939ca9c0 weakref
                normal local bindings <0x0>>>>
    full-name "int __gthrw_pthread_mutex_unlock(pthread_mutex**)"
    module 1:/usr/local/lib/gcc12/include/c++/memory exported chain
<function_decl 0x9986c900 __gthread_trigger>>

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

* [Bug c++/106820] internal compiler error: in function_and_variable_visibility [for std::shared_ptr<data>{b,??} use via <memory> module]
  2022-09-02 20:48 [Bug c++/106820] New: internal compiler error: in function_and_variable_visibility [for std::dynamic_pointer_cast use via <memory> module] markmigm at gmail dot com
                   ` (2 preceding siblings ...)
  2022-09-07 20:10 ` markmigm at gmail dot com
@ 2022-09-07 20:43 ` markmigm at gmail dot com
  2022-09-07 22:21 ` [Bug c++/106820] [modules] internal compiler error: in function_and_variable_visibility [for std::shared_ptr<data>{b,??} use via <memory> header unit]: mishandling of "weak" usage generated via __gthrw(pthread_mutex_unlock) use markmigm at gmail dot com
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: markmigm at gmail dot com @ 2022-09-07 20:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Mark Millard <markmigm at gmail dot com> ---
(In reply to Mark Millard from comment #3)

> . . .
> And in a debugger I see:
> 
> (lldb) print node->decl->decl_with_vis.weak_flag
> (unsigned int) $2 = 1
> (lldb) print node->decl->decl_with_vis.comdat_flag
> (unsigned int) $3 = 0
> (lldb) print node->weakref
> (unsigned int) $4 = 0
> (lldb) print node->decl->decl_common.decl_flag_1
> (unsigned int) $5 = 0
> 
> and:
> 
> (lldb) call debug_tree(node->decl)
>  <function_decl 0x9986ca00 __gthrw_pthread_mutex_unlock
>     type <function_type 0x939e7e70
>         type <integer_type 0x8cd415e8 int sizes-gimplified public type_6 SI
>             size <integer_cst 0x8cd40258 constant 32>
>             unit-size <integer_cst 0x8cd40270 constant 4>
>             align:32 warn_if_not_align:0 symtab:0 alias-set -1
> canonical-type 0x8cd415e8 precision:32 min <integer_cst 0x8cd40210
> -2147483648> max <integer_cst 0x8cd40228 2147483647>
>             pointer_to_this <pointer_type 0x8cd48a80> reference_to_this
> <reference_type 0x9bb63000>>
>         SI size <integer_cst 0x8cd40258 32> unit-size <integer_cst
> 0x8cd40270 4>
>         align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
> 0x939e7f18
>         arg-types <tree_list 0x9986d168 value <pointer_type 0x939e7a80>
>             chain <tree_list 0x8cd2b938 value <void_type 0x8cd41f18 void>>>
>         pointer_to_this <pointer_type 0x99870150>>
>     addressable used static tree_3 weak in_system_header decl_5 decl_6 DI
> /usr/local/lib/gcc12/include/c++/aarch64-portbld-freebsd14.0/bits/gthr-
> default.h:121:1 align:32 warn_if_not_align:0 context <translation_unit_decl
> 0x8cd3e000 module_shared_ptr_alias_construction_failure.cpp>
>     attributes <tree_list 0x9986d230
>         purpose <identifier_node 0x939ca980 alias
>             normal local bindings <0x0>>
>         value <tree_list 0x9986d258
>             value <string_cst 0x939c6d80 type <array_type 0x939e77e0>
>                 readonly constant static "pthread_mutex_unlock\000">>
>         chain <tree_list 0x9986d280
>             purpose <identifier_node 0x939ca9c0 weakref
>                 normal local bindings <0x0>>>>
>     full-name "int __gthrw_pthread_mutex_unlock(pthread_mutex**)"
>     module 1:/usr/local/lib/gcc12/include/c++/memory exported chain
> <function_decl 0x9986c900 __gthread_trigger>>

And, sure enough, __gthrw_pthread_mutex_unlock looks to involve "weak" via
https://github.com/gcc-mirror/gcc/blob/master/libgcc/gthr-posix.h having
in use:

# define __gthrw2(name,name2,type) \
  static __typeof(type) name \
    __attribute__ ((__weakref__(#name2), __copy__ (type))); \
  __gthrw_pragma(weak type)
. . .
/* Typically, __gthrw_foo is a weak reference to symbol foo.  */
#define __gthrw(name) __gthrw2(__gthrw_ ## name,name,name)
. . .
__gthrw(pthread_mutex_unlock)

There could be more examples of the type of issue but the build stops
at the first to fail the gcc_assert.

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

* [Bug c++/106820] [modules] internal compiler error: in function_and_variable_visibility [for std::shared_ptr<data>{b,??} use via <memory> header unit]: mishandling of "weak" usage generated via __gthrw(pthread_mutex_unlock) use
  2022-09-02 20:48 [Bug c++/106820] New: internal compiler error: in function_and_variable_visibility [for std::dynamic_pointer_cast use via <memory> module] markmigm at gmail dot com
                   ` (3 preceding siblings ...)
  2022-09-07 20:43 ` markmigm at gmail dot com
@ 2022-09-07 22:21 ` markmigm at gmail dot com
  2022-10-12  9:34 ` redi at gcc dot gnu.org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: markmigm at gmail dot com @ 2022-09-07 22:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Mark Millard <markmigm at gmail dot com> ---
I probably should have reported the backtrace when fancy_abort
has been called (stopped there via breakpoint):

(lldb) bt
* thread #1, name = 'cc1plus', stop reason = breakpoint 1.1
  * frame #0: 0x0000000002e43108
cc1plus`fancy_abort(file="/wrkdirs/usr/ports/lang/gcc12/work/gcc-12.2.0/gcc/ipa-visibility.cc",
line=716, function="function_and_variable_visibility") at diagnostic.cc:2024:7
    frame #1: 0x00000000022ca8ac
cc1plus`function_and_variable_visibility(whole_program=false) at
ipa-visibility.cc:712:7
    frame #2: 0x00000000022cc768
cc1plus`pass_ipa_function_and_variable_visibility::execute(this=0x000000008bc7a600,
(null)=0x0000000000000000) at ipa-visibility.cc:993:14
    frame #3: 0x0000000002474ca8
cc1plus`execute_one_pass(pass=0x000000008bc7a600) at passes.cc:2638:22
    frame #4: 0x0000000002476890
cc1plus`execute_ipa_pass_list(pass=0x000000008bc7a600) at passes.cc:3078:11
    frame #5: 0x0000000001ad7794 cc1plus`ipa_passes() at cgraphunit.cc:2161:7
    frame #6: 0x0000000001ad7448
cc1plus`symbol_table::compile(this=0x000000008dd5c000) at cgraphunit.cc:2282:5
    frame #7: 0x0000000001ad88c0
cc1plus`symbol_table::finalize_compilation_unit(this=0x000000008dd5c000) at
cgraphunit.cc:2530:3
    frame #8: 0x0000000002786338 cc1plus`compile_file() at toplev.cc:479:15
    frame #9: 0x000000000278568c cc1plus`do_compile(no_backend=false) at
toplev.cc:2144:11
    frame #10: 0x0000000002783b88 cc1plus`toplev::main(this=0x00000000837baafe,
argc=17, argv=0x00000000837bab68) at toplev.cc:2296:7
    frame #11: 0x0000000002e1da3c cc1plus`main(argc=17,
argv=0x00000000837bab68) at main.cc:39:18
    frame #12: 0x000000000105b448 cc1plus`__start(argc=17,
argv=0x00000000837bab68, env=0x00000000837babf8, cleanup=<unavailable>) at
crt1_c.c:72:7
    frame #13: 0x000031f1ad9570d8 ld-elf.so.1`.rtld_start at rtld_start.S:41

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

* [Bug c++/106820] [modules] internal compiler error: in function_and_variable_visibility [for std::shared_ptr<data>{b,??} use via <memory> header unit]: mishandling of "weak" usage generated via __gthrw(pthread_mutex_unlock) use
  2022-09-02 20:48 [Bug c++/106820] New: internal compiler error: in function_and_variable_visibility [for std::dynamic_pointer_cast use via <memory> module] markmigm at gmail dot com
                   ` (4 preceding siblings ...)
  2022-09-07 22:21 ` [Bug c++/106820] [modules] internal compiler error: in function_and_variable_visibility [for std::shared_ptr<data>{b,??} use via <memory> header unit]: mishandling of "weak" usage generated via __gthrw(pthread_mutex_unlock) use markmigm at gmail dot com
@ 2022-10-12  9:34 ` redi at gcc dot gnu.org
  2022-10-12  9:36 ` redi at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2022-10-12  9:34 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Mark Millard from comment #1)
> I've now tried this on fedora 36 with copies of the source code
> and got no failure in the fedora context.

That will be because we no longer use weak symbols for pthreads when linking to
glibc 2.34 or later (as found in recent Fedora releases).

I think I should be able to reproduce this on linux with an older glibc, or
with libstdc++ modified to use weak symbols again. Trying that now ...

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

* [Bug c++/106820] [modules] internal compiler error: in function_and_variable_visibility [for std::shared_ptr<data>{b,??} use via <memory> header unit]: mishandling of "weak" usage generated via __gthrw(pthread_mutex_unlock) use
  2022-09-02 20:48 [Bug c++/106820] New: internal compiler error: in function_and_variable_visibility [for std::dynamic_pointer_cast use via <memory> module] markmigm at gmail dot com
                   ` (5 preceding siblings ...)
  2022-10-12  9:34 ` redi at gcc dot gnu.org
@ 2022-10-12  9:36 ` redi at gcc dot gnu.org
  2022-10-12  9:44 ` redi at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2022-10-12  9:36 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andreemalcher at gmail dot com

--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> ---
*** Bug 100584 has been marked as a duplicate of this bug. ***

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

* [Bug c++/106820] [modules] internal compiler error: in function_and_variable_visibility [for std::shared_ptr<data>{b,??} use via <memory> header unit]: mishandling of "weak" usage generated via __gthrw(pthread_mutex_unlock) use
  2022-09-02 20:48 [Bug c++/106820] New: internal compiler error: in function_and_variable_visibility [for std::dynamic_pointer_cast use via <memory> module] markmigm at gmail dot com
                   ` (6 preceding siblings ...)
  2022-10-12  9:36 ` redi at gcc dot gnu.org
@ 2022-10-12  9:44 ` redi at gcc dot gnu.org
  2022-10-12 14:29 ` ppalka at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2022-10-12  9:44 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
           Keywords|                            |visibility
   Last reconfirmed|                            |2022-10-12
             Status|UNCONFIRMED                 |NEW

--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #6)
> I think I should be able to reproduce this on linux with an older glibc, or
> with libstdc++ modified to use weak symbols again. Trying that now ...

Confirmed. The ICE is still present on trunk.

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

* [Bug c++/106820] [modules] internal compiler error: in function_and_variable_visibility [for std::shared_ptr<data>{b,??} use via <memory> header unit]: mishandling of "weak" usage generated via __gthrw(pthread_mutex_unlock) use
  2022-09-02 20:48 [Bug c++/106820] New: internal compiler error: in function_and_variable_visibility [for std::dynamic_pointer_cast use via <memory> module] markmigm at gmail dot com
                   ` (7 preceding siblings ...)
  2022-10-12  9:44 ` redi at gcc dot gnu.org
@ 2022-10-12 14:29 ` ppalka at gcc dot gnu.org
  2024-04-14 16:50 ` [Bug c++/106820] [modules] ICE in function_and_variable_visibility with modules and weakref ppalka at gcc dot gnu.org
  2024-04-30 17:06 ` ppalka at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: ppalka at gcc dot gnu.org @ 2022-10-12 14:29 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ppalka at gcc dot gnu.org
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=104433

--- Comment #9 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Reduced:

$ cat 106820_a.H
static int __gthrw___pthread_key_create() __attribute__((__weakref__("foo")));

$ cat 106820_b.C
import "106820_a.H";

int main() {
  __gthrw___pthread_key_create();
}

$ g++ -fmodules-ts 106820_a.H 106820_b.C
106820_b.C:5:1: internal compiler error: in function_and_variable_visibility,
at ipa-visibility.cc:712

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

* [Bug c++/106820] [modules] ICE  in function_and_variable_visibility with modules and weakref
  2022-09-02 20:48 [Bug c++/106820] New: internal compiler error: in function_and_variable_visibility [for std::dynamic_pointer_cast use via <memory> module] markmigm at gmail dot com
                   ` (8 preceding siblings ...)
  2022-10-12 14:29 ` ppalka at gcc dot gnu.org
@ 2024-04-14 16:50 ` ppalka at gcc dot gnu.org
  2024-04-30 17:06 ` ppalka at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: ppalka at gcc dot gnu.org @ 2024-04-14 16:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Patrick Palka <ppalka at gcc dot gnu.org> ---
The master branch has been updated by Nathaniel Shead <nshead@gcc.gnu.org>:

https://gcc.gnu.org/g:62a0ef0d02cbb74cd865c1db2ecb7ca1b11f87cd

commit r14-9959-g62a0ef0d02cbb74cd865c1db2ecb7ca1b11f87cd
Author: Nathaniel Shead <nathanieloshead@gmail.com>
Date:   Sat Feb 17 23:10:49 2024 +1100

    c++: Setup aliases imported from modules [PR106820]

    I wonder if more generally we need to be doing more work when importing
    definitions from header units especially to handle all the work that
    'make_rtl_for_nonlocal_decl' and 'rest_of_decl_compilation' would have
    been performing. But this patch fixes at least one missing step.

            PR c++/106820

    gcc/cp/ChangeLog:

            * module.cc (trees_in::decl_value): Assemble alias when needed.

    gcc/testsuite/ChangeLog:

            * g++.dg/modules/pr106820_a.H: New test.
            * g++.dg/modules/pr106820_b.C: New test.

    Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>

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

* [Bug c++/106820] [modules] ICE  in function_and_variable_visibility with modules and weakref
  2022-09-02 20:48 [Bug c++/106820] New: internal compiler error: in function_and_variable_visibility [for std::dynamic_pointer_cast use via <memory> module] markmigm at gmail dot com
                   ` (9 preceding siblings ...)
  2024-04-14 16:50 ` [Bug c++/106820] [modules] ICE in function_and_variable_visibility with modules and weakref ppalka at gcc dot gnu.org
@ 2024-04-30 17:06 ` ppalka at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: ppalka at gcc dot gnu.org @ 2024-04-30 17:06 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED
   Target Milestone|---                         |14.0

--- Comment #11 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Fixed for GCC 14(?)

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

end of thread, other threads:[~2024-04-30 17:06 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-02 20:48 [Bug c++/106820] New: internal compiler error: in function_and_variable_visibility [for std::dynamic_pointer_cast use via <memory> module] markmigm at gmail dot com
2022-09-03 20:56 ` [Bug c++/106820] " markmigm at gmail dot com
2022-09-05  8:01 ` [Bug c++/106820] internal compiler error: in function_and_variable_visibility [for std::shared_ptr<data>{b,??} " markmigm at gmail dot com
2022-09-07 20:10 ` markmigm at gmail dot com
2022-09-07 20:43 ` markmigm at gmail dot com
2022-09-07 22:21 ` [Bug c++/106820] [modules] internal compiler error: in function_and_variable_visibility [for std::shared_ptr<data>{b,??} use via <memory> header unit]: mishandling of "weak" usage generated via __gthrw(pthread_mutex_unlock) use markmigm at gmail dot com
2022-10-12  9:34 ` redi at gcc dot gnu.org
2022-10-12  9:36 ` redi at gcc dot gnu.org
2022-10-12  9:44 ` redi at gcc dot gnu.org
2022-10-12 14:29 ` ppalka at gcc dot gnu.org
2024-04-14 16:50 ` [Bug c++/106820] [modules] ICE in function_and_variable_visibility with modules and weakref ppalka at gcc dot gnu.org
2024-04-30 17:06 ` ppalka 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).