From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6F1623851A9B; Mon, 13 Jun 2022 13:11:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6F1623851A9B From: "wileamyp at outlook dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/102003] [PDT] Length of character component not simplified Date: Mon, 13 Jun 2022 13:11:03 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: unknown X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: wileamyp at outlook dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2022 13:11:03 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102003 Wileam Yonatan Phan changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wileamyp at outlook dot com --- Comment #1 from Wileam Yonatan Phan --- Behavior confirmed with master@ff91735a5b8. The error message seems to chan= ge if this code block is commented out in gcc/fortran/expr.cc --- diff --git a/gcc/fortran/expr.cc b/gcc/fortran/expr.cc index be94c18c836..e5a3df214d7 100644 --- a/gcc/fortran/expr.cc +++ b/gcc/fortran/expr.cc @@ -3201,12 +3201,14 @@ gfc_match_init_expr (gfc_expr **result) return m; } + #if 0 if (gfc_derived_parameter_expr (expr)) { *result =3D expr; gfc_init_expr_flag =3D false; return m; } + #endif t =3D gfc_reduce_init_expr (expr); if (!t) --- Anyway, the new error message is pr102003.f90:6:33: 6 | integer, parameter :: m =3D len (p% c) ! rejected | 1 Error: Parameter =E2=80=98p=E2=80=99 at (1) has not been declared or is a v= ariable, which does not reduce to a constant expression Maybe something doesn't work properly in gfc_reduce_init_expr()?=