[PATCH, middle-end]: Fix PR 37286, ICE subst_stack_regs_pat, at reg-stack.c:1537

Richard Guenther richard.guenther@gmail.com
Wed Nov 5 09:24:00 GMT 2008


On Mon, Nov 3, 2008 at 4:08 PM, Uros Bizjak <ubizjak@gmail.com> wrote:
> Hello!
>
> This is another example of uninitialized variable confusing regstack.
> Instead of ICEing on uninitialized stack slot, initialize variable
> with a NaN. This way, we will generate FP exception if program flow
> reaches the instruction (if exceptions are enabled), but we will be
> able to compile the source.
>
> BTW: Compiling original fortran testcase from the PR with -Wall, we indeed get:
>
> pr37286.f90: In function 'gn_monte_rand':
> pr37286.f90:31: warning: 'monte_temp' may be used uninitialized in this function
>
> 2008-11-03  Uros Bizjak  <ubizjak@gmail.com>
>
>        PR middle-end/37286
>        * reg-stack.c (subst_stack_regs_pat) [MINUS, DIV, MULT, PLUS]:
>        Initialize uninitialized input registers with a NaN.
>
> testsuite/ChangeLog:
>
> 2008-11-03  Uros Bizjak  <ubizjak@gmail.com>
>
>        PR middle-end/37286
>        * gfortran.dg/pr37286.f90: New test.
>
> The patch was bootstrapped and regression tested on i686-pc-linux-gnu.
> OK for mainline?

Ok.

Thanks,
Richard.

> Uros.
>



More information about the Gcc-patches mailing list