This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[tuples] Robustify cleanup_omp_return


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]