This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: patch for estimate_probability instability
- From: Geoff Keating <geoffk at geoffk dot org>
- To: Jan Hubicka <jh at suse dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: 15 Nov 2001 11:51:29 -0800
- Subject: Re: patch for estimate_probability instability
- References: <20011115180043.J22366@atrey.karlin.mff.cuni.cz>
- Reply-to: Geoff Keating <geoffk at redhat dot com>
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>