Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gcc 4.3.3 compiler options enabled by default

I have moved from gcc version 4.0.3 to 4.3.3 and realized that -mfpmath was set to sse by default in gcc 4.3.3. This actually caused errors in my application. In 4.0.3 the -mfpmath was 387.

I want to know how I can get all the default options enabled by gcc for a given version. How can I dump set of all options used by gcc while compiling. This enables me to compare version 4.0.3 vs 4.3.3.

In general it will be great if I can know a comprehensive list of things need to be checked before going for a version change in gcc .(As this has effect on performance and functionality.)

like image 616
pv. Avatar asked Jun 29 '10 06:06

pv.


People also ask

Does GCC 11 support C ++ 17?

C++17 features are available since GCC 5. This mode is the default in GCC 11; it can be explicitly selected with the -std=c++17 command-line flag, or -std=gnu++17 to enable GNU extensions as well.

How do I change from compiler to GCC?

Refer to your operating system documentation for the correct command to use. Select a compiler that MATLAB supports when running the mex command. To change the compiler, use the varname variable set to GCC , in uppercase letters.

Is GCC a C++ or C compiler?

GCC stands for GNU Compiler Collections which is used to compile mainly C and C++ language. It can also be used to compile Objective C and Objective C++.


2 Answers

gcc -Q -v

With just a basic tiny c or cpp file as an input file. Should give you a big list of all the options passed to gcc by default, one of those might be causing sse fp math to be enabled.

like image 112
Ashaman Avatar answered Oct 19 '22 19:10

Ashaman


In addition to compiling a specific file -Q -v, which outputs the list of passed and enabled options, as well as a lots of other version, configuration, and timing information, you can also use gcc -Q --help=target to just list default target-specific compiler options:

$ gcc --version | head -1
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
$ gcc -Q --help=target
The following options are target specific:
  -m128bit-long-double                  [disabled]
  -m32                                  [disabled]
  -m3dnow                               [disabled]
  -m3dnowa                              [disabled]
  -m64                                  [enabled]
  -m80387                               [enabled]
  -m8bit-idiv                           [disabled]
  -m96bit-long-double                   [enabled]
  -mabi=
  -mabm                                 [disabled]
  -maccumulate-outgoing-args            [disabled]
  -maes                                 [disabled]
  -malign-double                        [disabled]
  -malign-functions=
  -malign-jumps=
  -malign-loops=
  -malign-stringops                     [enabled]
  -mandroid                             [disabled]
  -march=                               x86-64
...

To also include a list of target-specific assembler and linker options (but not currently their default settings), use --target-help instead of --help=target.

like image 34
Trevor Robinson Avatar answered Oct 19 '22 19:10

Trevor Robinson