public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/104084] New: [12 regression] Internal compiler error: tree check: expected target_expr, have compound_expr in build_new_1
@ 2022-01-18  9:37 linux at carewolf dot com
  2022-01-18  9:38 ` [Bug c++/104084] " marxin at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: linux at carewolf dot com @ 2022-01-18  9:37 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104084
           Summary: [12 regression] Internal compiler error: tree check:
                    expected target_expr, have compound_expr in
                    build_new_1
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: linux at carewolf dot com
  Target Milestone: ---

Another error encounted while compiling Qt with gcc 12. This time in libgav1
(used by Chromium).

../../../../../../qtwebengine/src/3rdparty/chromium/third_party/libgav1/src/src/utils/dynamic_buffer.h:40:19:
internal compiler error: tree check: expected target_expr, have compound_expr
in build_new_1, at cp/init.c:3792
   40 |     buffer_.reset(new (std::nothrow) T[size]);
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~
0x8a12eb tree_check_failed(tree_node const*, char const*, int, char const*,
...)
        ../../gcc/tree.c:8702
0x6f06b9 tree_operand_check_code(tree_node*, tree_code, int, char const*, int,
char const*)
        ../../gcc/tree.h:3950
0x6f06b9 build_new_1
        ../../gcc/cp/init.c:3792
0xa5c8f1 build_new(unsigned int, vec<tree_node*, va_gc, vl_embed>**,
tree_node*, tree_node*, vec<tree_node*, va_gc, vl_embed>**, int, int)
        ../../gcc/cp/init.c:4002
0xb4a6ad tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ../../gcc/cp/pt.c:20387
0xb750ca tsubst_copy_and_build_call_args
        ../../gcc/cp/pt.c:19761
0xb48c88 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ../../gcc/cp/pt.c:20508
0xb5d33f tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/cp/pt.c:19316
0xb5ed6b tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/cp/pt.c:18329
0xb5e484 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/cp/pt.c:18301
0xb5e4ec tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/cp/pt.c:18658
0xb5c048 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/cp/pt.c:18287
0xb5c048 instantiate_body
        ../../gcc/cp/pt.c:26239
0xb5d080 instantiate_decl(tree_node*, bool, bool)
        ../../gcc/cp/pt.c:26532
0xb813d3 instantiate_pending_templates(int)
        ../../gcc/cp/pt.c:26611
0xa3ba28 c_parse_final_cleanups()
        ../../gcc/cp/decl2.c:5097


Disabling optimizations or using different C++ standards, or fuzzing other
compiler flags didn't seem to help.

Let me know if you need the intermediate code.

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

* [Bug c++/104084] [12 regression] Internal compiler error: tree check: expected target_expr, have compound_expr in build_new_1
  2022-01-18  9:37 [Bug c++/104084] New: [12 regression] Internal compiler error: tree check: expected target_expr, have compound_expr in build_new_1 linux at carewolf dot com
@ 2022-01-18  9:38 ` marxin at gcc dot gnu.org
  2022-01-18  9:44 ` linux at carewolf dot com
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-01-18  9:38 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
                 CC|                            |marxin at gcc dot gnu.org
   Last reconfirmed|                            |2022-01-18
             Status|UNCONFIRMED                 |WAITING

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Yes, please attach pre-processed source file (-E option) and output of -v on
command line.

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

* [Bug c++/104084] [12 regression] Internal compiler error: tree check: expected target_expr, have compound_expr in build_new_1
  2022-01-18  9:37 [Bug c++/104084] New: [12 regression] Internal compiler error: tree check: expected target_expr, have compound_expr in build_new_1 linux at carewolf dot com
  2022-01-18  9:38 ` [Bug c++/104084] " marxin at gcc dot gnu.org
@ 2022-01-18  9:44 ` linux at carewolf dot com
  2022-01-18  9:48 ` linux at carewolf dot com
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: linux at carewolf dot com @ 2022-01-18  9:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Allan Jensen <linux at carewolf dot com> ---
Removing the (std::nothrow), and declaring the untagged new operator (instead
of declaring them deleted), seems to work around the issue.

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

