public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/106230] New: ICE when building folly-2022.07.04.00 in pop_local_binding (cp/name-lookup.cc:2474)
@ 2022-07-08  7:03 sam at gentoo dot org
  2022-07-08  7:05 ` [Bug c++/106230] " sam at gentoo dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: sam at gentoo dot org @ 2022-07-08  7:03 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 106230
           Summary: ICE when building folly-2022.07.04.00 in
                    pop_local_binding (cp/name-lookup.cc:2474)
           Product: gcc
           Version: 12.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sam at gentoo dot org
  Target Milestone: ---

Created attachment 53274
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53274&action=edit
ccHXKhJc.ii.orig (original preprocessed source)

Hit this when building folly-2022.07.04.00 with 12.1.1_p20220702.

I've attached the original reproducer but I'll attach a minimised version
shortly too.

```
[484/826] /usr/lib/ccache/bin/x86_64-pc-linux-gnu-g++ -DBOOST_ATOMIC_DYN_LINK
-DBOOST_ATOMIC_NO_LIB -DBOOST_CONTEXT_DYN_LINK -DBOOST_CONTEXT_NO_LIB
-DBOOST_FILESYSTEM_DYN_LINK -DBOOST_FILESYSTEM_NO_LIB
-DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_PROGRAM_OPTIONS_NO_LIB
-DBOOST_REGEX_DYN_LINK -DBOOST_REGEX_NO_LIB -DBOOST_SYSTEM_DYN_LINK
-DBOOST_SYSTEM_NO_LIB -DBOOST_THREAD_DYN_LINK -DBOOST_THREAD_NO_LIB
-DFMT_SHARED
-DFOLLY_XLOG_STRIP_PREFIXES=\"/var/tmp/portage/dev-cpp/folly-2022.07.04.00/work:/var/tmp/portage/dev-cpp/folly-2022.07.04.00/work_build\"
-DGFLAGS_IS_A_DLL=0 -DGTEST_LINKED_AS_SHARED_LIBRARY=1 -D_GNU_SOURCE
-D_REENTRANT -I/var/tmp/portage/dev-cpp/folly-2022.07.04.00/work
-I/var/tmp/portage/dev-cpp/folly-2022.07.04.00/work_build
-I/usr/include/libiberty  -O2 -pipe -march=native -fdiagnostics-color=always
-frecord-gcc-switches -D_GLIBCXX_ASSERTIONS -ggdb3 -Werror=format-security
-Wformat -g -std=gnu++1z -finput-charset=UTF-8 -fsigned-char -Wall
-Wno-deprecated -Wno-deprecated-declarations -Wno-sign-compare -Wno-unused
-Wuninitialized -Wunused-label -Wunused-result -Wno-noexcept-type
-Wno-nullability-completeness -Wno-inconsistent-missing-override -faligned-new
-fopenmp -std=gnu++17 -MD -MT
CMakeFiles/atomic_util_test.dir/folly/synchronization/test/AtomicUtilTest.cpp.o
-MF
CMakeFiles/atomic_util_test.dir/folly/synchronization/test/AtomicUtilTest.cpp.o.d
-o
CMakeFiles/atomic_util_test.dir/folly/synchronization/test/AtomicUtilTest.cpp.o
-c
/var/tmp/portage/dev-cpp/folly-2022.07.04.00/work/folly/synchronization/test/AtomicUtilTest.cpp
FAILED:
CMakeFiles/atomic_util_test.dir/folly/synchronization/test/AtomicUtilTest.cpp.o
/usr/lib/ccache/bin/x86_64-pc-linux-gnu-g++ -DBOOST_ATOMIC_DYN_LINK
-DBOOST_ATOMIC_NO_LIB -DBOOST_CONTEXT_DYN_LINK -DBOOST_CONTEXT_NO_LIB
-DBOOST_FILESYSTEM_DYN_LINK -DBOOST_FILESYSTEM_NO_LIB
-DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_PROGRAM_OPTIONS_NO_LIB
-DBOOST_REGEX_DYN_LINK -DBOOST_REGEX_NO_LIB -DBOOST_SYSTEM_DYN_LINK
-DBOOST_SYSTEM_NO_LIB -DBOOST_THREAD_DYN_LINK -DBOOST_THREAD_NO_LIB
-DFMT_SHARED
-DFOLLY_XLOG_STRIP_PREFIXES=\"/var/tmp/portage/dev-cpp/folly-2022.07.04.00/work:/var/tmp/portage/dev-cpp/folly-2022.07.04.00/work_build\"
-DGFLAGS_IS_A_DLL=0 -DGTEST_LINKED_AS_SHARED_LIBRARY=1 -D_GNU_SOURCE
-D_REENTRANT -I/var/tmp/portage/dev-cpp/folly-2022.07.04.00/work
-I/var/tmp/portage/dev-cpp/folly-2022.07.04.00/work_build
-I/usr/include/libiberty  -O2 -pipe -march=native -fdiagnostics-color=always
-frecord-gcc-switches -D_GLIBCXX_ASSERTIONS -ggdb3 -Werror=format-security
-Wformat -g -std=gnu++1z -finput-charset=UTF-8 -fsigned-char -Wall
-Wno-deprecated -Wno-deprecated-declarations -Wno-sign-compare -Wno-unused
-Wuninitialized -Wunused-label -Wunused-result -Wno-noexcept-type
-Wno-nullability-completeness -Wno-inconsistent-missing-override -faligned-new
-fopenmp -std=gnu++17 -MD -MT
CMakeFiles/atomic_util_test.dir/folly/synchronization/test/AtomicUtilTest.cpp.o
-MF
CMakeFiles/atomic_util_test.dir/folly/synchronization/test/AtomicUtilTest.cpp.o.d
-o
CMakeFiles/atomic_util_test.dir/folly/synchronization/test/AtomicUtilTest.cpp.o
-c
/var/tmp/portage/dev-cpp/folly-2022.07.04.00/work/folly/synchronization/test/AtomicUtilTest.cpp
/var/tmp/portage/dev-cpp/folly-2022.07.04.00/work/folly/synchronization/test/AtomicUtilTest.cpp:
In instantiation of ‘void folly::{anonymous}::atomic_fetch_flip_basic(Op) [with
TypeParam = atomic_ref_of<std::atomic>; Integer = short unsigned int; Op =
with_order<folly::atomic_fetch_flip_fn>]’:
/var/tmp/portage/dev-cpp/folly-2022.07.04.00/work/folly/synchronization/test/AtomicUtilTest.cpp:385:52:
  required from ‘void
