This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Fix PR 37782, Stage2 ada compiler miscompiled
- From: "Richard Guenther" <richard dot guenther at gmail dot com>
- To: "Andrew Pinski" <Andrew_Pinski at playstation dot sony dot com>
- Cc: "GCC Patches" <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 31 Oct 2008 11:42:37 +0100
- Subject: Re: [PATCH] Fix PR 37782, Stage2 ada compiler miscompiled
- References: <email@example.com>
On Fri, Oct 31, 2008 at 2:48 AM, Andrew Pinski
> The problem here is that in some cases doloop_modify will do the
> addition in the wrong mode, causing to get the wrong answer; this only
> happens if zero_extend_p is true which was added by me to that removes
> an addition in some cases. This fixes the problem by adding an
> argument to doloop_modify which says the original mode of count and
> does the addition in that mode.
> OK? Bootstrapped and tested on powerpc64-linux-gnu with no
> regressions (but no Ada). Also tested by Andreas Schwab on
> powerpc64-linux-gnu with no regressions for Ada.
Hum, why use the mode of the counter register inside the comparison and
not simply the mode of count which you increment? Thus
count = simplify_gen_binary (PLUS, GET_MODE (count), count, const1_rtx);
IMHO that more obviously matches and removes the need for the extra parameter?
> Andrew Pinski
> * loop-doloop.c (doloop_modify): Add from_mode argument that says what
> mode count is in.
> (doloop_optimize): Update call to doloop_modify.