* [Bug c++/104084] [12 regression] Internal compiler error: tree check: expected target_expr, have compound_expr in build_new_1
  2022-01-18  9:37 [Bug c++/104084] New: [12 regression] Internal compiler error: tree check: expected target_expr, have compound_expr in build_new_1 linux at carewolf dot com
  2022-01-18  9:38 ` [Bug c++/104084] " marxin at gcc dot gnu.org
  2022-01-18  9:44 ` linux at carewolf dot com
@ 2022-01-18  9:48 ` linux at carewolf dot com
  2022-01-18  9:50 ` linux at carewolf dot com
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: linux at carewolf dot com @ 2022-01-18  9:48 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Allan Jensen <linux at carewolf dot com> ---
-v output:

Using built-in specs.
COLLECT_GCC=/opt/gcc/bin/g++-12
Target: x86_64-pc-linux-gnu
Configured with: ../configure --enable-languages=c,c++ --prefix=/opt/gcc
--program-suffix=-12
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.1 20220117 (experimental) (GCC) 
COLLECT_GCC_OPTIONS='-MMD' '-MF'
'obj/third_party/libgav1/libgav1/loop_restoration_info.o.d' '-D' 'USE_UDEV'
'-D' 'USE_AURA=1' '-D' 'USE_NSS_CERTS=1' '-D' 'USE_OZONE=1' '-D'
'OFFICIAL_BUILD' '-D' 'TOOLKIT_QT' '-D' '_FILE_OFFSET_BITS=64' '-D'
'_LARGEFILE_SOURCE' '-D' '_LARGEFILE64_SOURCE' '-D' 'NO_UNWIND_TABLES' '-D'
'NDEBUG' '-D' 'NVALGRIND' '-D' 'DYNAMIC_ANNOTATIONS_ENABLED=0' '-D'
'LIBGAV1_MAX_BITDEPTH=10' '-D' 'LIBGAV1_THREADPOOL_USE_STD_MUTEX' '-D'
'LIBGAV1_ENABLE_LOGGING=0' '-D' 'LIBGAV1_PUBLIC=' '-I' 'gen' '-I'
'../../../../../../qtwebengine/src/3rdparty/chromium' '-I'
'../../../../../../qtwebengine/src/3rdparty/chromium/third_party/libgav1/src'
'-I'
'../../../../../../qtwebengine/src/3rdparty/chromium/third_party/libgav1/src/src'
'-fno-ident' '-fno-strict-aliasing' '--param=ssp-buffer-size=4'
'-fstack-protector' '-Wno-unknown-pragmas' '-Wno-parentheses'
'-Wno-sign-compare' '-Wstringop-overflow=0' '-Wno-stringop-overread'
'-Wno-psabi' '-Wno-multichar' '-Wno-format-zero-length' '-fno-unwind-tables'
'-fno-asynchronous-unwind-tables' '-fPIC' '-pipe' '-pthread' '-m64' '-O2'
'-fno-omit-frame-pointer' '-g1' '-fvisibility=hidden'
'-Wno-unused-local-typedefs' '-Wno-maybe-uninitialized'
'-Wno-deprecated-declarations' '-fno-delete-null-pointer-checks' '-Wno-comment'
'-Wno-packed-not-aligned' '-Wno-dangling-else'
'-Wno-missing-field-initializers' '-Wno-unused-parameter' '-O2'
'-fdata-sections' '-ffunction-sections' '-std=gnu++14'
'-fvisibility-inlines-hidden' '-Wno-narrowing' '-Wno-attributes'
'-Wno-class-memaccess' '-Wno-subobject-linkage' '-Wno-invalid-offsetof'
'-Wno-return-type' '-Wno-deprecated-copy' '-c' '-o'
'obj/third_party/libgav1/libgav1/loop_restoration_info.o' '-v' '-shared-libgcc'
'-mtune=generic' '-march=x86-64' '-dumpdir' 'obj/third_party/libgav1/libgav1/'
 /opt/gcc/libexec/gcc/x86_64-pc-linux-gnu/12.0.1/cc1plus -quiet -v -I gen -I
