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]

Another patch for bad warnings for inlined functions


There is a new test case in PR 19583 which produces another
undesirable warning about an inlined function not returning a value.

This patch fixes it.  I think this patch is correct based on the
semantics of TRY_FINALLY_EXPR: if the try clause does not fall
through, then even if the finally clause falls through, the whole
expression is not going to fall through--it is going to resume
execution at the point whereever the try clause went to.

This does not introduce any new testsuite failures on
i686-pc-linux-gnu.  OK to commit if it passes a bootstrap?

Ian


2005-01-27  Ian Lance Taylor  <ian@airs.com>

	* gimple-low.c (block_may_fallthru): TRY_FINALLY_EXPR only falls
	through if both operands fall through.


Index: gimple-low.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gimple-low.c,v
retrieving revision 2.20
diff -p -u -r2.20 gimple-low.c
--- gimple-low.c	27 Jan 2005 14:36:17 -0000	2.20
+++ gimple-low.c	28 Jan 2005 02:55:08 -0000
@@ -348,7 +348,8 @@ block_may_fallthru (tree block)
       return try_catch_may_fallthru (stmt);
 
     case TRY_FINALLY_EXPR:
-      return block_may_fallthru (TREE_OPERAND (stmt, 1));
+      return (block_may_fallthru (TREE_OPERAND (stmt, 0))
+	      && block_may_fallthru (TREE_OPERAND (stmt, 1)));
 
     case MODIFY_EXPR:
       if (TREE_CODE (TREE_OPERAND (stmt, 1)) == CALL_EXPR)


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