PR rtl-optimization/20017.
* passes.c (rest_of_handle_combine, rest_of_handle_cse,
rest_of_handle_cse2, rest_of_handle_gcse): Call
delete_dead_jumptables immediately before calling cleanup_cfg.
testsuite/
PR rtl-optimization/20017.
* gcc.dg/pr20017.c: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@95431
138bc75d-0d04-0410-961f-
82ee72b054a4
+2005-02-22 Kazu Hirata <kazu@cs.umass.edu>
+
+ PR rtl-optimization/20017.
+ * passes.c (rest_of_handle_combine, rest_of_handle_cse,
+ rest_of_handle_cse2, rest_of_handle_gcse): Call
+ delete_dead_jumptables immediately before calling cleanup_cfg.
+
2005-02-22 Devang Patel <dpatel@apple.com>
PR 19952
rebuild_jump_labels (get_insns ());
timevar_pop (TV_JUMP);
+ delete_dead_jumptables ();
cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_UPDATE_LIFE);
}
expecting CSE to be run. But always rerun it in a cheap mode. */
cse_not_expected = !flag_rerun_cse_after_loop && !flag_gcse;
+ if (tem)
+ delete_dead_jumptables ();
+
if (tem || optimize > 1)
cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP);
{
timevar_push (TV_JUMP);
rebuild_jump_labels (get_insns ());
+ delete_dead_jumptables ();
cleanup_cfg (CLEANUP_EXPENSIVE);
timevar_pop (TV_JUMP);
}
{
timevar_push (TV_JUMP);
rebuild_jump_labels (get_insns ());
+ delete_dead_jumptables ();
cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP);
timevar_pop (TV_JUMP);
}
+2005-02-22 Kazu Hirata <kazu@cs.umass.edu>
+
+ PR rtl-optimization/20017.
+ * gcc.dg/pr20017.c: New.
+
2005-02-22 Devang Patel <dpatel@apple.com>
PR 19952
--- /dev/null
+/* PR rtl-optimization/20017
+
+ After CSE/GCSE folds a switch statement to an unconditonal jump,
+ cfg_cleanup did not remove a dead jump table, confusing the CFG
+ layout code later on. */
+
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+/* { dg-options "-O1 -march=i386" { target { i?86-*-* && ilp32 } } } */
+
+int
+foo (int *buf, int *p)
+{
+ int result;
+ const int *tmp;
+
+ if (*buf)
+ return 1;
+
+ result = 2;
+ *buf = 2;
+ tmp = buf;
+ switch (*tmp)
+ {
+ case 3:
+ case 4:
+ case 6:
+ case 14:
+ return 1;
+
+ case 0:
+ result = *p;
+
+ /* Fall through. */
+ default:
+ if (result)
+ return 1;
+ }
+
+ return 0;
+}