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 for estimate_probability instability


Jan Hubicka <jh@suse.cz> writes:

> Hi,
> I've installed attached patch to cfg-brach to avoid estimate-branches
> instability and bootstrap misscomparisons.
> 
> I am not quite sure if such a sollution can be acceptable for Mainline.

I think this is just papering over some other problem.  Floating-point
is not a random number generator, so given the same input it should
produce the same output.  What is being compiled differently to cause
the comparison failure?

> 
> Thu Nov 15 16:52:54 CET 2001  Jan Hubicka  <jh@suse.cz>
> 
> 	* predict.c (propagate_freq): Make cyclic_probability and frequency
> 	volatile
> 
> Index: predict.c
> ===================================================================
> RCS file: /cvs/gcc/egcs/gcc/predict.c,v
> retrieving revision 1.44.2.1
> diff -c -3 -p -r1.44.2.1 predict.c
> *** predict.c	2001/11/13 11:31:11	1.44.2.1
> --- predict.c	2001/11/15 15:44:48
> *************** propagate_freq (head)
> *** 663,669 ****
>     BLOCK_INFO (head)->frequency = 1;
>     for (; bb; bb = nextbb)
>       {
> !       double cyclic_probability = 0, frequency = 0;
>   
>         nextbb = BLOCK_INFO (bb)->next;
>         BLOCK_INFO (bb)->next = NULL;
> --- 663,669 ----
>     BLOCK_INFO (head)->frequency = 1;
>     for (; bb; bb = nextbb)
>       {
> !       volatile double cyclic_probability = 0, frequency = 0;
>   
>         nextbb = BLOCK_INFO (bb)->next;
>         BLOCK_INFO (bb)->next = NULL;

-- 
- Geoffrey Keating <geoffk@geoffk.org> <geoffk@redhat.com>


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