From: Thomas Koenig Date: Mon, 7 Oct 2019 20:10:22 +0000 (+0000) Subject: backport: re PR fortran/84487 (Large rodate section increase in 465.tonto with r254427) X-Git-Tag: releases/gcc-9.3.0~568 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c5b2ab5b80ccfc4995609f7bbd8da15525cae0d5;p=thirdparty%2Fgcc.git backport: re PR fortran/84487 (Large rodate section increase in 465.tonto with r254427) 2019-10-07 Thomas Koenig Backport from trunk PR fortran/84487 * trans-decl.c (gfc_get_symbol_decl): For __def_init, set DECL_ARTIFICAL and do not set TREE_READONLY. 2019-10-07 Thomas Koenig Backport from trunk PR fortran/84487 * gfortran.dg/typebound_call_22.f03: xfail. From-SVN: r276672 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 4c9a1122285c..12c7221335af 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2019-10-07 Thomas Koenig + + Backport from trunk + PR fortran/84487 + * trans-decl.c (gfc_get_symbol_decl): For __def_init, set + DECL_ARTIFICAL and do not set TREE_READONLY. + 2019-10-05 Steven G. Kargl PR fortran/47054 @@ -22,7 +29,7 @@ PR fortran/91864 * gcc/fortran/io.c (match_io_element): An inquiry parameter cannot be read into. - * gcc/fortran/match.c (gfc_match_allocate): An inquiry parameter + * gcc/fortran/match.c (gfc_match_allocate): An inquiry parameter can be neither an allocate-object nor stat variable. (gfc_match_deallocate): An inquiry parameter cannot be deallocated. diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index f5149eed981b..eb92259f8801 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -1892,9 +1892,13 @@ gfc_get_symbol_decl (gfc_symbol * sym) if (sym->attr.associate_var) GFC_DECL_ASSOCIATE_VAR_P (decl) = 1; + /* We no longer mark __def_init as read-only so it does not take up + space in the read-only section and dan go into the BSS instead, + see PR 84487. Marking this as artificial means that OpenMP will + treat this as predetermined shared. */ if (sym->attr.vtab || (sym->name[0] == '_' && gfc_str_startswith (sym->name, "__def_init"))) - TREE_READONLY (decl) = 1; + DECL_ARTIFICIAL (decl) = 1; return decl; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 43d8244a996c..a308c86d5d6e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2019-10-07 Thomas Koenig + + Backport from trunk + PR fortran/84487 + * gfortran.dg/typebound_call_22.f03: xfail. + 2019-10-07 Bill Schmidt Backport from mainline @@ -25,7 +31,7 @@ 2019-10-04 Dragan Mladjenovic - Backport from mainline + Backport from mainline 2019-10-03 Dragan Mladjenovic PR target/91769 diff --git a/gcc/testsuite/gfortran.dg/typebound_call_22.f03 b/gcc/testsuite/gfortran.dg/typebound_call_22.f03 index b9f0b7125732..30f86937fe2f 100644 --- a/gcc/testsuite/gfortran.dg/typebound_call_22.f03 +++ b/gcc/testsuite/gfortran.dg/typebound_call_22.f03 @@ -26,4 +26,4 @@ program test call x%bar () end program -! { dg-final { scan-tree-dump-times "base \\(\\);" 1 "optimized" } } +! { dg-final { scan-tree-dump-times "base \\(\\);" 1 "optimized" { xfail *-*-* } } }