This is the mail archive of the gcc@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: [tree-ssa] mainline merge as of 2004-04-10


> 
> Two new regressions.
> 
> New regressions in 00testsuite-linux-gnu/20040413/gcc.sum.gz:
>          FAIL: gcc.c-torture/execute/bcp-1.c execution
>          FAIL: gcc.dg/torture/builtin-ctype-1.c (test for excess errors)
> 
> 
> One is the usual builtin stuff not handled at the tree level.  This one
> I'm leaving alone because the whole thing needs to be rethought (post
> merge).
> 
> The bcp-1.c failure is interesting.  We fail it at -Os because of
> 
>        * opts.c (decode_options): Do function inlining with very small
>        max-inline-insns-* parameters when optimizing for size.
> 
> We now refuse to inline at -Os when we predict more than 5
> instructions.  In this case, we are predicting 12.  The function is 'foo
> (x) { return __builtin_constant_p (x); }'  which, inlined, is 'return
> 1;'.  I'm not sure if we need to tweak the predictor or
> max-inline-insns-* for -Os.  Jan?
Hi,
I've tested on ia64-linux the attached patch and commited it as obvious.
It merges the changes from c-common.c version of estimate_num_insns to
tree-inline one.
It fixes the bcp-1.c failure and ought to result in better code.

2004-04-18  Jan Hubicka  <jh@suse.cz>
	* tree-inline.c (estimate_num_insn_1): Deal properly with
	builtin_constant_p and builtin_expect.
Index: tree-inline.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-inline.c,v
retrieving revision 1.26.2.90
diff -c -3 -p -r1.26.2.90 tree-inline.c
*** tree-inline.c	15 Apr 2004 19:55:18 -0000	1.26.2.90
--- tree-inline.c	17 Apr 2004 21:05:34 -0000
*************** estimate_num_insns_1 (tree *tp, int *wal
*** 1354,1362 ****
      case FLOOR_MOD_EXPR:
      case ROUND_MOD_EXPR:
      case RDIV_EXPR:
-     case CALL_EXPR:
        *count += 10;
        break;
      default:
        /* Abort here se we know we don't miss any nodes.  */
        abort ();
--- 1354,1379 ----
      case FLOOR_MOD_EXPR:
      case ROUND_MOD_EXPR:
      case RDIV_EXPR:
        *count += 10;
        break;
+     case CALL_EXPR:
+       {
+ 	tree decl = get_callee_fndecl (x);
+ 
+ 	if (decl && DECL_BUILT_IN (decl))
+ 	  switch (DECL_FUNCTION_CODE (decl))
+ 	    {
+ 	    case BUILT_IN_CONSTANT_P:
+ 	      *walk_subtrees = 0;
+ 	      return NULL_TREE;
+ 	    case BUILT_IN_EXPECT:
+ 	      return NULL_TREE;
+ 	    default:
+ 	      break;
+ 	    }
+ 	*count += 10;
+ 	break;
+       }
      default:
        /* Abort here se we know we don't miss any nodes.  */
        abort ();


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