Re: Recognize -Ofast like -ffast-math for crtfastmath.o

2011-05-04 Thread Richard Guenther
On Wed, May 4, 2011 at 4:22 PM, Rainer Orth  
wrote:
> Hi Michael,
>
>> -Ofast is intended to be -O3 plus -ffast-math.  For the compiler proper
>> this works, but under -ffast-math we add crtfastmath.o (or some
>> equivalent) to the link command line on some targets.  As usual for our
>> specs this uses matching on command line arguments, hence we'll
>> explicitely have to add Ofast.
>>
>> All these targets use the same idiom, so I hope it's okay if I'm testing
>> only x86_64-linux (regstrapping in progress there).  CCed the respective
>> target maintainers.  I wouldn't have anything against a global reviewer
>> just acking the whole thing :)
>
> I had noticed that duplication before.  Rather than continue down that
> road, I'd rather have us introduce a new spec for this issue.

This can be done separately.  Note the patch also applies to the 4.6
branch where -Ofast was introduced.

Thus, ok for trunk and the branch.

Thanks,
Richard.


Re: Recognize -Ofast like -ffast-math for crtfastmath.o

2011-05-04 Thread Rainer Orth
Hi Michael,

> -Ofast is intended to be -O3 plus -ffast-math.  For the compiler proper 
> this works, but under -ffast-math we add crtfastmath.o (or some 
> equivalent) to the link command line on some targets.  As usual for our 
> specs this uses matching on command line arguments, hence we'll 
> explicitely have to add Ofast.
>
> All these targets use the same idiom, so I hope it's okay if I'm testing 
> only x86_64-linux (regstrapping in progress there).  CCed the respective 
> target maintainers.  I wouldn't have anything against a global reviewer 
> just acking the whole thing :)

I had noticed that duplication before.  Rather than continue down that
road, I'd rather have us introduce a new spec for this issue.

Thanks.
Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


Recognize -Ofast like -ffast-math for crtfastmath.o

2011-05-04 Thread Michael Matz
Hi,

-Ofast is intended to be -O3 plus -ffast-math.  For the compiler proper 
this works, but under -ffast-math we add crtfastmath.o (or some 
equivalent) to the link command line on some targets.  As usual for our 
specs this uses matching on command line arguments, hence we'll 
explicitely have to add Ofast.

All these targets use the same idiom, so I hope it's okay if I'm testing 
only x86_64-linux (regstrapping in progress there).  CCed the respective 
target maintainers.  I wouldn't have anything against a global reviewer 
just acking the whole thing :)


Ciao,
Michael.

* config/alpha/elf.h (ENDFILE_SPEC): Add Ofast.
* config/alpha/osf5.h (ENDFILE_SPEC): Add Ofast.
* config/alpha/netbsd.h (ENDFILE_SPEC): Add Ofast.
* config/sparc/linux.h (ENDFILE_SPEC): Add Ofast.
* config/sparc/sp64-elf.h (ENDFILE_SPEC): Add Ofast.
* config/sparc/sp-elf.h (ENDFILE_SPEC): Add Ofast.
* config/sparc/linux64.h (ENDFILE_SPEC): Add Ofast.
* config/sparc/freebsd.h (ENDFILE_SPEC): Add Ofast.
* config/sparc/sol2.h (ENDFILE_SPEC): Add Ofast.
* config/i386/cygwin.h (ENDFILE_SPEC): Add Ofast.
* config/i386/gnu-user.h (ENDFILE_SPEC): Add Ofast.
* config/i386/gnu-user64.h (ENDFILE_SPEC): Add Ofast.
* config/i386/darwin.h (ENDFILE_SPEC): Add Ofast.
* config/i386/mingw32.h (ENDFILE_SPEC): Add Ofast.
* config/ia64/linux.h (ENDFILE_SPEC): Add Ofast.
* config/mips/linux.h (ENDFILE_SPEC): Add Ofast.

Index: config/alpha/elf.h
===
--- config/alpha/elf.h  (revision 173309)
+++ config/alpha/elf.h  (working copy)
@@ -397,7 +397,7 @@ do {
\
 
 #undef ENDFILE_SPEC
 #define ENDFILE_SPEC \
-  "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
+  "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
 
 /* Select a format to encode pointers in exception handling data.  CODE
Index: config/alpha/osf5.h
===
--- config/alpha/osf5.h (revision 173309)
+++ config/alpha/osf5.h (working copy)
@@ -102,7 +102,7 @@ along with GCC; see the file COPYING3.
   "%{!shared:%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}"
 
 #define ENDFILE_SPEC \
-  "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s}"
+  "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s}"
 
 #define MD_STARTFILE_PREFIX "/usr/lib/cmplrs/cc/"
 
Index: config/alpha/netbsd.h
===
--- config/alpha/netbsd.h   (revision 173309)
+++ config/alpha/netbsd.h   (working copy)
@@ -70,7 +70,7 @@ along with GCC; see the file COPYING3.
 
 #undef ENDFILE_SPEC
 #define ENDFILE_SPEC   \
-  "%{ffast-math|funsafe-math-optimizations:crtfm%O%s} \
+  "%{Ofast|ffast-math|funsafe-math-optimizations:crtfm%O%s} \
%(netbsd_endfile_spec)"
 
 
Index: config/sparc/linux.h
===
--- config/sparc/linux.h(revision 173309)
+++ config/sparc/linux.h(working copy)
@@ -37,7 +37,7 @@ along with GCC; see the file COPYING3.
 #undef  ENDFILE_SPEC
 #define ENDFILE_SPEC \
   "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s\
-   %{ffast-math|funsafe-math-optimizations:crtfastmath.o%s}"
+   %{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s}"
 
 /* This is for -profile to use -lc_p instead of -lc.  */
 #undef CC1_SPEC
Index: config/sparc/sp64-elf.h
===
--- config/sparc/sp64-elf.h (revision 173309)
+++ config/sparc/sp64-elf.h (working copy)
@@ -60,7 +60,7 @@ crtbegin.o%s \
 
 #undef ENDFILE_SPEC
 #define ENDFILE_SPEC \
-  "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
+  "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
crtend.o%s"
 
 /* Use the default (for now).  */
Index: config/sparc/sp-elf.h
===
--- config/sparc/sp-elf.h   (revision 173309)
+++ config/sparc/sp-elf.h   (working copy)
@@ -35,7 +35,7 @@ along with GCC; see the file COPYING3.
 
 #undef ENDFILE_SPEC
 #define ENDFILE_SPEC \
-  "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
+  "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
crtend.o%s crtn.o%s"
 
 /* Don't set the target flags, this is done by the linker script */
Index: config/sparc/linux64.h
===
--- config/sparc/linux64.h  (revision 173309)
+++ config/sparc/linux64.h  (working copy)
@@ -59,7 +59,7 @@ along with GCC; see the file COPYING3.
 #undef ENDFILE_SPEC
 #define ENDFILE_SPEC \
   "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s\
-   %{ffast-math|funsafe-math-opt