folly::gtest_suite_AtomicFetchFlipTest_::Basic<gtest_TypeParam_>::TestBody()
[with gtest_TypeParam_ = folly::{anonymous}::atomic_ref_of<std::atomic>]’
/var/tmp/portage/dev-cpp/folly-2022.07.04.00/work/folly/synchronization/test/AtomicUtilTest.cpp:382:1:
  required from here
/var/tmp/portage/dev-cpp/folly-2022.07.04.00/work/folly/synchronization/test/AtomicUtilTest.cpp:241:3:
internal compiler error: in pop_local_binding, at cp/name-lookup.cc:2474
  241 |   for (ref_ atomic : std::array<obj_, Size>{}) {
      |   ^~~
0x72069f pop_local_binding(tree_node*, tree_node*)
       
/usr/src/debug/sys-devel/gcc-12.1.1_p20220702/gcc-12-20220702/gcc/cp/name-lookup.cc:2474
0x72069f poplevel(int, int, int)
       
/usr/src/debug/sys-devel/gcc-12.1.1_p20220702/gcc-12-20220702/gcc/cp/decl.cc:733
0x13a626c do_poplevel(tree_node*)
       
/usr/src/debug/sys-devel/gcc-12.1.1_p20220702/gcc-12-20220702/gcc/cp/semantics.cc:640
0x14f98c5 finish_for_stmt(tree_node*)
       
/usr/src/debug/sys-devel/gcc-12.1.1_p20220702/gcc-12-20220702/gcc/cp/semantics.cc:1399
0x15c481e tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
       
/usr/src/debug/sys-devel/gcc-12.1.1_p20220702/gcc-12-20220702/gcc/cp/pt.cc:18768
0x15c42ff tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
       
/usr/src/debug/sys-devel/gcc-12.1.1_p20220702/gcc-12-20220702/gcc/cp/pt.cc:18507
0x15c41f4 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
       
/usr/src/debug/sys-devel/gcc-12.1.1_p20220702/gcc-12-20220702/gcc/cp/pt.cc:18864
0x163cc24 instantiate_body
       
/usr/src/debug/sys-devel/gcc-12.1.1_p20220702/gcc-12-20220702/gcc/cp/pt.cc:26466
0x163ab56 instantiate_decl(tree_node*, bool, bool)
       
/usr/src/debug/sys-devel/gcc-12.1.1_p20220702/gcc-12-20220702/gcc/cp/pt.cc:26758
0x1309d40 instantiate_pending_templates(int)
       
/usr/src/debug/sys-devel/gcc-12.1.1_p20220702/gcc-12-20220702/gcc/cp/pt.cc:26837
0x1302380 c_parse_final_cleanups()
       
/usr/src/debug/sys-devel/gcc-12.1.1_p20220702/gcc-12-20220702/gcc/cp/decl2.cc:5128
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://bugs.gentoo.org/> for instructions.
```

```
$ gcc --version
gcc (Gentoo Hardened 12.1.1_p20220702 p8) 12.1.1 20220702
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
```

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

* [Bug c++/106230] ICE when building folly-2022.07.04.00 in pop_local_binding (cp/name-lookup.cc:2474)
  2022-07-08  7:03 [Bug c++/106230] New: ICE when building folly-2022.07.04.00 in pop_local_binding (cp/name-lookup.cc:2474) sam at gentoo dot org
@ 2022-07-08  7:05 ` sam at gentoo dot org
  2022-07-08  7:11 ` sam at gentoo dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: sam at gentoo dot org @ 2022-07-08  7:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Sam James <sam at gentoo dot org> ---
Created attachment 53275
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53275&action=edit
ccHXKhJc.ii (minimised reproducer)

I think I need to re-run cvise because the minimised version doesn't build with
Clang, but the original does.

For the reduced version:
```
$ g++ -c ccHXKhJc.ii
ccHXKhJc.ii: In static member function ‘static bool
TypeParameterizedTest<TestSel>::Register()’:
ccHXKhJc.ii:19:67: warning: no return statement in function returning non-void
[-Wreturn-type]
   19 |   static bool Register() { new typename TestSel::Bind<int>::type; }
      |                                                                   ^
ccHXKhJc.ii: In static member function ‘static bool
TypeParameterizedTestSuite<Tests>::Register()’:
ccHXKhJc.ii:24:3: warning: no return statement in function returning non-void
[-Wreturn-type]
   24 |   }
      |   ^
