public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/114619] New: [14 regression] ICE with -fno-elide-constructors in C++14 mode for non-constant initializer in array new
@ 2024-04-06 14:46 mital at mitalashok dot co.uk
  2024-04-08  8:23 ` [Bug c++/114619] [13/14 regression] ICE with -fno-elide-constructors in C++14 mode for non-constant initializer in array new since r13-3175-g6ffbf87ca66f4e rguenth at gcc dot gnu.org
  2024-05-21  9:19 ` [Bug c++/114619] [13/14/15 " jakub at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: mital at mitalashok dot co.uk @ 2024-04-06 14:46 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 114619
           Summary: [14 regression] ICE with -fno-elide-constructors in
                    C++14 mode for non-constant initializer in array new
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mital at mitalashok dot co.uk
  Target Milestone: ---

<https://godbolt.org/z/bc551qd51>:

    struct X {
        /*constexpr*/ X(const X&) {}
    };

    extern X x;

    int main() {
        new X[1]{x};
    }

Compiled with `-std=c++14 -fno-elide-constructors` gives an internal compiler
error:

    test.cpp: In function ‘int main()’:
    test.cpp:8:14: internal compiler error: in cp_gimplify_expr, at
cp/cp-gimplify.cc:904
        8 |     new X[1]{x};
          |              ^
    0x781b7d cp_gimplify_expr(tree_node**, gimple**, gimple**)
            ./gcc/gcc/cp/cp-gimplify.cc:904
    0x104c159 gimplify_expr(tree_node**, gimple**, gimple**, bool
(*)(tree_node*), int)
            ./gcc/gcc/gimplify.cc:17788
    0x10577ef gimplify_addr_expr
            ./gcc/gcc/gimplify.cc:6910
    0x104dca0 gimplify_expr(tree_node**, gimple**, gimple**, bool
(*)(tree_node*), int)
            ./gcc/gcc/gimplify.cc:17929
    0x105c9b3 gimplify_expr
            ./gcc/gcc/gimplify.cc:18951
    0x105c9b3 gimplify_arg(tree_node**, gimple**, unsigned int, bool)
            ./gcc/gcc/gimplify.cc:3778
    0x105d599 gimplify_call_expr
            ./gcc/gcc/gimplify.cc:4063
    0x104d280 gimplify_expr(tree_node**, gimple**, gimple**, bool
(*)(tree_node*), int)
            ./gcc/gcc/gimplify.cc:17851
    0x10504ba gimplify_stmt(tree_node**, gimple**)
            ./gcc/gcc/gimplify.cc:7576
    0x104e3ab gimplify_statement_list
            ./gcc/gcc/gimplify.cc:2249
    0x104e3ab gimplify_expr(tree_node**, gimple**, gimple**, bool
(*)(tree_node*), int)
            ./gcc/gcc/gimplify.cc:18327
    0x105eaf7 gimplify_stmt(tree_node**, gimple**)
            ./gcc/gcc/gimplify.cc:7576
    0x105eaf7 gimplify_compound_expr
            ./gcc/gcc/gimplify.cc:6761
    0x105eba1 gimplify_compound_expr
            ./gcc/gcc/gimplify.cc:6759
    0x104d440 gimplify_expr(tree_node**, gimple**, gimple**, bool
(*)(tree_node*), int)
            ./gcc/gcc/gimplify.cc:17872
    0x104d157 gimplify_stmt(tree_node**, gimple**)
            ./gcc/gcc/gimplify.cc:7576
    0x104d157 gimplify_cleanup_point_expr
            ./gcc/gcc/gimplify.cc:7314
    0x104d157 gimplify_expr(tree_node**, gimple**, gimple**, bool
(*)(tree_node*), int)
            ./gcc/gcc/gimplify.cc:18275
    0x10504ba gimplify_stmt(tree_node**, gimple**)
            ./gcc/gcc/gimplify.cc:7576
    0x104e3ab gimplify_statement_list
            ./gcc/gcc/gimplify.cc:2249
    Please submit a full bug report, with preprocessed source.
    Please include the complete backtrace with any bug report.
    See <https://gcc.gnu.org/bugs/> for instructions.


git bisect shows this starts happening with
6ffbf87ca66f4ed9cd79cff675fabe2109e46e85

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

* [Bug c++/114619] [13/14 regression] ICE with -fno-elide-constructors in C++14 mode for non-constant initializer in array new since r13-3175-g6ffbf87ca66f4e
  2024-04-06 14:46 [Bug c++/114619] New: [14 regression] ICE with -fno-elide-constructors in C++14 mode for non-constant initializer in array new mital at mitalashok dot co.uk
@ 2024-04-08  8:23 ` rguenth at gcc dot gnu.org
  2024-05-21  9:19 ` [Bug c++/114619] [13/14/15 " jakub at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-04-08  8:23 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-checking,
                   |                            |ice-on-valid-code
   Last reconfirmed|                            |2024-04-08
                 CC|                            |jason at gcc dot gnu.org
   Target Milestone|---                         |13.3
            Summary|[14 regression] ICE with    |[13/14 regression] ICE with
                   |-fno-elide-constructors in  |-fno-elide-constructors in
                   |C++14 mode for non-constant |C++14 mode for non-constant
                   |initializer in array new    |initializer in array new
                   |                            |since
                   |                            |r13-3175-g6ffbf87ca66f4e
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
           Priority|P3                          |P2

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
    case TARGET_EXPR: 
      /* A TARGET_EXPR that expresses direct-initialization should have been
         elided by cp_gimplify_init_expr.  */
      gcc_checking_assert (!TARGET_EXPR_DIRECT_INIT_P (*expr_p));
      /* Likewise, but allow extra temps of trivial type so that
         gimplify_init_ctor_preeval can materialize subobjects of a CONSTRUCTOR
         on the rhs of an assignment, as in constexpr-aggr1.C.  */
      gcc_checking_assert (!TARGET_EXPR_ELIDING_P (*expr_p)
                           || !TREE_ADDRESSABLE (TREE_TYPE (*expr_p)));

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

* [Bug c++/114619] [13/14/15 regression] ICE with -fno-elide-constructors in C++14 mode for non-constant initializer in array new since r13-3175-g6ffbf87ca66f4e
  2024-04-06 14:46 [Bug c++/114619] New: [14 regression] ICE with -fno-elide-constructors in C++14 mode for non-constant initializer in array new mital at mitalashok dot co.uk
  2024-04-08  8:23 ` [Bug c++/114619] [13/14 regression] ICE with -fno-elide-constructors in C++14 mode for non-constant initializer in array new since r13-3175-g6ffbf87ca66f4e rguenth at gcc dot gnu.org
@ 2024-05-21  9:19 ` jakub at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-05-21  9:19 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|13.3                        |13.4

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 13.3 is being released, retargeting bugs to GCC 13.4.

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

end of thread, other threads:[~2024-05-21  9:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-06 14:46 [Bug c++/114619] New: [14 regression] ICE with -fno-elide-constructors in C++14 mode for non-constant initializer in array new mital at mitalashok dot co.uk
2024-04-08  8:23 ` [Bug c++/114619] [13/14 regression] ICE with -fno-elide-constructors in C++14 mode for non-constant initializer in array new since r13-3175-g6ffbf87ca66f4e rguenth at gcc dot gnu.org
2024-05-21  9:19 ` [Bug c++/114619] [13/14/15 " jakub 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).