../../../../../../qtwebengine/src/3rdparty/chromium -I
../../../../../../qtwebengine/src/3rdparty/chromium/third_party/libgav1/src -I
../../../../../../qtwebengine/src/3rdparty/chromium/third_party/libgav1/src/src
-imultiarch x86_64-linux-gnu -MMD
obj/third_party/libgav1/libgav1/loop_restoration_info.d -MF
obj/third_party/libgav1/libgav1/loop_restoration_info.o.d -MQ
obj/third_party/libgav1/libgav1/loop_restoration_info.o -D_GNU_SOURCE
-D_REENTRANT -D USE_UDEV -D USE_AURA=1 -D USE_NSS_CERTS=1 -D USE_OZONE=1 -D
OFFICIAL_BUILD -D TOOLKIT_QT -D _FILE_OFFSET_BITS=64 -D _LARGEFILE_SOURCE -D
_LARGEFILE64_SOURCE -D NO_UNWIND_TABLES -D NDEBUG -D NVALGRIND -D
DYNAMIC_ANNOTATIONS_ENABLED=0 -D LIBGAV1_MAX_BITDEPTH=10 -D
LIBGAV1_THREADPOOL_USE_STD_MUTEX -D LIBGAV1_ENABLE_LOGGING=0 -D LIBGAV1_PUBLIC=
../../../../../../qtwebengine/src/3rdparty/chromium/third_party/libgav1/src/src/loop_restoration_info.cc
-quiet -dumpdir obj/third_party/libgav1/libgav1/ -dumpbase
loop_restoration_info.cc -dumpbase-ext .cc -m64 -mtune=generic -march=x86-64
-g1 -O2 -O2 -Wno-unknown-pragmas -Wno-parentheses -Wno-sign-compare
-Wstringop-overflow=0 -Wno-stringop-overread -Wno-psabi -Wno-multichar
-Wno-format-zero-length -Wno-unused-local-typedefs -Wno-maybe-uninitialized
-Wno-deprecated-declarations -Wno-comment -Wno-packed-not-aligned
-Wno-dangling-else -Wno-missing-field-initializers -Wno-unused-parameter
-Wno-narrowing -Wno-attributes -Wno-class-memaccess -Wno-subobject-linkage
-Wno-invalid-offsetof -Wno-return-type -Wno-deprecated-copy -std=gnu++14
-version -fno-ident -fno-strict-aliasing -fstack-protector -fno-unwind-tables
-fno-asynchronous-unwind-tables -fPIC -fno-omit-frame-pointer
-fvisibility=hidden -fno-delete-null-pointer-checks -fdata-sections
-ffunction-sections -fvisibility-inlines-hidden --param=ssp-buffer-size=4 -o -
|
 as -v -I gen -I ../../../../../../qtwebengine/src/3rdparty/chromium -I
../../../../../../qtwebengine/src/3rdparty/chromium/third_party/libgav1/src -I
../../../../../../qtwebengine/src/3rdparty/chromium/third_party/libgav1/src/src
--gdwarf-5 --64 -o obj/third_party/libgav1/libgav1/loop_restoration_info.o
GNU assembler version 2.36.1 (x86_64-linux-gnu) using BFD version (GNU Binutils
for Ubuntu) 2.36.1
GNU C++14 (GCC) version 12.0.1 20220117 (experimental) (x86_64-pc-linux-gnu)
        compiled by GNU C version 12.0.1 20220117 (experimental), GMP version
6.2.1, MPFR version 4.1.0, MPC version 1.2.0, isl version isl-0.23-GMP

GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory
"/opt/gcc/lib/gcc/x86_64-pc-linux-gnu/12.0.1/../../../../x86_64-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 gen
 ../../../../../../qtwebengine/src/3rdparty/chromium
 ../../../../../../qtwebengine/src/3rdparty/chromium/third_party/libgav1/src

../../../../../../qtwebengine/src/3rdparty/chromium/third_party/libgav1/src/src
 /opt/gcc/lib/gcc/x86_64-pc-linux-gnu/12.0.1/../../../../include/c++/12.0.1

/opt/gcc/lib/gcc/x86_64-pc-linux-gnu/12.0.1/../../../../include/c++/12.0.1/x86_64-pc-linux-gnu