ccHXKhJc.ii: In instantiation of ‘void atomic_fetch_flip_basic(Op) [with
<template-parameter-1-1> = int; <template-parameter-1-2> = short int; Op =
with_order<int>]’:
ccHXKhJc.ii:49:47:   required from ‘void BasicRelaxed< <template-parameter-1-1>
>::TestBody() [with <template-parameter-1-1> = int]’
ccHXKhJc.ii:47:6:   required from here
ccHXKhJc.ii:39:3: internal compiler error: in pop_local_binding, at
cp/name-lookup.cc:2474
   39 |   for (ref_ atomic : array<Size>{})
      |   ^~~
0x72069f pop_local_binding(tree_node*, tree_node*)
       
/usr/src/debug/sys-devel/gcc-12.1.1_p20220702/gcc-12-20220702/gcc/cp/name-lookup.cc:2474
0x72069f poplevel(int, int, int)
       
/usr/src/debug/sys-devel/gcc-12.1.1_p20220702/gcc-12-20220702/gcc/cp/decl.cc:733
0x13a626c do_poplevel(tree_node*)
       
/usr/src/debug/sys-devel/gcc-12.1.1_p20220702/gcc-12-20220702/gcc/cp/semantics.cc:640
0x14f98c5 finish_for_stmt(tree_node*)
       
/usr/src/debug/sys-devel/gcc-12.1.1_p20220702/gcc-12-20220702/gcc/cp/semantics.cc:1399
0x15c481e tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
       
/usr/src/debug/sys-devel/gcc-12.1.1_p20220702/gcc-12-20220702/gcc/cp/pt.cc:18768
0x15c428b tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
       
/usr/src/debug/sys-devel/gcc-12.1.1_p20220702/gcc-12-20220702/gcc/cp/pt.cc:18507
0x15c41f4 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
       
/usr/src/debug/sys-devel/gcc-12.1.1_p20220702/gcc-12-20220702/gcc/cp/pt.cc:18864
0x163cc24 instantiate_body
       
/usr/src/debug/sys-devel/gcc-12.1.1_p20220702/gcc-12-20220702/gcc/cp/pt.cc:26466
0x163ab56 instantiate_decl(tree_node*, bool, bool)
       
/usr/src/debug/sys-devel/gcc-12.1.1_p20220702/gcc-12-20220702/gcc/cp/pt.cc:26758
0x1309d40 instantiate_pending_templates(int)
       
/usr/src/debug/sys-devel/gcc-12.1.1_p20220702/gcc-12-20220702/gcc/cp/pt.cc:26837
0x1302380 c_parse_final_cleanups()
       
/usr/src/debug/sys-devel/gcc-12.1.1_p20220702/gcc-12-20220702/gcc/cp/decl2.cc:5128
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://bugs.gentoo.org/> for instructions.
```

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

* [Bug c++/106230] ICE when building folly-2022.07.04.00 in pop_local_binding (cp/name-lookup.cc:2474)
  2022-07-08  7:03 [Bug c++/106230] New: ICE when building folly-2022.07.04.00 in pop_local_binding (cp/name-lookup.cc:2474) sam at gentoo dot org
  2022-07-08  7:05 ` [Bug c++/106230] " sam at gentoo dot org
@ 2022-07-08  7:11 ` sam at gentoo dot org
  2022-07-08  7:21 ` sam at gentoo dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: sam at gentoo dot org @ 2022-07-08  7:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Sam James <sam at gentoo dot org> ---
Ignore me on the last part re Clang. It doesn't build there either with the
reduced version or original because of fortify bits.

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

* [Bug c++/106230] ICE when building folly-2022.07.04.00 in pop_local_binding (cp/name-lookup.cc:2474)
  2022-07-08  7:03 [Bug c++/106230] New: ICE when building folly-2022.07.04.00 in pop_local_binding (cp/name-lookup.cc:2474) sam at gentoo dot org
  2022-07-08  7:05 ` [Bug c++/106230] " sam at gentoo dot org
  2022-07-08  7:11 ` sam at gentoo dot org
@ 2022-07-08  7:21 ` sam at gentoo dot org
  2022-07-08  8:11 ` [Bug c++/106230] [12/13 Regression] ICE when building folly-2022.07.04.00 in pop_local_binding (cp/name-lookup.cc:2474) since r12-6328-gbeaee0a871b6485d marxin at gcc dot gnu.org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: sam at gentoo dot org @ 2022-07-08  7:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Sam James <sam at gentoo dot org> ---
Clang does build with the original (folly) if I don't preprocess it.

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

* [Bug c++/106230] [12/13 Regression] ICE when building folly-2022.07.04.00 in pop_local_binding (cp/name-lookup.cc:2474) since r12-6328-gbeaee0a871b6485d
  2022-07-08  7:03 [Bug c++/106230] New: ICE when building folly-2022.07.04.00 in pop_local_binding (cp/name-lookup.cc:2474) sam at gentoo dot org
                   ` (2 preceding siblings ...)
  2022-07-08  7:21 ` sam at gentoo dot org
@ 2022-07-08  8:11 ` marxin at gcc dot gnu.org
  2022-07-22  5:44 ` jason at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-07-08  8:11 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2022-07-08
                 CC|                            |jason at gcc dot gnu.org,
                   |                            |marxin at gcc dot gnu.org
           Keywords|                            |ice-on-valid-code
            Summary|ICE when building           |[12/13 Regression] ICE when
                   |folly-2022.07.04.00 in      |building
                   |pop_local_binding           |folly-2022.07.04.00 in
                   |(cp/name-lookup.cc:2474)    |pop_local_binding
                   |                            |(cp/name-lookup.cc:2474)
                   |                            |since
                   |                            |r12-6328-gbeaee0a871b6485d
   Target Milestone|---                         |12.2
             Status|UNCONFIRMED                 |NEW

--- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> ---
Thanks for the report, started with r12-6328-gbeaee0a871b6485d.

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

* [Bug c++/106230] [12/13 Regression] ICE when building folly-2022.07.04.00 in pop_local_binding (cp/name-lookup.cc:2474) since r12-6328-gbeaee0a871b6485d
  2022-07-08  7:03 [Bug c++/106230] New: ICE when building folly-2022.07.04.00 in pop_local_binding (cp/name-lookup.cc:2474) sam at gentoo dot org
                   ` (3 preceding siblings ...)
  2022-07-08  8:11 ` [Bug c++/106230] [12/13 Regression] ICE when building folly-2022.07.04.00 in pop_local_binding (cp/name-lookup.cc:2474) since r12-6328-gbeaee0a871b6485d marxin at gcc dot gnu.org
@ 2022-07-22  5:44 ` jason at gcc dot gnu.org
  2022-07-25 13:53 ` jason at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jason at gcc dot gnu.org @ 2022-07-22  5:44 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |jason at gcc dot gnu.org
             Status|NEW                         |ASSIGNED

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

* [Bug c++/106230] [12/13 Regression] ICE when building folly-2022.07.04.00 in pop_local_binding (cp/name-lookup.cc:2474) since r12-6328-gbeaee0a871b6485d
  2022-07-08  7:03 [Bug c++/106230] New: ICE when building folly-2022.07.04.00 in pop_local_binding (cp/name-lookup.cc:2474) sam at gentoo dot org
                   ` (4 preceding siblings ...)
  2022-07-22  5:44 ` jason at gcc dot gnu.org
@ 2022-07-25 13:53 ` jason at gcc dot gnu.org
  2022-07-25 15:06 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jason at gcc dot gnu.org @ 2022-07-25 13:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> ---
Reduced:

struct A {
  A();
  operator int();
};
template <int N> struct array {
  A elts[N];
  A *begin();
  A *end();
};
void fn() {
  for (int i : array<4>{})
    ;
}

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

* [Bug c++/106230] [12/13 Regression] ICE when building folly-2022.07.04.00 in pop_local_binding (cp/name-lookup.cc:2474) since r12-6328-gbeaee0a871b6485d
  2022-07-08  7:03 [Bug c++/106230] New: ICE when building folly-2022.07.04.00 in pop_local_binding (cp/name-lookup.cc:2474) sam at gentoo dot org
                   ` (5 preceding siblings ...)
  2022-07-25 13:53 ` jason at gcc dot gnu.org
@ 2022-07-25 15:06 ` rguenth at gcc dot gnu.org
  2022-07-26  0:06 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-07-25 15:06 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

* [Bug c++/106230] [12/13 Regression] ICE when building folly-2022.07.04.00 in pop_local_binding (cp/name-lookup.cc:2474) since r12-6328-gbeaee0a871b6485d
  2022-07-08  7:03 [Bug c++/106230] New: ICE when building folly-2022.07.04.00 in pop_local_binding (cp/name-lookup.cc:2474) sam at gentoo dot org
                   ` (6 preceding siblings ...)
  2022-07-25 15:06 ` rguenth at gcc dot gnu.org
