This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR14495 (1/2)
- From: "Rafael Espindola" <espindola at google dot com>
- To: "Richard Guenther" <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org, "Diego Novillo" <dnovillo at google dot com>
- Date: Mon, 14 Apr 2008 01:14:29 +0100
- Subject: Re: [PATCH] Fix PR14495 (1/2)
- References: <Pine.LNX.4.64.0803281544180.4133@zhemvz.fhfr.qr>
> It also introduces the find_case_label_index helper which will be
> needed in (2/2).
I am trying to port this to tuples and I find it a bit hard to understand.
You test for the fact that the returned idx is < start_idx. Since all
assignments to idx are "*idx = i", this is only possible if "i <
start_idx". "i" is assigned "start_idx" initially and "(high + low)/2"
in the loop. Since "low >= start_idx - 1", "(high + low)/2 <
start_idx" is only possible if "high = start_idx and low = start_idx -
1". This cannot happen since the loop condition is "high -low > 1".
Just to make sure I am not getting the math wrong, I added "gcc_assert
(i >= start_idx)" in all returns. The code is bootstrapping at stage3
now :-)
Cheers,
--
Rafael Avila de Espindola
Google Ireland Ltd.
Gordon House
Barrow Street
Dublin 4
Ireland
Registered in Dublin, Ireland
Registration Number: 368047