[Bug driver/33144] New: -march=native does not work on darwin

2007-08-21 Thread fago at caltech dot edu
This works:
/usr/local/bin/gcc -O3 -mtune=native -c Weapon.c

This does not:
/usr/local/bin/gcc -march=native Weapon.c -c -O3
Weapon.c:1: error: bad value (native) for -march= switch
Weapon.c:1: error: bad value (native) for -mtune= switch

gcc -v yields:
Using built-in specs.
Target: i386-apple-darwin8.10.1
Configured with: ../gcc-4.2.1/configure --disable-checking --enable-
languages=c,c++,fortran --with-arch=nocona
Thread model: posix
gcc version 4.2.1

=
Per a suggestion from Ian Lance Taylor:

/usr/local/bin/gcc -v -c -O3 -march=native Weapon.c

  /usr/local/libexec/gcc/i386-apple-darwin8.10.1/4.2.1/cc1 -quiet -v -
D__DYNAMIC__ Weapon.c -fPIC -quiet -dumpbase Weapon.c -march=native -
auxbase Weapon -O3 -version -o /var/tmp//ccSVG0aD.s

=
To which he replied with the issue:

The problem is that the driver code is not working, and the bug is
that gcc doesn't handle that correctly.  There is some code in gcc to
handle the driver code failing, and it works for -mtune=native, but
not for -march=native.

The driver code is supposed to change the -march=native to be
-march=XXX for your CPU.  The code is in
gcc/config/i386/driver-i386.c.

OK, I see the problem.  The code in gcc/config/i386/linux.h looks like
this:

#define CC1_SPEC "%(cc1_cpu) %{profile:-p}"

gcc/config/i386/darwin.h looks like this:

#define CC1_SPEC "%{!mkernel:%{!static:%{!mdynamic-no-pic:-fPIC}}} \
  %{!mmacosx-version-min=*:-mmacosx-version-min=%(darwin_minversion)} \
  %{g: %{!fno-eliminate-unused-debug-symbols: -feliminate-unused-debug-symbols
}}"

The version in darwin.h is missing the %(cc1_cpu).

So there are two bugs: the darwin.h code does not invoke the driver
code for -march=native or -mtune=native, and the i386.c code does not
correctly handle -march=native.  The effect of the first bug is that
neither -march=native nor -mtune=native work on Darwin.  The effect of
the second bug is that -march=native actually gives an error, rather
than being equivalent to -march=generic.


-- 
   Summary: -march=native does not work on darwin
   Product: gcc
   Version: 4.2.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: driver
AssignedTo: unassigned at gcc dot gnu dot org
    ReportedBy: fago at caltech dot edu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33144



[Bug fortran/32987] TAB in FORMAT: accept extension, warn with -std=f*

2007-08-30 Thread fago at caltech dot edu


--- Comment #12 from fago at caltech dot edu  2007-08-30 21:52 ---
A stupid question: why cannot gfortran detect this invalid code at compile
time? I was quite surprised by a runtime error.

BTW, I was compiling some legacy code with 4.2.1 and just hit this ...


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32987



[Bug target/34719] N_GSYM stabs warning with common blocks on Mac OS X Leopard

2008-01-29 Thread fago at caltech dot edu


--- Comment #3 from fago at caltech dot edu  2008-01-29 19:36 ---
This also happens on 4.2.2 It is indeed fixed by using -gdwarf-2.

So should gcc set the type of debug information differently on Leopard, or is
it Apple's issue? If the former, it seems like it should be straight-forward;
will it make it into 4.2.3?

Thanks,
Matt


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34719