]> gcc.gnu.org Git - gcc.git/commit
d: Fix ICE in verify_gimple_stmt, at tree-cfg.c:4959
authorIain Buclaw <ibuclaw@gdcproject.org>
Sun, 17 May 2020 14:28:24 +0000 (16:28 +0200)
committerIain Buclaw <ibuclaw@gdcproject.org>
Sun, 17 May 2020 14:28:24 +0000 (16:28 +0200)
commit80cefde6212c3de603dda46d05123a750b378ff2
treec1a6dbbb16537d82b7e274f12b6e6069e2684928
parentcdbe37dee2225d96aadfd0d756ec3c9463d8c9b1
d: Fix ICE in verify_gimple_stmt, at tree-cfg.c:4959

Both array concat and array new expressions wrapped any temporaries
created into a BIND_EXPR.  This does not work if an expression used to
construct the result requires scope destruction, which is represented by
a TARGET_EXPR with a clean-up, and a CLEANUP_POINT_EXPR at the
location where the temporaries logically go out of scope.  The reason
for this not working is because the lowering of cleanup point
expressions does not traverse inside BIND_EXPRs to expand any gimple
cleanup expressions within.

The use of creating BIND_EXPR has been removed at both locations, and
replaced with a normal temporary variable that has initialization
delayed until its address is taken.

gcc/d/ChangeLog:

PR d/94970
* d-codegen.cc (force_target_expr): Move create_temporary_var
implementation inline here.
(create_temporary_var): Remove.
(maybe_temporary_var): Remove.
(bind_expr): Remove.
* d-convert.cc (d_array_convert): Use build_local_temp to generate
temporaries, and generate its assignment.
* d-tree.h (create_temporary_var): Remove.
(maybe_temporary_var): Remove.
(d_array_convert): Remove vars argument.
* expr.cc (ExprVisitor::visit (CatExp *)): Use build_local_temp to
generate temporaries, don't wrap them in a BIND_EXPR.
(ExprVisitor::visit (NewExp *)): Likewise.

gcc/testsuite/ChangeLog:

PR d/94970
* gdc.dg/pr94970.d: New test.
gcc/d/ChangeLog
gcc/d/d-codegen.cc
gcc/d/d-convert.cc
gcc/d/d-tree.h
gcc/d/expr.cc
gcc/testsuite/ChangeLog
gcc/testsuite/gdc.dg/pr94970.d [new file with mode: 0644]
This page took 0.062262 seconds and 6 git commands to generate.