This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[tuples] Robustify cleanup_omp_return
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Aldy Hernandez <aldyh at redhat dot com>, Diego Novillo <dnovillo at google dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 30 May 2008 10:26:30 -0400
- Subject: [tuples] Robustify cleanup_omp_return
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
This function is called during cfg cleanup, so bb might be preceeded
by an empty useless block. Given the cfg creation for
GIMPLE_OMP_SECTIONS_SWITCH, I'm convinced the final sections
GIMPLE_OMP_RETURN will be always preceeded by GIMPLE_OMP_SECTIONS_SWITCH,
so there is no need to search through empty bbs to find
GIMPLE_OMP_SECTIONS_SWITCH.
2008-05-30 Jakub Jelinek <jakub@redhat.com>
* tree-cfgcleanup.c (cleanup_omp_return): Robustify.
--- gcc/tree-cfgcleanup.c.jj 2008-05-27 14:34:52.000000000 +0200
+++ gcc/tree-cfgcleanup.c 2008-05-30 16:11:43.000000000 +0200
@@ -512,7 +512,7 @@ cleanup_omp_return (basic_block bb)
control_bb = single_pred (bb);
stmt = last_stmt (control_bb);
- if (gimple_code (stmt) != GIMPLE_OMP_SECTIONS_SWITCH)
+ if (stmt == NULL || gimple_code (stmt) != GIMPLE_OMP_SECTIONS_SWITCH)
return false;
/* The block with the control statement normally has two entry edges -- one
Jakub