public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/112269] New: [14 Regression] x86_64 GNU/Linux '-m32' multilib 'libstdc++-v3/include/complex:1493: internal compiler error: in tsubst_expr, at cp/pt.cc:21534'
@ 2023-10-28 20:52 tschwinge at gcc dot gnu.org
  2023-10-28 21:03 ` [Bug c++/112269] " pinskia at gcc dot gnu.org
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: tschwinge at gcc dot gnu.org @ 2023-10-28 20:52 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 112269
           Summary: [14 Regression] x86_64 GNU/Linux '-m32' multilib
                    'libstdc++-v3/include/complex:1493: internal compiler
                    error: in tsubst_expr, at cp/pt.cc:21534'
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code, testsuite-fail
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tschwinge at gcc dot gnu.org
  Target Milestone: ---

(Assuming my tacking is to be believed) something in Git commit
r14-4720-gaf4bb221153359f5948da917d5ef2df738bb1e61..r14-4986-g4d3d2cdb574488223d023b590c3a34ddd93f4dae
ICE-regresses a few x86_64 GNU/Linux '-m32' multilib test cases:

    [-PASS:-]{+FAIL:+} 24_iterators/reverse_iterator/100639.cc  -std=c++20
(test for excess errors)
    [-PASS:-]{+FAIL:+} 24_iterators/reverse_iterator/100639.cc  -std=c++26
(test for excess errors)

    In file included from
[...]/build-gcc/x86_64-pc-linux-gnu/32/libstdc++-v3/include/ccomplex:39,
                     from
[...]/build-gcc/x86_64-pc-linux-gnu/32/libstdc++-v3/include/x86_64-pc-linux-gnu/bits/stdc++.h:127,
                     from <command-line>:
    [...]/build-gcc/x86_64-pc-linux-gnu/32/libstdc++-v3/include/complex: In
member function 'constexpr std::complex<float>&
std::complex<float>::operator/=(const std::complex<_Tp>&)':
    [...]/build-gcc/x86_64-pc-linux-gnu/32/libstdc++-v3/include/complex:1493:
internal compiler error: in tsubst_expr, at cp/pt.cc:21534
    0x784e58 tsubst_expr(tree_node*, tree_node*, int, tree_node*)
            [...]/source-gcc/gcc/cp/pt.cc:21534
    0xf03edb fold_non_dependent_expr_template
            [...]/source-gcc/gcc/cp/constexpr.cc:9030
    0xfa17ed fold_for_warn(tree_node*)
            [...]/source-gcc/gcc/cp/expr.cc:412
    0x1144377 cp_build_binary_op(op_location_t const&, tree_code, tree_node*,
tree_node*, int)
            [...]/source-gcc/gcc/cp/typeck.cc:5436
    0x11525b3 cp_build_modify_expr(unsigned int, tree_node*, tree_code,
tree_node*, int)
            [...]/source-gcc/gcc/cp/typeck.cc:9522
    0xec5c4d build_new_op(op_location_t const&, tree_code, int, tree_node*,
tree_node*, tree_node*, tree_node*, tree_node**, int)
            [...]/source-gcc/gcc/cp/call.cc:7312
    0x11536a5 build_x_modify_expr(unsigned int, tree_node*, tree_code,
tree_node*, tree_node*, int)
            [...]/source-gcc/gcc/cp/typeck.cc:9728
    0x103f464 cp_parser_assignment_expression
            [...]/source-gcc/gcc/cp/parser.cc:10611
    0x103f6b4 cp_parser_expression
            [...]/source-gcc/gcc/cp/parser.cc:10740
    0x10441c7 cp_parser_expression_statement
            [...]/source-gcc/gcc/cp/parser.cc:12939
    0x10504ea cp_parser_statement
            [...]/source-gcc/gcc/cp/parser.cc:12719
    0x10517f7 cp_parser_statement_seq_opt
            [...]/source-gcc/gcc/cp/parser.cc:13188
    0x1051a27 cp_parser_compound_statement
            [...]/source-gcc/gcc/cp/parser.cc:13042
    0x1073d95 cp_parser_function_body
            [...]/source-gcc/gcc/cp/parser.cc:25560
    0x1073d95 cp_parser_ctor_initializer_opt_and_function_body
            [...]/source-gcc/gcc/cp/parser.cc:25611
    0x107a1ae cp_parser_function_definition_after_declarator
            [...]/source-gcc/gcc/cp/parser.cc:32273
    0x107a634 cp_parser_late_parsing_for_member
            [...]/source-gcc/gcc/cp/parser.cc:33241
    0x104c3e4 cp_parser_class_specifier
            [...]/source-gcc/gcc/cp/parser.cc:26761
    0x104c3e4 cp_parser_type_specifier
            [...]/source-gcc/gcc/cp/parser.cc:19725
    0x104cb6b cp_parser_decl_specifier_seq
            [...]/source-gcc/gcc/cp/parser.cc:16283

Similarly:

    [-PASS:-]{+FAIL:+} std/ranges/iota/93267.cc  -std=c++20 (test for excess
errors)
    [-PASS:-]{+FAIL:+} std/ranges/iota/93267.cc  -std=c++26 (test for excess
errors)

    [-PASS:-]{+FAIL:+} std/ranges/iota/96042.cc  -std=c++20 (test for excess
errors)
    [-PASS:-]{+FAIL:+} std/ranges/iota/96042.cc  -std=c++26 (test for excess
errors)

    [-PASS:-]{+FAIL:+} std/ranges/iota/size.cc  -std=c++20 (test for excess
errors)
    [-PASS:-]{+FAIL:+} std/ranges/iota/size.cc  -std=c++26 (test for excess
errors)

    [-PASS:-]{+FAIL:+} std/ranges/subrange/96042.cc  -std=c++20 (test for
excess errors)
    [-PASS:-]{+FAIL:+} std/ranges/subrange/96042.cc  -std=c++26 (test for
excess errors)

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

* [Bug c++/112269] [14 Regression] x86_64 GNU/Linux '-m32' multilib 'libstdc++-v3/include/complex:1493: internal compiler error: in tsubst_expr, at cp/pt.cc:21534'
  2023-10-28 20:52 [Bug c++/112269] New: [14 Regression] x86_64 GNU/Linux '-m32' multilib 'libstdc++-v3/include/complex:1493: internal compiler error: in tsubst_expr, at cp/pt.cc:21534' tschwinge at gcc dot gnu.org
@ 2023-10-28 21:03 ` pinskia at gcc dot gnu.org
  2023-10-28 21:04 ` pinskia at gcc dot gnu.org
                   ` (15 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-10-28 21:03 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.0

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

* [Bug c++/112269] [14 Regression] x86_64 GNU/Linux '-m32' multilib 'libstdc++-v3/include/complex:1493: internal compiler error: in tsubst_expr, at cp/pt.cc:21534'
  2023-10-28 20:52 [Bug c++/112269] New: [14 Regression] x86_64 GNU/Linux '-m32' multilib 'libstdc++-v3/include/complex:1493: internal compiler error: in tsubst_expr, at cp/pt.cc:21534' tschwinge at gcc dot gnu.org
  2023-10-28 21:03 ` [Bug c++/112269] " pinskia at gcc dot gnu.org
@ 2023-10-28 21:04 ` pinskia at gcc dot gnu.org
  2023-10-29  8:37 ` schwab@linux-m68k.org
                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-10-28 21:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I suspect this is excess-precision related.

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

* [Bug c++/112269] [14 Regression] x86_64 GNU/Linux '-m32' multilib 'libstdc++-v3/include/complex:1493: internal compiler error: in tsubst_expr, at cp/pt.cc:21534'
  2023-10-28 20:52 [Bug c++/112269] New: [14 Regression] x86_64 GNU/Linux '-m32' multilib 'libstdc++-v3/include/complex:1493: internal compiler error: in tsubst_expr, at cp/pt.cc:21534' tschwinge at gcc dot gnu.org
  2023-10-28 21:03 ` [Bug c++/112269] " pinskia at gcc dot gnu.org
  2023-10-28 21:04 ` pinskia at gcc dot gnu.org
@ 2023-10-29  8:37 ` schwab@linux-m68k.org
  2023-10-29  9:46 ` schwab@linux-m68k.org
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: schwab@linux-m68k.org @ 2023-10-29  8:37 UTC (permalink / raw)
  To: gcc-bugs

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

Andreas Schwab <schwab@linux-m68k.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|x86_64 i?86                 |x86_64 i?86 m68k-*-*

--- Comment #2 from Andreas Schwab <schwab@linux-m68k.org> ---
Similar failures on m68k.

g++.dg/cpp0x/initlist13.C  -std=c++20 (internal compiler error: in tsubst_expr,
at cp/pt.cc:21534)
g++.dg/cpp0x/udlit-general.C  -std=c++20 (internal compiler error: in
tsubst_expr, at cp/pt.cc:21534)
g++.dg/cpp1y/complex_literals1.C  -std=c++20 (internal compiler error: in
tsubst_expr, at cp/pt.cc:21534)
g++.dg/cpp1y/udlit-userdef-string.C  -std=c++20 (internal compiler error: in
tsubst_expr, at cp/pt.cc:21534)
g++.dg/modules/xtreme-header-5_a.H -std=c++2a (internal compiler error: in
tsubst_expr, at cp/pt.cc:21534)
g++.dg/modules/xtreme-header-5_a.H -std=c++2b (internal compiler error: in
tsubst_expr, at cp/pt.cc:21534)
g++.dg/modules/xtreme-header_a.H -std=c++2a (internal compiler error: in
tsubst_expr, at cp/pt.cc:21534)
g++.dg/modules/xtreme-header_a.H -std=c++2b (internal compiler error: in
tsubst_expr, at cp/pt.cc:21534)
g++.dg/modules/xtreme-tr1_a.H -std=c++2a (internal compiler error: in
tsubst_expr, at cp/pt.cc:21534)
g++.dg/modules/xtreme-tr1_a.H -std=c++2b (internal compiler error: in
tsubst_expr, at cp/pt.cc:21534)
g++.dg/opt/nrv17.C  -std=c++20 (internal compiler error: in tsubst_expr, at
cp/pt.cc:21534)
g++.old-deja/g++.brendan/crash20.C  -std=c++20 (internal compiler error: in
tsubst_expr, at cp/pt.cc:21534)
g++.old-deja/g++.law/ctors6.C  -std=c++20 (internal compiler error: in
tsubst_expr, at cp/pt.cc:21534)
g++.old-deja/g++.law/operators4.C  -std=c++20 (internal compiler error: in
tsubst_expr, at cp/pt.cc:21534)
g++.old-deja/g++.other/headers1.C  -std=c++20 (internal compiler error: in
tsubst_expr, at cp/pt.cc:21534)
g++.old-deja/g++.robertl/eb3.C  -std=c++20 (internal compiler error: in
tsubst_expr, at cp/pt.cc:21534)

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

* [Bug c++/112269] [14 Regression] x86_64 GNU/Linux '-m32' multilib 'libstdc++-v3/include/complex:1493: internal compiler error: in tsubst_expr, at cp/pt.cc:21534'
  2023-10-28 20:52 [Bug c++/112269] New: [14 Regression] x86_64 GNU/Linux '-m32' multilib 'libstdc++-v3/include/complex:1493: internal compiler error: in tsubst_expr, at cp/pt.cc:21534' tschwinge at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-10-29  8:37 ` schwab@linux-m68k.org
@ 2023-10-29  9:46 ` schwab@linux-m68k.org
  2023-10-29 16:33 ` [Bug c++/112269] [14 Regression] x86_64 GNU/Linux '-m32' multilib 'libstdc++-v3/include/complex:1493: internal compiler error: in tsubst_expr, at cp/pt.cc:21534' since r14-4796-g3e3d73ed5e85e7 pinskia at gcc dot gnu.org
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: schwab@linux-m68k.org @ 2023-10-29  9:46 UTC (permalink / raw)
  To: gcc-bugs

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

Andreas Schwab <schwab@linux-m68k.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ppalka at gcc dot gnu.org

--- Comment #3 from Andreas Schwab <schwab@linux-m68k.org> ---
Bisected to commit 3e3d73ed5e85

Author: Patrick Palka <ppalka@redhat.com>
Date:   Fri Oct 20 11:21:54 2023 -0400

    c++: merge tsubst_copy into tsubst_copy_and_build

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

* [Bug c++/112269] [14 Regression] x86_64 GNU/Linux '-m32' multilib 'libstdc++-v3/include/complex:1493: internal compiler error: in tsubst_expr, at cp/pt.cc:21534' since r14-4796-g3e3d73ed5e85e7
  2023-10-28 20:52 [Bug c++/112269] New: [14 Regression] x86_64 GNU/Linux '-m32' multilib 'libstdc++-v3/include/complex:1493: internal compiler error: in tsubst_expr, at cp/pt.cc:21534' tschwinge at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2023-10-29  9:46 ` schwab@linux-m68k.org
@ 2023-10-29 16:33 ` pinskia at gcc dot gnu.org
  2023-10-30 16:19 ` ppalka at gcc dot gnu.org
                   ` (11 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-10-29 16:33 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2023-10-29
           Keywords|                            |needs-reduction
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andreas Schwab from comment #2)
> Similar failures on m68k.

That gives more evidence that is excess-precision related really.

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

* [Bug c++/112269] [14 Regression] x86_64 GNU/Linux '-m32' multilib 'libstdc++-v3/include/complex:1493: internal compiler error: in tsubst_expr, at cp/pt.cc:21534' since r14-4796-g3e3d73ed5e85e7
  2023-10-28 20:52 [Bug c++/112269] New: [14 Regression] x86_64 GNU/Linux '-m32' multilib 'libstdc++-v3/include/complex:1493: internal compiler error: in tsubst_expr, at cp/pt.cc:21534' tschwinge at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2023-10-29 16:33 ` [Bug c++/112269] [14 Regression] x86_64 GNU/Linux '-m32' multilib 'libstdc++-v3/include/complex:1493: internal compiler error: in tsubst_expr, at cp/pt.cc:21534' since r14-4796-g3e3d73ed5e85e7 pinskia at gcc dot gnu.org
@ 2023-10-30 16:19 ` ppalka at gcc dot gnu.org
  2023-10-31  8:17 ` tschwinge at gcc dot gnu.org
                   ` (10 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: ppalka at gcc dot gnu.org @ 2023-10-30 16:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Patrick Palka <ppalka at gcc dot gnu.org> ---
I can't reproduce any of these testsuite failures on trunk with x86_64 -m32...
could you provide a preprocessed source file perhaps?

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

* [Bug c++/112269] [14 Regression] x86_64 GNU/Linux '-m32' multilib 'libstdc++-v3/include/complex:1493: internal compiler error: in tsubst_expr, at cp/pt.cc:21534' since r14-4796-g3e3d73ed5e85e7
  2023-10-28 20:52 [Bug c++/112269] New: [14 Regression] x86_64 GNU/Linux '-m32' multilib 'libstdc++-v3/include/complex:1493: internal compiler error: in tsubst_expr, at cp/pt.cc:21534' tschwinge at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2023-10-30 16:19 ` ppalka at gcc dot gnu.org
@ 2023-10-31  8:17 ` tschwinge at gcc dot gnu.org
  2023-10-31 14:58 ` ppalka at gcc dot gnu.org
                   ` (9 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: tschwinge at gcc dot gnu.org @ 2023-10-31  8:17 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Thomas Schwinge <tschwinge at gcc dot gnu.org> ---
Created attachment 56479
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56479&action=edit
'initlist13.ii.xz'

(In reply to Patrick Palka from comment #5)
> I can't reproduce any of these testsuite failures on trunk with x86_64
> -m32... could you provide a preprocessed source file perhaps?

Sure; I'm attaching 'testsuite/g++.dg/cpp0x/initlist13.C' (picked at random;
not yet reduced):

    $ build-gcc/gcc/cc1plus -fpreprocessed initlist13.ii -quiet -m32
-mtune=generic -march=x86-64 -pedantic-errors -Wno-long-long -std=c++20 -o
initlist13.s
    In file included from
[...]/source-gcc/gcc/testsuite/g++.dg/cpp0x/initlist13.C:4:
    [...]/build-gcc/x86_64-pc-linux-gnu/32/libstdc++-v3/include/complex: In
member function ‘constexpr std::complex<float>&
std::complex<float>::operator/=(const std::complex<_Tp>&)’:
   
[...]/build-gcc/x86_64-pc-linux-gnu/32/libstdc++-v3/include/complex:1493:16:
internal compiler error: in tsubst_expr, at cp/pt.cc:21534
    [...]


For avoidance of doubt:

(In reply to Andreas Schwab from comment #2)
> Similar failures on m68k.
> 
> g++[...]

..., indeed I'm seeing similar C++ front end testing regressions -- I just had
not yet looked into those test results when I filed this issue.

    PASS: g++.dg/cpp0x/initlist13.C  -std=c++14 (test for excess errors)
    PASS: g++.dg/cpp0x/initlist13.C  -std=c++17 (test for excess errors)
    [-PASS:-]{+FAIL: g++.dg/cpp0x/initlist13.C  -std=c++20 (internal compiler
error: in tsubst_expr, at cp/pt.cc:21534)+}
    {+FAIL:+} g++.dg/cpp0x/initlist13.C  -std=c++20 (test for excess errors)
    UNSUPPORTED: g++.dg/cpp0x/initlist13.C  -std=c++98

    @@ -330299,8 +332283,9 @@ PASS: g++.dg/cpp0x/udlit-general.C  -std=c++14
(test for excess errors)
    PASS: g++.dg/cpp0x/udlit-general.C  -std=c++14 execution test
    PASS: g++.dg/cpp0x/udlit-general.C  -std=c++17 (test for excess errors)
    PASS: g++.dg/cpp0x/udlit-general.C  -std=c++17 execution test
    [-PASS:-]{+FAIL: g++.dg/cpp0x/udlit-general.C  -std=c++20 (internal
compiler error: in tsubst_expr, at cp/pt.cc:21534)+}
    {+FAIL:+} g++.dg/cpp0x/udlit-general.C  -std=c++20 (test for excess errors)
    [-PASS:-]{+UNRESOLVED:+} g++.dg/cpp0x/udlit-general.C  -std=c++20
[-execution test-]{+compilation failed to produce executable+}
    UNSUPPORTED: g++.dg/cpp0x/udlit-general.C  -std=c++98

    PASS: g++.dg/cpp1y/complex_literals1.C  -std=c++14 (test for excess errors)
    PASS: g++.dg/cpp1y/complex_literals1.C  -std=c++17 (test for excess errors)
    [-PASS:-]{+FAIL: g++.dg/cpp1y/complex_literals1.C  -std=c++20 (internal
compiler error: in tsubst_expr, at cp/pt.cc:21534)+}
    {+FAIL:+} g++.dg/cpp1y/complex_literals1.C  -std=c++20 (test for excess
errors)
    UNSUPPORTED: g++.dg/cpp1y/complex_literals1.C  -std=c++98

    PASS: g++.dg/cpp1y/udlit-userdef-string.C  -std=c++14 (test for excess
errors)
    PASS: g++.dg/cpp1y/udlit-userdef-string.C  -std=c++17 (test for excess
errors)
    [-PASS:-]{+FAIL: g++.dg/cpp1y/udlit-userdef-string.C  -std=c++20 (internal
compiler error: in tsubst_expr, at cp/pt.cc:21534)+}
    {+FAIL:+} g++.dg/cpp1y/udlit-userdef-string.C  -std=c++20 (test for excess
errors)
    UNSUPPORTED: g++.dg/cpp1y/udlit-userdef-string.C  -std=c++98

    @@ -379174,8 +381318,9 @@ PASS: g++.dg/opt/nrv17.C  -std=c++14 (test for
excess errors)
    PASS: g++.dg/opt/nrv17.C  -std=c++14 execution test
    PASS: g++.dg/opt/nrv17.C  -std=c++17 (test for excess errors)
    PASS: g++.dg/opt/nrv17.C  -std=c++17 execution test
    [-PASS:-]{+FAIL: g++.dg/opt/nrv17.C  -std=c++20 (internal compiler error:
in tsubst_expr, at cp/pt.cc:21534)+}
    {+FAIL:+} g++.dg/opt/nrv17.C  -std=c++20 (test for excess errors)
    [-PASS:-]{+UNRESOLVED:+} g++.dg/opt/nrv17.C  -std=c++20 [-execution
test-]{+compilation failed to produce executable+}
    PASS: g++.dg/opt/nrv17.C  -std=c++98 (test for excess errors)
    PASS: g++.dg/opt/nrv17.C  -std=c++98 execution test

    PASS: g++.dg/modules/xtreme-header-5_a.H -std=c++17 (test for excess
errors)
    [-PASS:-]{+FAIL: g++.dg/modules/xtreme-header-5_a.H -std=c++2a (internal
compiler error: in tsubst_expr, at cp/pt.cc:21534)+}
    {+FAIL:+} g++.dg/modules/xtreme-header-5_a.H -std=c++2a (test for excess
errors)
    [-PASS:-]{+FAIL: g++.dg/modules/xtreme-header-5_a.H -std=c++2b (internal
compiler error: in tsubst_expr, at cp/pt.cc:21534)+}
    {+FAIL:+} g++.dg/modules/xtreme-header-5_a.H -std=c++2b (test for excess
errors)[-PASS: g++.dg/modules/xtreme-header-5_a.H module-cmi 
(gcm.cache/$srcdir/g++.dg/modules/xtreme-header-5_a.H.gcm)-]
    [-PASS: g++.dg/modules/xtreme-header-5_a.H module-cmi 
(gcm.cache/$srcdir/g++.dg/modules/xtreme-header-5_a.H.gcm)-]
    PASS: g++.dg/modules/xtreme-header-5_a.H module-cmi 
(gcm.cache/$srcdir/g++.dg/modules/xtreme-header-5_a.H.gcm)
    {+FAIL: g++.dg/modules/xtreme-header-5_a.H module-cmi 
(gcm.cache/$srcdir/g++.dg/modules/xtreme-header-5_a.H.gcm)+}
    {+FAIL: g++.dg/modules/xtreme-header-5_a.H module-cmi 
(gcm.cache/$srcdir/g++.dg/modules/xtreme-header-5_a.H.gcm)+}
    PASS: g++.dg/modules/xtreme-header-5_b.C -std=c++17 (test for excess
errors)
    [-PASS:-]{+FAIL:+} g++.dg/modules/xtreme-header-5_b.C -std=c++2a (test for
excess errors)
    [-PASS:-]{+FAIL:+} g++.dg/modules/xtreme-header-5_b.C -std=c++2b (test for
excess errors)
    PASS: g++.dg/modules/xtreme-header-5_c.C -std=c++17 (test for excess
errors)
    [-PASS:-]{+FAIL:+} g++.dg/modules/xtreme-header-5_c.C -std=c++2a (test for
excess errors)
    [-PASS:-]{+FAIL:+} g++.dg/modules/xtreme-header-5_c.C -std=c++2b (test for
excess errors)

    PASS: g++.dg/modules/xtreme-header_a.H -std=c++17 (test for excess errors)
    [-PASS:-]{+FAIL: g++.dg/modules/xtreme-header_a.H -std=c++2a (internal
compiler error: in tsubst_expr, at cp/pt.cc:21534)+}
    {+FAIL:+} g++.dg/modules/xtreme-header_a.H -std=c++2a (test for excess
errors)
    [-PASS:-]{+FAIL: g++.dg/modules/xtreme-header_a.H -std=c++2b (internal
compiler error: in tsubst_expr, at cp/pt.cc:21534)+}
    {+FAIL:+} g++.dg/modules/xtreme-header_a.H -std=c++2b (test for excess
errors)[-PASS: g++.dg/modules/xtreme-header_a.H module-cmi 
(gcm.cache/$srcdir/g++.dg/modules/xtreme-header_a.H.gcm)-]
    [-PASS: g++.dg/modules/xtreme-header_a.H module-cmi 
(gcm.cache/$srcdir/g++.dg/modules/xtreme-header_a.H.gcm)-]
    PASS: g++.dg/modules/xtreme-header_a.H module-cmi 
(gcm.cache/$srcdir/g++.dg/modules/xtreme-header_a.H.gcm)
    {+FAIL: g++.dg/modules/xtreme-header_a.H module-cmi 
(gcm.cache/$srcdir/g++.dg/modules/xtreme-header_a.H.gcm)+}
    {+FAIL: g++.dg/modules/xtreme-header_a.H module-cmi 
(gcm.cache/$srcdir/g++.dg/modules/xtreme-header_a.H.gcm)+}
    PASS: g++.dg/modules/xtreme-header_b.C -std=c++17 (test for excess errors)
    [-PASS:-]{+FAIL:+} g++.dg/modules/xtreme-header_b.C -std=c++2a (test for
excess errors)
    [-PASS:-]{+FAIL:+} g++.dg/modules/xtreme-header_b.C -std=c++2b (test for
excess errors)
    PASS: g++.dg/modules/xtreme-tr1_a.H -std=c++17 (test for excess errors)
    [-PASS:-]{+FAIL: g++.dg/modules/xtreme-tr1_a.H -std=c++2a (internal
compiler error: in tsubst_expr, at cp/pt.cc:21534)+}
    {+FAIL:+} g++.dg/modules/xtreme-tr1_a.H -std=c++2a (test for excess errors)
    [-PASS:-]{+FAIL: g++.dg/modules/xtreme-tr1_a.H -std=c++2b (internal
compiler error: in tsubst_expr, at cp/pt.cc:21534)+}
    {+FAIL:+} g++.dg/modules/xtreme-tr1_a.H -std=c++2b (test for excess
errors)[-PASS: g++.dg/modules/xtreme-tr1_a.H module-cmi 
(gcm.cache/$srcdir/g++.dg/modules/xtreme-tr1_a.H.gcm)-]
    [-PASS: g++.dg/modules/xtreme-tr1_a.H module-cmi 
(gcm.cache/$srcdir/g++.dg/modules/xtreme-tr1_a.H.gcm)-]
    PASS: g++.dg/modules/xtreme-tr1_a.H module-cmi 
(gcm.cache/$srcdir/g++.dg/modules/xtreme-tr1_a.H.gcm)
    {+FAIL: g++.dg/modules/xtreme-tr1_a.H module-cmi 
(gcm.cache/$srcdir/g++.dg/modules/xtreme-tr1_a.H.gcm)+}
    {+FAIL: g++.dg/modules/xtreme-tr1_a.H module-cmi 
(gcm.cache/$srcdir/g++.dg/modules/xtreme-tr1_a.H.gcm)+}
    PASS: g++.dg/modules/xtreme-tr1_b.C -std=c++17 (test for excess errors)
    [-PASS:-]{+FAIL:+} g++.dg/modules/xtreme-tr1_b.C -std=c++2a (test for
excess errors)
    [-PASS:-]{+FAIL:+} g++.dg/modules/xtreme-tr1_b.C -std=c++2b (test for
excess errors)

    PASS: g++.old-deja/g++.brendan/crash20.C  -std=c++14 (test for excess
errors)
    PASS: g++.old-deja/g++.brendan/crash20.C  -std=c++17 (test for excess
errors)
    [-PASS:-]{+FAIL: g++.old-deja/g++.brendan/crash20.C  -std=c++20 (internal
compiler error: in tsubst_expr, at cp/pt.cc:21534)+}
    {+FAIL:+} g++.old-deja/g++.brendan/crash20.C  -std=c++20 (test for excess
errors)
    PASS: g++.old-deja/g++.brendan/crash20.C  -std=c++98 (test for excess
errors)

    PASS: g++.old-deja/g++.law/ctors6.C  -std=c++14 (test for excess errors)
    PASS: g++.old-deja/g++.law/ctors6.C  -std=c++17 (test for excess errors)
    [-PASS:-]{+FAIL: g++.old-deja/g++.law/ctors6.C  -std=c++20 (internal
compiler error: in tsubst_expr, at cp/pt.cc:21534)+}
    {+FAIL:+} g++.old-deja/g++.law/ctors6.C  -std=c++20 (test for excess
errors)
    PASS: g++.old-deja/g++.law/ctors6.C  -std=c++98 (test for excess errors)

    @@ -499462,8 +502648,9 @@ PASS: g++.old-deja/g++.law/operators4.C 
-std=c++14  (test for errors, line 18)
    PASS: g++.old-deja/g++.law/operators4.C  -std=c++14 (test for excess
errors)
    PASS: g++.old-deja/g++.law/operators4.C  -std=c++17  (test for errors, line
18)
    PASS: g++.old-deja/g++.law/operators4.C  -std=c++17 (test for excess
errors)
    [-PASS:-]{+FAIL:+} g++.old-deja/g++.law/operators4.C  -std=c++20  (test for
errors, line 18)
    [-PASS:-]{+FAIL: g++.old-deja/g++.law/operators4.C  -std=c++20 (internal
compiler error: in tsubst_expr, at cp/pt.cc:21534)+}
    {+FAIL:+} g++.old-deja/g++.law/operators4.C  -std=c++20 (test for excess
errors)
    PASS: g++.old-deja/g++.law/operators4.C  -std=c++98  (test for errors, line
18)
    PASS: g++.old-deja/g++.law/operators4.C  -std=c++98 (test for excess
errors)

    @@ -507132,8 +510319,9 @@ PASS: g++.old-deja/g++.other/headers1.C 
-std=c++14 (test for excess errors)
    PASS: g++.old-deja/g++.other/headers1.C  -std=c++14 execution test
    PASS: g++.old-deja/g++.other/headers1.C  -std=c++17 (test for excess
errors)
    PASS: g++.old-deja/g++.other/headers1.C  -std=c++17 execution test
    [-PASS:-]{+FAIL: g++.old-deja/g++.other/headers1.C  -std=c++20 (internal
compiler error: in tsubst_expr, at cp/pt.cc:21534)+}
    {+FAIL:+} g++.old-deja/g++.other/headers1.C  -std=c++20 (test for excess
errors)
    [-PASS:-]{+UNRESOLVED:+} g++.old-deja/g++.other/headers1.C  -std=c++20
[-execution test-]{+compilation failed to produce executable+}
    PASS: g++.old-deja/g++.other/headers1.C  -std=c++98 (test for excess
errors)
    PASS: g++.old-deja/g++.other/headers1.C  -std=c++98 execution test

    PASS: g++.old-deja/g++.robertl/eb3.C  -std=c++14 (test for excess errors)
    PASS: g++.old-deja/g++.robertl/eb3.C  -std=c++17 (test for excess errors)
    [-PASS:-]{+FAIL: g++.old-deja/g++.robertl/eb3.C  -std=c++20 (internal
compiler error: in tsubst_expr, at cp/pt.cc:21534)+}
    {+FAIL:+} g++.old-deja/g++.robertl/eb3.C  -std=c++20 (test for excess
errors)
    PASS: g++.old-deja/g++.robertl/eb3.C  -std=c++98 (test for excess errors)

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

* [Bug c++/112269] [14 Regression] x86_64 GNU/Linux '-m32' multilib 'libstdc++-v3/include/complex:1493: internal compiler error: in tsubst_expr, at cp/pt.cc:21534' since r14-4796-g3e3d73ed5e85e7
  2023-10-28 20:52 [Bug c++/112269] New: [14 Regression] x86_64 GNU/Linux '-m32' multilib 'libstdc++-v3/include/complex:1493: internal compiler error: in tsubst_expr, at cp/pt.cc:21534' tschwinge at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2023-10-31  8:17 ` tschwinge at gcc dot gnu.org
@ 2023-10-31 14:58 ` ppalka at gcc dot gnu.org
  2023-11-03  7:34 ` pinskia at gcc dot gnu.org
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: ppalka at gcc dot gnu.org @ 2023-10-31 14:58 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #7 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Thanks a lot, I can reproduce it now.  It turns out this PR and PR111703 can be
partially resolved by the same fix.

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

* [Bug c++/112269] [14 Regression] x86_64 GNU/Linux '-m32' multilib 'libstdc++-v3/include/complex:1493: internal compiler error: in tsubst_expr, at cp/pt.cc:21534' since r14-4796-g3e3d73ed5e85e7
  2023-10-28 20:52 [Bug c++/112269] New: [14 Regression] x86_64 GNU/Linux '-m32' multilib 'libstdc++-v3/include/complex:1493: internal compiler error: in tsubst_expr, at cp/pt.cc:21534' tschwinge at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2023-10-31 14:58 ` ppalka at gcc dot gnu.org
@ 2023-11-03  7:34 ` pinskia at gcc dot gnu.org
  2023-11-03  8:30 ` rguenth at gcc dot gnu.org
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-11-03  7:34 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 112362 has been marked as a duplicate of this bug. ***

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

* [Bug c++/112269] [14 Regression] x86_64 GNU/Linux '-m32' multilib 'libstdc++-v3/include/complex:1493: internal compiler error: in tsubst_expr, at cp/pt.cc:21534' since r14-4796-g3e3d73ed5e85e7
  2023-10-28 20:52 [Bug c++/112269] New: [14 Regression] x86_64 GNU/Linux '-m32' multilib 'libstdc++-v3/include/complex:1493: internal compiler error: in tsubst_expr, at cp/pt.cc:21534' tschwinge at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2023-11-03  7:34 ` pinskia at gcc dot gnu.org
@ 2023-11-03  8:30 ` rguenth at gcc dot gnu.org
  2023-11-04  8:28 ` redi at gcc dot gnu.org
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-11-03  8:30 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1

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

* [Bug c++/112269] [14 Regression] x86_64 GNU/Linux '-m32' multilib 'libstdc++-v3/include/complex:1493: internal compiler error: in tsubst_expr, at cp/pt.cc:21534' since r14-4796-g3e3d73ed5e85e7
  2023-10-28 20:52 [Bug c++/112269] New: [14 Regression] x86_64 GNU/Linux '-m32' multilib 'libstdc++-v3/include/complex:1493: internal compiler error: in tsubst_expr, at cp/pt.cc:21534' tschwinge at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2023-11-03  8:30 ` rguenth at gcc dot gnu.org
@ 2023-11-04  8:28 ` redi at gcc dot gnu.org
  2023-11-04 18:56 ` pinskia at gcc dot gnu.org
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: redi at gcc dot gnu.org @ 2023-11-04  8:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Patrick Palka from comment #5)
> I can't reproduce any of these testsuite failures on trunk with x86_64
> -m32... could you provide a preprocessed source file perhaps?

The libstdc++ testsuite shows lots of failures with -m32 -std=c++20

e.g.

FAIL: 23_containers/vector/48101-2_neg.cc  -std=c++20  (test for errors, line )
FAIL: 23_containers/vector/48101-2_neg.cc  -std=c++20 (test for excess errors)
Excess errors:
/tmp/build/x86_64-pc-linux-gnu/32/libstdc++-v3/include/complex:1493: internal
compiler error: in tsubst_expr, at cp/pt.cc:21534
0x78b9fb tsubst_expr(tree_node*, tree_node*, int, tree_node*)
        /home/test/src/gcc/gcc/cp/pt.cc:21534

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

* [Bug c++/112269] [14 Regression] x86_64 GNU/Linux '-m32' multilib 'libstdc++-v3/include/complex:1493: internal compiler error: in tsubst_expr, at cp/pt.cc:21534' since r14-4796-g3e3d73ed5e85e7
  2023-10-28 20:52 [Bug c++/112269] New: [14 Regression] x86_64 GNU/Linux '-m32' multilib 'libstdc++-v3/include/complex:1493: internal compiler error: in tsubst_expr, at cp/pt.cc:21534' tschwinge at gcc dot gnu.org
                   ` (10 preceding siblings ...)
  2023-11-04  8:28 ` redi at gcc dot gnu.org
@ 2023-11-04 18:56 ` pinskia at gcc dot gnu.org
  2023-11-07 17:20 ` ppalka at gcc dot gnu.org
                   ` (4 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-11-04 18:56 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|needs-reduction             |

--- Comment #10 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Reduced testcase (`-m32 -std=c++20` or `-m32 -fexcess-precision=standard`):
```
template <typename _Tp>
constexpr void fg(__complex__ float &n) {
  const __complex__ float __t;
  n /= __t;
}
```

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

* [Bug c++/112269] [14 Regression] x86_64 GNU/Linux '-m32' multilib 'libstdc++-v3/include/complex:1493: internal compiler error: in tsubst_expr, at cp/pt.cc:21534' since r14-4796-g3e3d73ed5e85e7
  2023-10-28 20:52 [Bug c++/112269] New: [14 Regression] x86_64 GNU/Linux '-m32' multilib 'libstdc++-v3/include/complex:1493: internal compiler error: in tsubst_expr, at cp/pt.cc:21534' tschwinge at gcc dot gnu.org
                   ` (11 preceding siblings ...)
  2023-11-04 18:56 ` pinskia at gcc dot gnu.org
@ 2023-11-07 17:20 ` ppalka at gcc dot gnu.org
  2023-11-15 17:03 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: ppalka at gcc dot gnu.org @ 2023-11-07 17:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Sorry for the breakage... FWIW a patch is on review at
https://gcc.gnu.org/pipermail/gcc-patches/2023-October/634859.html

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

* [Bug c++/112269] [14 Regression] x86_64 GNU/Linux '-m32' multilib 'libstdc++-v3/include/complex:1493: internal compiler error: in tsubst_expr, at cp/pt.cc:21534' since r14-4796-g3e3d73ed5e85e7
  2023-10-28 20:52 [Bug c++/112269] New: [14 Regression] x86_64 GNU/Linux '-m32' multilib 'libstdc++-v3/include/complex:1493: internal compiler error: in tsubst_expr, at cp/pt.cc:21534' tschwinge at gcc dot gnu.org
                   ` (12 preceding siblings ...)
  2023-11-07 17:20 ` ppalka at gcc dot gnu.org
@ 2023-11-15 17:03 ` cvs-commit at gcc dot gnu.org
  2023-11-15 17:05 ` ppalka at gcc dot gnu.org
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-11-15 17:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>:

https://gcc.gnu.org/g:6665a8572c8f24bd55c6081c91f461442c94dcfb

commit r14-5502-g6665a8572c8f24bd55c6081c91f461442c94dcfb
Author: Patrick Palka <ppalka@redhat.com>
Date:   Wed Nov 15 12:03:16 2023 -0500

    c++: constantness of local var in constexpr fn [PR111703, PR112269]

    potential_constant_expression was incorrectly treating most local
    variables from a constexpr function as constant because it wasn't
    considering the 'now' parameter.  This patch fixes this by relaxing
    its var_in_maybe_constexpr_fn checks accordingly, which turns out to
    partially fix two recently reported regressions:

    PR111703 is a regression caused by r11-550-gf65a3299a521a4 for restricting
    constexpr evaluation during warning-dependent folding.  The mechanism is
    intended to restrict only constant evaluation of the instantiated
    non-dependent expression, but it also ends up restricting constant
    evaluation occurring during instantiation of the expression, in particular
    when instantiating the converted argument 'x' (a VIEW_CONVERT_EXPR) into
    a copy constructor call.  This seems like a flaw in the mechanism, though
    I don't know if we want to fix the mechanism or get rid of it completely
    since the original testcases which motivated the mechanism are fixed more
    simply by r13-1225-gb00b95198e6720.  In any case, this patch partially
    fixes this by making us correctly treat 'x' as non-constant which prevents
    the problematic warning-dependent folding from occurring at all.

    PR112269 is caused by r14-4796-g3e3d73ed5e85e7 for merging tsubst_copy
    into tsubst_copy_and_build.  tsubst_copy used to exit early when 'args'
    was empty, behavior which that commit deliberately didn't preserve.
    This early exit masked the fact that COMPLEX_EXPR wasn't handled by
    tsubst at all, and is a tree code that apparently we could see during
    warning-dependent folding on some targets.  A complete fix is to add
    handling for this tree code in tsubst_expr, but this patch should fix
    the reported testsuite failures since the COMPLEX_EXPRs that crop up
    in <complex> are considered non-constant expressions after this patch.

            PR c++/111703
            PR c++/112269

    gcc/cp/ChangeLog:

            * constexpr.cc (potential_constant_expression_1) <case VAR_DECL>:
            Only consider var_in_maybe_constexpr_fn if 'now' is false.
            <case INDIRECT_REF>: Likewise.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp2a/concepts-fn8.C: New test.

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

* [Bug c++/112269] [14 Regression] x86_64 GNU/Linux '-m32' multilib 'libstdc++-v3/include/complex:1493: internal compiler error: in tsubst_expr, at cp/pt.cc:21534' since r14-4796-g3e3d73ed5e85e7
  2023-10-28 20:52 [Bug c++/112269] New: [14 Regression] x86_64 GNU/Linux '-m32' multilib 'libstdc++-v3/include/complex:1493: internal compiler error: in tsubst_expr, at cp/pt.cc:21534' tschwinge at gcc dot gnu.org
                   ` (13 preceding siblings ...)
  2023-11-15 17:03 ` cvs-commit at gcc dot gnu.org
@ 2023-11-15 17:05 ` ppalka at gcc dot gnu.org
  2023-11-24 16:56 ` cvs-commit at gcc dot gnu.org
  2023-11-27 22:02 ` cvs-commit at gcc dot gnu.org
  16 siblings, 0 replies; 18+ messages in thread
From: ppalka at gcc dot gnu.org @ 2023-11-15 17:05 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #13 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Should be fixed.

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

* [Bug c++/112269] [14 Regression] x86_64 GNU/Linux '-m32' multilib 'libstdc++-v3/include/complex:1493: internal compiler error: in tsubst_expr, at cp/pt.cc:21534' since r14-4796-g3e3d73ed5e85e7
  2023-10-28 20:52 [Bug c++/112269] New: [14 Regression] x86_64 GNU/Linux '-m32' multilib 'libstdc++-v3/include/complex:1493: internal compiler error: in tsubst_expr, at cp/pt.cc:21534' tschwinge at gcc dot gnu.org
                   ` (14 preceding siblings ...)
  2023-11-15 17:05 ` ppalka at gcc dot gnu.org
@ 2023-11-24 16:56 ` cvs-commit at gcc dot gnu.org
  2023-11-27 22:02 ` cvs-commit at gcc dot gnu.org
  16 siblings, 0 replies; 18+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-11-24 16:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #14 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Patrick Palka
<ppalka@gcc.gnu.org>:

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

commit r13-8097-gdd57446bd90c3225ce45e8818c5b00f2e86a9607
Author: Patrick Palka <ppalka@redhat.com>
Date:   Wed Nov 15 12:03:16 2023 -0500

    c++: constantness of local var in constexpr fn [PR111703, PR112269]

    potential_constant_expression was incorrectly treating most local
    variables from a constexpr function as constant because it wasn't
    considering the 'now' parameter.  This patch fixes this by relaxing
    its var_in_maybe_constexpr_fn checks accordingly, which turns out to
    partially fix two recently reported regressions:

    PR111703 is a regression caused by r11-550-gf65a3299a521a4 for restricting
    constexpr evaluation during warning-dependent folding.  The mechanism is
    intended to restrict only constant evaluation of the instantiated
    non-dependent expression, but it also ends up restricting constant
    evaluation occurring during instantiation of the expression, in particular
    when instantiating the converted argument 'x' (a VIEW_CONVERT_EXPR) into
    a copy constructor call.  This seems like a flaw in the mechanism, though
    I don't know if we want to fix the mechanism or get rid of it completely
    since the original testcases which motivated the mechanism are fixed more
    simply by r13-1225-gb00b95198e6720.  In any case, this patch partially
    fixes this by making us correctly treat 'x' as non-constant which prevents
    the problematic warning-dependent folding from occurring at all.

    PR112269 is caused by r14-4796-g3e3d73ed5e85e7 for merging tsubst_copy
    into tsubst_copy_and_build.  tsubst_copy used to exit early when 'args'
    was empty, behavior which that commit deliberately didn't preserve.
    This early exit masked the fact that COMPLEX_EXPR wasn't handled by
    tsubst at all, and is a tree code that apparently we could see during
    warning-dependent folding on some targets.  A complete fix is to add
    handling for this tree code in tsubst_expr, but this patch should fix
    the reported testsuite failures since the COMPLEX_EXPRs that crop up
    in <complex> are considered non-constant expressions after this patch.

            PR c++/111703
            PR c++/112269

    gcc/cp/ChangeLog:

            * constexpr.cc (potential_constant_expression_1) <case VAR_DECL>:
            Only consider var_in_maybe_constexpr_fn if 'now' is false.
            <case INDIRECT_REF>: Likewise.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp2a/concepts-fn8.C: New test.

    (cherry picked from commit 6665a8572c8f24bd55c6081c91f461442c94dcfb)

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

* [Bug c++/112269] [14 Regression] x86_64 GNU/Linux '-m32' multilib 'libstdc++-v3/include/complex:1493: internal compiler error: in tsubst_expr, at cp/pt.cc:21534' since r14-4796-g3e3d73ed5e85e7
  2023-10-28 20:52 [Bug c++/112269] New: [14 Regression] x86_64 GNU/Linux '-m32' multilib 'libstdc++-v3/include/complex:1493: internal compiler error: in tsubst_expr, at cp/pt.cc:21534' tschwinge at gcc dot gnu.org
                   ` (15 preceding siblings ...)
  2023-11-24 16:56 ` cvs-commit at gcc dot gnu.org
@ 2023-11-27 22:02 ` cvs-commit at gcc dot gnu.org
  16 siblings, 0 replies; 18+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-11-27 22:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #15 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Patrick Palka
<ppalka@gcc.gnu.org>:

https://gcc.gnu.org/g:6a31302a6c8bec9af3c93f736c2b1a76e9a530e2

commit r12-10016-g6a31302a6c8bec9af3c93f736c2b1a76e9a530e2
Author: Patrick Palka <ppalka@redhat.com>
Date:   Wed Nov 15 12:03:16 2023 -0500

    c++: constantness of local var in constexpr fn [PR111703, PR112269]

    potential_constant_expression was incorrectly treating most local
    variables from a constexpr function as constant because it wasn't
    considering the 'now' parameter.  This patch fixes this by relaxing
    its var_in_maybe_constexpr_fn checks accordingly, which turns out to
    partially fix two recently reported regressions:

    PR111703 is a regression caused by r11-550-gf65a3299a521a4 for restricting
    constexpr evaluation during warning-dependent folding.  The mechanism is
    intended to restrict only constant evaluation of the instantiated
    non-dependent expression, but it also ends up restricting constant
    evaluation occurring during instantiation of the expression, in particular
    when instantiating the converted argument 'x' (a VIEW_CONVERT_EXPR) into
    a copy constructor call.  This seems like a flaw in the mechanism, though
    I don't know if we want to fix the mechanism or get rid of it completely
    since the original testcases which motivated the mechanism are fixed more
    simply by r13-1225-gb00b95198e6720.  In any case, this patch partially
    fixes this by making us correctly treat 'x' as non-constant which prevents
    the problematic warning-dependent folding from occurring at all.

    PR112269 is caused by r14-4796-g3e3d73ed5e85e7 for merging tsubst_copy
    into tsubst_copy_and_build.  tsubst_copy used to exit early when 'args'
    was empty, behavior which that commit deliberately didn't preserve.
    This early exit masked the fact that COMPLEX_EXPR wasn't handled by
    tsubst at all, and is a tree code that apparently we could see during
    warning-dependent folding on some targets.  A complete fix is to add
    handling for this tree code in tsubst_expr, but this patch should fix
    the reported testsuite failures since the COMPLEX_EXPRs that crop up
    in <complex> are considered non-constant expressions after this patch.

            PR c++/111703
            PR c++/112269

    gcc/cp/ChangeLog:

            * constexpr.cc (potential_constant_expression_1) <case VAR_DECL>:
            Only consider var_in_maybe_constexpr_fn if 'now' is false.
            <case INDIRECT_REF>: Likewise.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp2a/concepts-fn8.C: New test.

    (cherry picked from commit 6665a8572c8f24bd55c6081c91f461442c94dcfb)

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

end of thread, other threads:[~2023-11-27 22:02 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-28 20:52 [Bug c++/112269] New: [14 Regression] x86_64 GNU/Linux '-m32' multilib 'libstdc++-v3/include/complex:1493: internal compiler error: in tsubst_expr, at cp/pt.cc:21534' tschwinge at gcc dot gnu.org
2023-10-28 21:03 ` [Bug c++/112269] " pinskia at gcc dot gnu.org
2023-10-28 21:04 ` pinskia at gcc dot gnu.org
2023-10-29  8:37 ` schwab@linux-m68k.org
2023-10-29  9:46 ` schwab@linux-m68k.org
2023-10-29 16:33 ` [Bug c++/112269] [14 Regression] x86_64 GNU/Linux '-m32' multilib 'libstdc++-v3/include/complex:1493: internal compiler error: in tsubst_expr, at cp/pt.cc:21534' since r14-4796-g3e3d73ed5e85e7 pinskia at gcc dot gnu.org
2023-10-30 16:19 ` ppalka at gcc dot gnu.org
2023-10-31  8:17 ` tschwinge at gcc dot gnu.org
2023-10-31 14:58 ` ppalka at gcc dot gnu.org
2023-11-03  7:34 ` pinskia at gcc dot gnu.org
2023-11-03  8:30 ` rguenth at gcc dot gnu.org
2023-11-04  8:28 ` redi at gcc dot gnu.org
2023-11-04 18:56 ` pinskia at gcc dot gnu.org
2023-11-07 17:20 ` ppalka at gcc dot gnu.org
2023-11-15 17:03 ` cvs-commit at gcc dot gnu.org
2023-11-15 17:05 ` ppalka at gcc dot gnu.org
2023-11-24 16:56 ` cvs-commit at gcc dot gnu.org
2023-11-27 22:02 ` cvs-commit 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).