From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) by sourceware.org (Postfix) with ESMTPS id 898003840C0C for ; Tue, 28 Jul 2020 15:58:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 898003840C0C Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.16.1/8.16.1) with ESMTPS id 06SFwGuF076949 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO) for ; Tue, 28 Jul 2020 08:58:16 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.16.1/8.16.1/Submit) id 06SFwG02076948 for fortran@gcc.gnu.org; Tue, 28 Jul 2020 08:58:16 -0700 (PDT) (envelope-from sgk) Date: Tue, 28 Jul 2020 08:58:16 -0700 From: Steve Kargl To: fortran@gcc.gnu.org Subject: PR96325 should be high priority Message-ID: <20200728155816.GA76888@troutmask.apl.washington.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, KAM_SHORT, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: fortran@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Fortran mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2020 15:58:19 -0000 This bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96325 should be a high priority for anyone trying to improve gfortran. Not only does gfortran accept an invalid Fortran program, the wrong code is simply bad. Simplified testcase: program bar implicit none type t2 integer r1 end type type(t2) :: t integer :: a a = t%r1%foo(1) ! There is no foo component/TBP. if (a == 42) stop end -fdump-tree-original gives MAIN__ () { integer(kind=4) a; struct t2 t; a = 1; if (a == 42) { _gfortran_stop_string (0B, 0, 0); } L.1:; } and -fdump-parse-tree shows Namespace: A-Z: (UNKNOWN 0) procedure name = bar symtree: 'T2' || symbol: 't2' type spec : (UNKNOWN 0) attributes: (DERIVED ) components: (r1 (INTEGER 4) ()) hash: 48537418 Procedure bindings: Operator bindings: symtree: 'a' || symbol: 'a' type spec : (INTEGER 4) attributes: (VARIABLE ) symtree: 'bar' || symbol: 'bar' type spec : (UNKNOWN 0) attributes: (PROGRAM PUBLIC SUBROUTINE) symtree: 't' || symbol: 't' type spec : (DERIVED t2) attributes: (VARIABLE ) symtree: 't2' || symbol: 't2' type spec : (UNKNOWN 0) attributes: (PROCEDURE FUNCTION) Generic interfaces: t2 code: ASSIGN bar:a 1 IF (= bar:a 42) STOP -1 ENDIF I've run out of ideas on how to track this done. Something in gfc_match_rvalue() goes sideways. -- Steve