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]

Re: [trunk][patch] fix a bug in fold_call_expr and one in record_temporary_equivalences_from_stmts_at_dest


On 4/30/08 9:54 AM, Rafael Espindola wrote:

--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -10553,6 +10553,7 @@ fold_call_expr (tree exp, bool ignore)
 		  if (CAN_HAVE_LOCATION_P (realret)
 		      && !EXPR_HAS_LOCATION (realret))
 		    SET_EXPR_LOCATION (realret, EXPR_LOCATION (exp));
+		  return realret;
 		}
 	      return ret;
 	    }

OK.


diff --git a/gcc/tree-ssa-threadedge.c b/gcc/tree-ssa-threadedge.c
index d0d8fb2..71aa91b 100644
--- a/gcc/tree-ssa-threadedge.c
+++ b/gcc/tree-ssa-threadedge.c
@@ -226,6 +226,7 @@ record_temporary_equivalences_from_stmts_at_dest (edge e,
for (bsi = bsi_start (e->dest); ! bsi_end_p (bsi); bsi_next (&bsi))
{
tree cached_lhs = NULL;
+ tree rhs;
stmt = bsi_stmt (bsi);
@@ -252,6 +253,18 @@ record_temporary_equivalences_from_stmts_at_dest (edge e,
|| TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) != SSA_NAME)
continue;
+ rhs = GIMPLE_STMT_OPERAND (stmt, 1);
+
+ /* The result of __builtin_object_size depends on all the arguments
+ of a phi node. Temporally using only one edge produces invalid
+ results. */

s/Temporally/temporarily/ ?


OK, but this needs a code snippet example. It's not immediately obvious what the problem is here.


+      if (TREE_CODE (rhs) == CALL_EXPR)
+	{
+	  tree fndecl = get_callee_fndecl (rhs);
+	  if (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_OBJECT_SIZE)
+	    continue;

fndecl can be NULL here.



Diego.



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