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
+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>
* 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>
* gcc.target/aarch64/movi_hf.c: New.
--- /dev/null
+// PR c++/84704
+// { dg-do compile }
+// { dg-options "-g -fcompare-debug -O2" }
+
+int a[1] = { 0 };
+
+void
+foo ()
+{
+ a[({ 0; })] %= 5;
+}
switch (TREE_CODE_CLASS (code))
{
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_declaration:
case tcc_comparison: