diff mbox

[Fortran,Regression] PR 55907: ICE with -fno-automatic -finit-local-zero

Message ID CAKwh3qhh-GDLOksbu5m3zvB+YK2Hroi8CKc=3T+4gPaEqz4DWg@mail.gmail.com
State New
Headers show

Commit Message

Janus Weil Feb. 16, 2014, 10:11 p.m. UTC
Hi all,

here is a small patch for a ICE-on-valid regression. Regtested on
x86_64-unknown-linux-gnu. Ok for trunk/4.8/4.7?

Cheers,
Janus


2014-02-16  Janus Weil  <janus@gcc.gnu.org>

    PR fortran/55907
    * resolve.c (build_default_init_expr): Don't initialize character
    variable if -fno-automatic is given.


2014-02-16  Janus Weil  <janus@gcc.gnu.org>

    PR fortran/55907
    * gfortran.dg/init_flag_12.f90: New.

Comments

Paul Richard Thomas Feb. 17, 2014, 11:20 a.m. UTC | #1
Dear Janus,

This is OK for trunk, 4.8 and 4.7.

Thanks for the patch.

Paul

On 16 February 2014 23:11, Janus Weil <janus@gcc.gnu.org> wrote:
> Hi all,
>
> here is a small patch for a ICE-on-valid regression. Regtested on
> x86_64-unknown-linux-gnu. Ok for trunk/4.8/4.7?
>
> Cheers,
> Janus
>
>
> 2014-02-16  Janus Weil  <janus@gcc.gnu.org>
>
>     PR fortran/55907
>     * resolve.c (build_default_init_expr): Don't initialize character
>     variable if -fno-automatic is given.
>
>
> 2014-02-16  Janus Weil  <janus@gcc.gnu.org>
>
>     PR fortran/55907
>     * gfortran.dg/init_flag_12.f90: New.
Janus Weil Feb. 17, 2014, 12:48 p.m. UTC | #2
> This is OK for trunk, 4.8 and 4.7.

Thanks, Paul. Committed to trunk as r207823. Will do the backports soon.

Cheers,
Janus



> On 16 February 2014 23:11, Janus Weil <janus@gcc.gnu.org> wrote:
>> Hi all,
>>
>> here is a small patch for a ICE-on-valid regression. Regtested on
>> x86_64-unknown-linux-gnu. Ok for trunk/4.8/4.7?
>>
>> Cheers,
>> Janus
>>
>>
>> 2014-02-16  Janus Weil  <janus@gcc.gnu.org>
>>
>>     PR fortran/55907
>>     * resolve.c (build_default_init_expr): Don't initialize character
>>     variable if -fno-automatic is given.
>>
>>
>> 2014-02-16  Janus Weil  <janus@gcc.gnu.org>
>>
>>     PR fortran/55907
>>     * gfortran.dg/init_flag_12.f90: New.
>
>
>
> --
> The knack of flying is learning how to throw yourself at the ground and miss.
>        --Hitchhikers Guide to the Galaxy
diff mbox

Patch

Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c	(revision 207804)
+++ gcc/fortran/resolve.c	(working copy)
@@ -10530,7 +10530,7 @@  build_default_init_expr (gfc_symbol *sym)
 	  init_expr = NULL;
 	}
       if (!init_expr && gfc_option.flag_init_character == GFC_INIT_CHARACTER_ON
-	  && sym->ts.u.cl->length)
+	  && sym->ts.u.cl->length && gfc_option.flag_max_stack_var_size != 0)
 	{
 	  gfc_actual_arglist *arg;
 	  init_expr = gfc_get_expr ();