This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] PR31546 - add --enable-intermodule

On Thu, Aug 23, 2007 at 08:05:13AM +0200, Paolo Bonzini wrote:
> Bernhard Fischer wrote:
>> Hi,
>> add option to build libgfortran and fortran with -combine.
>> This creates a smaller binary and may also create a faster binary. The
>> former is the main motivation from my POV.
>> This is completely optional and is not enabled if you do not configure
>> gcc with '--enable-intermodule'.
> The libgfortran part is ok.  For the front-end part I would like to see 
> code size figures too; since the other front-ends do not support it, I 
> would prefer to do it for all-or-none (except Ada of course).

Meanwhile i have switched libgcc too.
The FE parts are a bit irritating -- from my perspective -- How would i
e.g. the fortran FE itself to use --combine?

Specifically (copy'n paste ATM) i'd need(?) to alter the t_files(sp?)
since this doesn't use combine:

Any hints?

PS: Please let me know if hinting off a current, real patch is easier
for you.

Index: gcc/fortran/
--- gcc/fortran/    (revision 129131)
+++ gcc/fortran/    (working copy)
@@ -67,6 +67,8 @@
     fortran/trans-intrinsic.o fortran/trans-io.o fortran/trans-openmp.o
     fortran/trans-stmt.o fortran/trans-types.o
+F95_OBJS-onestep = f951_frontend.o
 # Define the names for selecting gfortran in LANGUAGES.
 fortran: f951$(exeext)
@@ -90,11 +92,22 @@
        -rm -f gfortran-cross$(exeext)
        cp gfortran$(exeext) gfortran-cross$(exeext)
+f951_frontend.o: $(F95_OBJS:.o=.c)
+        $(CC) $(ALL_CFLAGS) $(LDFLAGS) -c $(filter %.c,$^) -o $@ -combine
 # The compiler itself is called f951.
+# is not generated via configure, so we cannot use @onestep@
+ifeq ($(onestep),)
 f951$(exeext): $(F95_OBJS) \
                $(BACKEND) $(LIBDEPS) attribs.o
        $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
                $(F95_OBJS) $(BACKEND) $(LIBS) attribs.o
+f951$(exeext): $(F95_OBJS-onestep) \
+               $(BACKEND) $(LIBDEPS) attribs.o
+       $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
+               $(F95_OBJS-onestep) $(BACKEND) $(LIBS) attribs.o
 gt-fortran-trans.h    : s-gtype; @true

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]