From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25278 invoked by alias); 2 Nov 2011 15:16:24 -0000 Received: (qmail 25269 invoked by uid 22791); 2 Nov 2011 15:16:23 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 02 Nov 2011 15:16:10 +0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/50960] [OOP] vtables not marked as constant Date: Wed, 02 Nov 2011 15:16: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-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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 X-SW-Source: 2011-11/txt/msg00159.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50960 --- Comment #7 from Richard Guenther 2011-11-02 15:16:08 UTC --- (In reply to comment #5) > (In reply to comment #1) > > - if (gfc_add_flavor (&vtab->attr, FL_VARIABLE, NULL, > > + if (gfc_add_flavor (&vtab->attr, FL_PARAMETER, NULL, > > (In reply to comment #3) > > it is not TREE_READONLY. > > I wonder whether there is a general missed-optimization issue for FL_PARAMETER > (for the case they are stored as actual data and not just as drop-in number). > One might need some special handling, but I also do not see "para" > ("__m_MOD_para:") marked as .rodata for > > module m > integer, parameter :: PARA(*) = [1,2,3,4,5,6,7,8,9,10] > end module m > > use m > print *, para > end Definitely a missed optimization. Optimizers will not be able to propagate constants from that initializer.