[gfortran,patch] Fix multiple evaluation of index with bounds checking

Andrew Pinski pinskia@gmail.com
Thu Jul 12 18:21:00 GMT 2007


On 7/12/07, FX Coudert <fxcoudert@gmail.com> wrote:
> The attached patch is a simple one-liner that avoids multiple
> evaluation of array index when performing bounds checking in some
> conditions (PR 32036). It does so by creating a SAVE_EXPR (an expr
> whose content is only evaluated once) [1]. Simple, and easy to
> review! (I also committed it as obvious, but since I've not been
> working too much on gfortran lately, I decided it's best to ask for
> review.)
>

I think you should use the function save_expr instead of manually
building the SAVE_EXPR.

Thanks,
Andrew Pinski



More information about the Gcc-patches mailing list