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: [PATCH] Speed up gimple_tree_eq with release checking


On Wed, Dec 08, 2010 at 03:14:13PM +0100, Richard Guenther wrote:
> 
> The gimplifier is still one part of the compiler that is comparatively
> slow.  Looking at profiles lookup_tmp_var and friends stick out, the
> following makes expensive rehashing for assertion purposes conditional
> on checking.
> 
> Applied as obvious.

It should have been gcc_checking_assert instead...

> 2010-12-08  Richard Guenther  <rguenther@suse.de>
> 
> 	* gimplify.c (gimple_tree_eq): Assert hashes are equal only
> 	when checking is enabled.
> 
> Index: gcc/gimplify.c
> ===================================================================
> *** gcc/gimplify.c	(revision 167583)
> --- gcc/gimplify.c	(working copy)
> *************** gimple_tree_eq (const void *p1, const vo
> *** 145,153 ****
> --- 145,155 ----
>     if (!operand_equal_p (t1, t2, 0))
>       return 0;
>   
> + #ifdef ENABLE_CHECKING
>     /* Only allow them to compare equal if they also hash equal; otherwise
>        results are nondeterminate, and we fail bootstrap comparison.  */
>     gcc_assert (gimple_tree_hash (p1) == gimple_tree_hash (p2));
> + #endif
>   
>     return 1;
>   }

	Jakub


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