From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 80619 invoked by alias); 27 Oct 2015 13:44:58 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 80583 invoked by uid 55); 27 Oct 2015 13:44:54 -0000 From: "sgk at troutmask dot apl.washington.edu" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/68108] [6 regression] erroneous error message 'scalar integer expression expected' Date: Tue, 27 Oct 2015 13:44:00 -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: 6.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: sgk at troutmask dot apl.washington.edu X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: kargl at gcc dot gnu.org X-Bugzilla-Target-Milestone: 6.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-10/txt/msg02238.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68108 --- Comment #4 from Steve Kargl --- On Tue, Oct 27, 2015 at 10:54:53AM +0000, mikael at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68108 > > --- Comment #3 from Mikael Morin --- > (In reply to kargl from comment #1) > > Tentative patch > > > > Index: decl.c > > =================================================================== > > --- decl.c (revision 229390) > > +++ decl.c (working copy) > > @@ -754,7 +754,8 @@ char_len_param_value (gfc_expr **expr, b > > > > gfc_reduce_init_expr (e); > > > > - if ((e->ref && e->ref->u.ar.type != AR_ELEMENT) > > + if ((e->ref && e->ref->type == REF_ARRAY > > + && e->ref->u.ar.type != AR_ELEMENT) > > || (!e->ref && e->expr_type == EXPR_ARRAY)) > > There is another unguarded ref->u.ar access a few lines above. > It doesn't trigger as often, because it's a == condition, but it's still worth > fixing. > Otherwise looks good. > Thanks for pointing out the other condition. I'll commit the fix later today.