PR rtl-optimization/92610
* cse.c (rest_of_handle_cse2): Call cleanup_cfg (0) also if
cse_cfg_altered is set, even when tem is 0.
(rest_of_handle_cse_after_global_opts): Likewise.
* g++.dg/opt/pr92610.C: New test.
From-SVN: r278640
+2019-11-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/92610
+ * cse.c (rest_of_handle_cse2): Call cleanup_cfg (0) also if
+ cse_cfg_altered is set, even when tem is 0.
+ (rest_of_handle_cse_after_global_opts): Likewise.
+
2019-11-22 Jakub Jelinek <jakub@redhat.com>
PR c++/92458
cse_cfg_altered |= cleanup_cfg (CLEANUP_CFG_CHANGED);
timevar_pop (TV_JUMP);
}
- else if (tem == 1)
+ else if (tem == 1 || cse_cfg_altered)
cse_cfg_altered |= cleanup_cfg (0);
cse_not_expected = 1;
cse_cfg_altered |= cleanup_cfg (CLEANUP_CFG_CHANGED);
timevar_pop (TV_JUMP);
}
- else if (tem == 1)
+ else if (tem == 1 || cse_cfg_altered)
cse_cfg_altered |= cleanup_cfg (0);
flag_cse_follow_jumps = save_cfj;
+2019-11-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/92610
+ * g++.dg/opt/pr92610.C: New test.
+
2019-11-23 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR c++/92365
--- /dev/null
+// PR rtl-optimization/92610
+// { dg-do compile }
+// { dg-options "-w -fdelete-dead-exceptions --param=sccvn-max-alias-queries-per-access=0 -fno-dse -fnon-call-exceptions -Os -funroll-loops -ftrapv" }
+
+struct C { int x; ~C () {} };
+
+int
+main ()
+{
+ C *buffer = new C[42];
+ buffer[-3].x = 42;
+ delete [] buffer;
+}