/opt/gcc/lib/gcc/x86_64-pc-linux-gnu/12.0.1/../../../../include/c++/12.0.1/backward
 /opt/gcc/lib/gcc/x86_64-pc-linux-gnu/12.0.1/include
 /usr/local/include
 /opt/gcc/include
 /opt/gcc/lib/gcc/x86_64-pc-linux-gnu/12.0.1/include-fixed
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
GNU C++14 (GCC) version 12.0.1 20220117 (experimental) (x86_64-pc-linux-gnu)
        compiled by GNU C version 12.0.1 20220117 (experimental), GMP version
6.2.1, MPFR version 4.1.0, MPC version 1.2.0, isl version isl-0.23-GMP

GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 42a6808a38133804a81fe40953dea7b6
In file included from
../../../../../../qtwebengine/src/3rdparty/chromium/third_party/libgav1/src/src/loop_restoration_info.h:28,
                 from
../../../../../../qtwebengine/src/3rdparty/chromium/third_party/libgav1/src/src/loop_restoration_info.cc:15:
../../../../../../qtwebengine/src/3rdparty/chromium/third_party/libgav1/src/src/utils/dynamic_buffer.h:
In instantiation of ‘bool libgav1::DynamicBuffer<T>::Resize(size_t) [with T =
libgav1::RestorationUnitInfo; size_t = long unsigned int]’:
../../../../../../qtwebengine/src/3rdparty/chromium/third_party/libgav1/src/src/loop_restoration_info.cc:89:44:
  required from here
../../../../../../qtwebengine/src/3rdparty/chromium/third_party/libgav1/src/src/utils/dynamic_buffer.h:40:19:
internal compiler error: tree check: expected target_expr, have compound_expr
in build_new_1, at cp/init.c:3792
   40 |     buffer_.reset(new (std::nothrow) T[size]);
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~
0x8a12eb tree_check_failed(tree_node const*, char const*, int, char const*,
...)
        ../../gcc/tree.c:8702
0x6f06b9 tree_operand_check_code(tree_node*, tree_code, int, char const*, int,
char const*)
        ../../gcc/tree.h:3950
0x6f06b9 build_new_1
        ../../gcc/cp/init.c:3792
0xa5c8f1 build_new(unsigned int, vec<tree_node*, va_gc, vl_embed>**,
tree_node*, tree_node*, vec<tree_node*, va_gc, vl_embed>**, int, int)
        ../../gcc/cp/init.c:4002
0xb4a6ad tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ../../gcc/cp/pt.c:20387
0xb750ca tsubst_copy_and_build_call_args
        ../../gcc/cp/pt.c:19761
0xb48c88 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ../../gcc/cp/pt.c:20508
0xb5d33f tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/cp/pt.c:19316
0xb5ed6b tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/cp/pt.c:18329
0xb5e484 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/cp/pt.c:18301
0xb5e4ec tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/cp/pt.c:18658
0xb5c048 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/cp/pt.c:18287
0xb5c048 instantiate_body
        ../../gcc/cp/pt.c:26239
0xb5d080 instantiate_decl(tree_node*, bool, bool)
        ../../gcc/cp/pt.c:26532
0xb813d3 instantiate_pending_templates(int)
        ../../gcc/cp/pt.c:26611
0xa3ba28 c_parse_final_cleanups()
        ../../gcc/cp/decl2.c:5097
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.

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

* [Bug c++/104084] [12 regression] Internal compiler error: tree check: expected target_expr, have compound_expr in build_new_1
  2022-01-18  9:37 [Bug c++/104084] New: [12 regression] Internal compiler error: tree check: expected target_expr, have compound_expr in build_new_1 linux at carewolf dot com
                   ` (2 preceding siblings ...)
  2022-01-18  9:48 ` linux at carewolf dot com
@ 2022-01-18  9:50 ` linux at carewolf dot com
  2022-01-18  9:50 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: linux at carewolf dot com @ 2022-01-18  9:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Allan Jensen <linux at carewolf dot com> ---
Created attachment 52217
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52217&action=edit
-E output

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

* [Bug c++/104084] [12 regression] Internal compiler error: tree check: expected target_expr, have compound_expr in build_new_1
  2022-01-18  9:37 [Bug c++/104084] New: [12 regression] Internal compiler error: tree check: expected target_expr, have compound_expr in build_new_1 linux at carewolf dot com
                   ` (3 preceding siblings ...)
  2022-01-18  9:50 ` linux at carewolf dot com
@ 2022-01-18  9:50 ` rguenth at gcc dot gnu.org
  2022-01-18 10:00 ` marxin at gcc dot gnu.org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-01-18  9:50 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
   Target Milestone|---                         |12.0

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

* [Bug c++/104084] [12 regression] Internal compiler error: tree check: expected target_expr, have compound_expr in build_new_1
  2022-01-18  9:37 [Bug c++/104084] New: [12 regression] Internal compiler error: tree check: expected target_expr, have compound_expr in build_new_1 linux at carewolf dot com
                   ` (4 preceding siblings ...)
  2022-01-18  9:50 ` rguenth at gcc dot gnu.org
@ 2022-01-18 10:00 ` marxin at gcc dot gnu.org
  2022-01-18 11:56 ` [Bug c++/104084] [12 regression] Internal compiler error: tree check: expected target_expr, have compound_expr in build_new_1 since r12-6375-g6cd51207f5732b52 marxin at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-01-18 10:00 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW
           Keywords|                            |needs-bisection,
                   |                            |needs-reduction

--- Comment #5 from Martin Liška <marxin at gcc dot gnu.org> ---
Reducing that right now, thanks for the test-case.

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

* [Bug c++/104084] [12 regression] Internal compiler error: tree check: expected target_expr, have compound_expr in build_new_1 since r12-6375-g6cd51207f5732b52
  2022-01-18  9:37 [Bug c++/104084] New: [12 regression] Internal compiler error: tree check: expected target_expr, have compound_expr in build_new_1 linux at carewolf dot com
                   ` (5 preceding siblings ...)
  2022-01-18 10:00 ` marxin at gcc dot gnu.org
@ 2022-01-18 11:56 ` marxin at gcc dot gnu.org
  2022-01-18 13:26 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-01-18 11:56 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1
            Summary|[12 regression] Internal    |[12 regression] Internal
                   |compiler error: tree check: |compiler error: tree check:
                   |expected target_expr, have  |expected target_expr, have
                   |compound_expr in            |compound_expr in
                   |build_new_1                 |build_new_1 since
                   |                            |r12-6375-g6cd51207f5732b52
           Keywords|needs-bisection,            |rejects-valid
                   |needs-reduction             |
                 CC|                            |jason at gcc dot gnu.org

--- Comment #6 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r12-6375-g6cd51207f5732b52.

Reduced test-case:

$ cat pr104084.C
int nothrow;
struct MaxAlignedAllocable {
  void *operator new[](unsigned long, int);
  void operator delete[](void *);
  long Resize_size;
  void Resize() { new (nothrow) MaxAlignedAllocable[Resize_size]; }
};

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

* [Bug c++/104084] [12 regression] Internal compiler error: tree check: expected target_expr, have compound_expr in build_new_1 since r12-6375-g6cd51207f5732b52
  2022-01-18  9:37 [Bug c++/104084] New: [12 regression] Internal compiler error: tree check: expected target_expr, have compound_expr in build_new_1 linux at carewolf dot com
                   ` (6 preceding siblings ...)
  2022-01-18 11:56 ` [Bug c++/104084] [12 regression] Internal compiler error: tree check: expected target_expr, have compound_expr in build_new_1 since r12-6375-g6cd51207f5732b52 marxin at gcc dot gnu.org
@ 2022-01-18 13:26 ` jakub at gcc dot gnu.org
  2022-01-21 17:43 ` jason at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-01-18 13:26 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Martin Liška from comment #6)
> Started with r12-6375-g6cd51207f5732b52.
> 
> Reduced test-case:
> 
> $ cat pr104084.C
> int nothrow;
> struct MaxAlignedAllocable {
>   void *operator new[](unsigned long, int);
>   void operator delete[](void *);
>   long Resize_size;
>   void Resize() { new (nothrow) MaxAlignedAllocable[Resize_size]; }
> };