@ 2022-07-26  0:06 ` cvs-commit at gcc dot gnu.org
  2022-07-26  3:12 ` [Bug c++/106230] [12 " cvs-commit at gcc dot gnu.org
  2022-07-26  3:13 ` jason at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-07-26  0:06 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 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:789c4b9bb015c361bc1a6adfcd0abadce555e562

commit r13-1830-g789c4b9bb015c361bc1a6adfcd0abadce555e562
Author: Jason Merrill <jason@redhat.com>
Date:   Mon Jul 25 11:13:31 2022 -0400

    c++: aggregate prvalue as for range [PR106230]

    Since my PR94041 work on temporary lifetime in aggregate initialization, we
    end up calling build_vec_init to initialize the reference-extended
temporary
    for the artificial __for_range variable.  And build_vec_init uses
    finish_for_stmt to implement its loop.  That function assumes that if
    __for_range is in current_binding_level, we're finishing a range-for, and
we
    should fix up the variable as it goes out of scope.  But when called from
    build_vec_init we aren't finishing a range-for, and do_poplevel doesn't
    remove the variable from scope because stmts_are_full_exprs_p is false.  So
    let's check that here as well, and leave the DECL_NAME alone.

            PR c++/106230

    gcc/cp/ChangeLog:

            * semantics.cc (finish_for_stmt): Check stmts_are_full_exprs_p.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp0x/range-for38.C: New test.

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

* [Bug c++/106230] [12 Regression] ICE when building folly-2022.07.04.00 in pop_local_binding (cp/name-lookup.cc:2474) since r12-6328-gbeaee0a871b6485d
  2022-07-08  7:03 [Bug c++/106230] New: ICE when building folly-2022.07.04.00 in pop_local_binding (cp/name-lookup.cc:2474) sam at gentoo dot org
                   ` (7 preceding siblings ...)
  2022-07-26  0:06 ` cvs-commit at gcc dot gnu.org
@ 2022-07-26  3:12 ` cvs-commit at gcc dot gnu.org
  2022-07-26  3:13 ` jason at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-07-26  3:12 UTC (permalink / raw)
  To: gcc-bugs

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

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

https://gcc.gnu.org/g:60954a06ceb1598d86763e5504d8e1b874b6bd6a

commit r12-8618-g60954a06ceb1598d86763e5504d8e1b874b6bd6a
Author: Jason Merrill <jason@redhat.com>
Date:   Mon Jul 25 11:13:31 2022 -0400

    c++: aggregate prvalue as for range [PR106230]

    Since my PR94041 work on temporary lifetime in aggregate initialization, we
    end up calling build_vec_init to initialize the reference-extended
temporary
    for the artificial __for_range variable.  And build_vec_init uses
    finish_for_stmt to implement its loop.  That function assumes that if
    __for_range is in current_binding_level, we're finishing a range-for, and
we
    should fix up the variable as it goes out of scope.  But when called from
    build_vec_init we aren't finishing a range-for, and do_poplevel doesn't
    remove the variable from scope because stmts_are_full_exprs_p is false.  So
    let's check that here as well, and leave the DECL_NAME alone.

            PR c++/106230

    gcc/cp/ChangeLog:

            * semantics.cc (finish_for_stmt): Check stmts_are_full_exprs_p.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp0x/range-for38.C: New test.

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

* [Bug c++/106230] [12 Regression] ICE when building folly-2022.07.04.00 in pop_local_binding (cp/name-lookup.cc:2474) since r12-6328-gbeaee0a871b6485d
  2022-07-08  7:03 [Bug c++/106230] New: ICE when building folly-2022.07.04.00 in pop_local_binding (cp/name-lookup.cc:2474) sam at gentoo dot org
                   ` (8 preceding siblings ...)
  2022-07-26  3:12 ` [Bug c++/106230] [12 " cvs-commit at gcc dot gnu.org
@ 2022-07-26  3:13 ` jason at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: jason at gcc dot gnu.org @ 2022-07-26  3:13 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |12.1.1
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #8 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed for 12.2/13.

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

end of thread, other threads:[~2022-07-26  3:13 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-08  7:03 [Bug c++/106230] New: ICE when building folly-2022.07.04.00 in pop_local_binding (cp/name-lookup.cc:2474) sam at gentoo dot org
2022-07-08  7:05 ` [Bug c++/106230] " sam at gentoo dot org
2022-07-08  7:11 ` sam at gentoo dot org
2022-07-08  7:21 ` sam at gentoo dot org
2022-07-08  8:11 ` [Bug c++/106230] [12/13 Regression] ICE when building folly-2022.07.04.00 in pop_local_binding (cp/name-lookup.cc:2474) since r12-6328-gbeaee0a871b6485d marxin at gcc dot gnu.org
2022-07-22  5:44 ` jason at gcc dot gnu.org
2022-07-25 13:53 ` jason at gcc dot gnu.org
2022-07-25 15:06 ` rguenth at gcc dot gnu.org
2022-07-26  0:06 ` cvs-commit at gcc dot gnu.org
2022-07-26  3:12 ` [Bug c++/106230] [12 " cvs-commit at gcc dot gnu.org
2022-07-26  3:13 ` 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).