Commit 038df1ba by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/84704 (internal compiler error: gimplification failed)

	PR c++/84704
	* tree.c (stabilize_reference_1): Return save_expr (e) for
	STATEMENT_LIST even if it doesn't have side-effects.

	* g++.dg/debug/pr84704.C: New test.

From-SVN: r258470
parent 97ca95ac
2018-03-13 Jakub Jelinek <jakub@redhat.com>
PR c++/84704
* tree.c (stabilize_reference_1): Return save_expr (e) for
STATEMENT_LIST even if it doesn't have side-effects.
2018-03-12 Jonathan Wakely <jwakely@redhat.com> 2018-03-12 Jonathan Wakely <jwakely@redhat.com>
* doc/invoke.texi (-mclflushopt): Fix spelling of option. * doc/invoke.texi (-mclflushopt): Fix spelling of option.
......
2018-03-13 Jakub Jelinek <jakub@redhat.com>
PR c++/84704
* g++.dg/debug/pr84704.C: New test.
2018-03-12 Renlin Li <renlin.li@arm.com> 2018-03-12 Renlin Li <renlin.li@arm.com>
* gcc.target/aarch64/movi_hf.c: New. * gcc.target/aarch64/movi_hf.c: New.
......
// PR c++/84704
// { dg-do compile }
// { dg-options "-g -fcompare-debug -O2" }
int a[1] = { 0 };
void
foo ()
{
a[({ 0; })] %= 5;
}
...@@ -4352,6 +4352,11 @@ stabilize_reference_1 (tree e) ...@@ -4352,6 +4352,11 @@ stabilize_reference_1 (tree e)
switch (TREE_CODE_CLASS (code)) switch (TREE_CODE_CLASS (code))
{ {
case tcc_exceptional: case tcc_exceptional:
/* Always wrap STATEMENT_LIST into SAVE_EXPR, even if it doesn't
have side-effects. */
if (code == STATEMENT_LIST)
return save_expr (e);
/* FALLTHRU */
case tcc_type: case tcc_type:
case tcc_declaration: case tcc_declaration:
case tcc_comparison: case tcc_comparison:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment