From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5908 invoked by alias); 30 Nov 2003 13:43:10 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 5894 invoked from network); 30 Nov 2003 13:43:09 -0000 Received: from unknown (HELO pengo.systems.pipex.net) (62.241.160.193) by sources.redhat.com with SMTP; 30 Nov 2003 13:43:09 -0000 Received: from nowt.org (81-178-227-223.dsl.pipex.com [81.178.227.223]) by pengo.systems.pipex.net (Postfix) with ESMTP id 922054C00086; Sun, 30 Nov 2003 13:43:08 +0000 (GMT) Received: from eagle.home (eagle.home [192.168.1.3]) by nowt.org (Postfix) with ESMTP id 98C7EAC9A; Sun, 30 Nov 2003 13:43:07 +0000 (GMT) From: Paul Brook To: gcc-patches@gcc.gnu.org, fortran@gcc.gnu.org Subject: [gfortran] Fix inlining Date: Sun, 30 Nov 2003 14:56:00 -0000 User-Agent: KMail/1.5.4 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200311301343.07183.paul@nowt.org> X-SW-Source: 2003-11/txt/msg02352.txt.bz2 Patch below sets the tree inlining flags in the same way as the C frontend. I haven't checked if inlining actually works, but it doesn't seem to break anything. Tested on i686-linux. Applied to tree-ssa branch. Paul 2003-11-30 Paul Brook * f95-lang.c (gfc_post_options): Move ... * options.c (gfc_post_options): .. to here. Handle inlining options. * gfortran.h (gfc_post_options): Add prototype. diff -urpxCVS clean/tree-ssa/gcc/fortran/f95-lang.c new-gcc/gcc/fortran/ f95-lang.c --- clean/tree-ssa/gcc/fortran/f95-lang.c +++ new-gcc/gcc/fortran/f95-lang.c @@ -326,24 +326,6 @@ gfc_init (void) } -/* Finalize commandline options. */ - -static bool -gfc_post_options (const char **pfilename) -{ - const char *filename = *pfilename; - - /* Verify the input file name. */ - if (!filename || strcmp (filename, "-") == 0) - { - filename = ""; - } - - gfc_option.source = filename; - - return false; -} - static void gfc_finish (void) { diff -urpxCVS clean/tree-ssa/gcc/fortran/gfortran.h new-gcc/gcc/fortran/ gfortran.h --- clean/tree-ssa/gcc/fortran/gfortran.h +++ new-gcc/gcc/fortran/gfortran.h @@ -1333,6 +1333,7 @@ void gfc_done_2 (void); /* options.c */ unsigned int gfc_init_options (unsigned int, const char **); int gfc_handle_option (size_t, const char *, int); +bool gfc_post_options (const char **); /* iresolve.c */ char * gfc_get_string (const char *, ...) ATTRIBUTE_PRINTF_1; diff -urpxCVS clean/tree-ssa/gcc/fortran/options.c new-gcc/gcc/fortran/ options.c --- clean/tree-ssa/gcc/fortran/options.c +++ new-gcc/gcc/fortran/options.c @@ -30,6 +30,7 @@ Boston, MA 02111-1307, USA. */ #include "intl.h" #include "opts.h" #include "options.h" +#include "tree-inline.h" #include "gfortran.h" @@ -76,6 +77,40 @@ gfc_init_options (unsigned int argc ATTR } +/* Finalize commandline options. */ + +bool +gfc_post_options (const char **pfilename) +{ + const char *filename = *pfilename; + + /* Verify the input file name. */ + if (!filename || strcmp (filename, "-") == 0) + { + filename = ""; + } + + gfc_option.source = filename; + + flag_inline_trees = 1; + + /* Use tree inlining if possible. Function instrumentation is only + done in the RTL level, so we disable tree inlining. */ + if (! flag_instrument_function_entry_exit) + { + if (!flag_no_inline) + flag_no_inline = 1; + if (flag_inline_functions) + { + flag_inline_trees = 2; + flag_inline_functions = 0; + } + } + + return false; +} + + /* Set the options for -Wall. */ static void