Better not hardcode a particular size_t (for more recent standard versions one
could use decltype (sizeof 0) too).
int nothrow;
struct MaxAlignedAllocable {
  void *operator new[](__SIZE_TYPE__, int);
  void operator delete[](void *);
  long Resize_size;
  void Resize() { new (nothrow) MaxAlignedAllocable[Resize_size]; }
};

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

* [Bug c++/104084] [12 regression] Internal compiler error: tree check: expected target_expr, have compound_expr in build_new_1 since r12-6375-g6cd51207f5732b52
  2022-01-18  9:37 [Bug c++/104084] New: [12 regression] Internal compiler error: tree check: expected target_expr, have compound_expr in build_new_1 linux at carewolf dot com
                   ` (7 preceding siblings ...)
  2022-01-18 13:26 ` jakub at gcc dot gnu.org
@ 2022-01-21 17:43 ` jason at gcc dot gnu.org
  2022-01-21 20:18 ` cvs-commit at gcc dot gnu.org
  2022-01-21 20:18 ` jason at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: jason at gcc dot gnu.org @ 2022-01-21 17:43 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

* [Bug c++/104084] [12 regression] Internal compiler error: tree check: expected target_expr, have compound_expr in build_new_1 since r12-6375-g6cd51207f5732b52
  2022-01-18  9:37 [Bug c++/104084] New: [12 regression] Internal compiler error: tree check: expected target_expr, have compound_expr in build_new_1 linux at carewolf dot com
                   ` (8 preceding siblings ...)
  2022-01-21 17:43 ` jason at gcc dot gnu.org
@ 2022-01-21 20:18 ` cvs-commit at gcc dot gnu.org
  2022-01-21 20:18 ` jason at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-01-21 20:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 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:847a8301add0a316767878342c1367948835c181

commit r12-6808-g847a8301add0a316767878342c1367948835c181
Author: Jason Merrill <jason@redhat.com>
Date:   Fri Jan 21 12:49:03 2022 -0500

    c++: class array new checking [PR104084]

    My patch for PR20040 made us stop exiting early from build_new_1 in
    cases of trivial initialization if there's a class operator delete; as a
    result, code later in the function needs to handle this case properly.

            PR c++/104084
            PR c++/20040

    gcc/cp/ChangeLog:

            * init.cc (build_new_1): Only pull out TARGET_EXPR_INITIAL if
            alloc_expr is a TARGET_EXPR.

    gcc/testsuite/ChangeLog:

            * g++.dg/init/new50.C: New test.

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

* [Bug c++/104084] [12 regression] Internal compiler error: tree check: expected target_expr, have compound_expr in build_new_1 since r12-6375-g6cd51207f5732b52
  2022-01-18  9:37 [Bug c++/104084] New: [12 regression] Internal compiler error: tree check: expected target_expr, have compound_expr in build_new_1 linux at carewolf dot com
                   ` (9 preceding siblings ...)
  2022-01-21 20:18 ` cvs-commit at gcc dot gnu.org
@ 2022-01-21 20:18 ` jason at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: jason at gcc dot gnu.org @ 2022-01-21 20:18 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #9 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2022-01-21 20:18 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-18  9:37 [Bug c++/104084] New: [12 regression] Internal compiler error: tree check: expected target_expr, have compound_expr in build_new_1 linux at carewolf dot com
2022-01-18  9:38 ` [Bug c++/104084] " marxin at gcc dot gnu.org
2022-01-18  9:44 ` linux at carewolf dot com
2022-01-18  9:48 ` linux at carewolf dot com
2022-01-18  9:50 ` linux at carewolf dot com
2022-01-18  9:50 ` rguenth at gcc dot gnu.org
2022-01-18 10:00 ` marxin at gcc dot gnu.org
2022-01-18 11:56 ` [Bug c++/104084] [12 regression] Internal compiler error: tree check: expected target_expr, have compound_expr in build_new_1 since r12-6375-g6cd51207f5732b52 marxin at gcc dot gnu.org
2022-01-18 13:26 ` jakub at gcc dot gnu.org
2022-01-21 17:43 ` jason at gcc dot gnu.org
2022-01-21 20:18 ` cvs-commit at gcc dot gnu.org
2022-01-21 20:18 ` 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).