Sun CC v.s. G++ options2009年03月10日 10時17分46秒

Sun の CC コンパイラと g++ を試していて、面白いものを見付けた。 Translating gcc/g++/gfortran Options to Sun Studio Compiler Options にオプションの対比表がある。

-help
-help
Prints a summary of available options
-g
-g
Produces additional symbol table and optimization information for the debugger and analyzer
 
-g0
C++: Produces additional symbol table information for the debugger and analyzer, but does not disable inlining. See here for more.
-p -profile
-g
Prepares the object code to collect data for profiling
-fbounds-check
-C
Fortran: Enable array bounds checking
 
-xcheck=init_local
Initialize local variables to garbage values
 
-xcheck=stkovf
Check for stack overflow
-m64
-m64
Generate code for the 64 bit memory model
-m32
-m32
Generate code for the 32 bit memory model
-fPIC
-KPIC
Generates position-independent code
-fdefault-double-8
-xtypemap=double:64
Make the size of DOUBLEPRECISION variables be 64 bits
-fdefault-real-8
-xtypemap=real:64
Fortran: Make the size of REAL variables be 64 bits
-fdefault-integer-8
-xtypemap=integer:64
Fortran: Make the size of INTEGER variables be 64 bits
-fno-underscoring
-ext_names=plain
Fortran: Do not append underscores to external names
-fsecond-underscore
available soon
Fortran: Append 2 underscores to external names containing underscores
-fopenmp
-xopenmp
Supports the OpenMP interface for explicit parallelization
-ffree-form
-free
Fortran: Free-form source
-ffixed-form
-fixed
Fortran: Fixed-form source
-ffixed-line-length-132
-e
Fortran: Extend max line length for fixed form source
-O
-fast
Invokes a variety of options as a first guess at best run-time performance
 
-xO5
Selects a high optimization level
 
-xtarget=native
Optimize code for the host system
 
-xalias_level
CC, cc: Enables the compiler to perform type-based alias analysis and optimizations
 
-xbuiltin
Improve the optimization of code that calls standard library functions
 
-xipo=2
Performs whole-program optimizations
-ftree-vectorize
-xvector=simd
Enables automatic generation of the packed SIMD instructions
-march
-xarch
Generates code for a particular instruction set architecture
-mtune
-xchip
Tune for a particular type of hardware
-ffast-math
-fsimple=2
Selects aggressive floating-point arithmetic optimizations
-ftree-parallelize-loops
-xautopar
Enables automatic parallelization for multiple processors
-funroll-loops
-xunroll
Unroll loops (on at -xO3 in Sun Studio compilers)
-finline-functions
-xinline
Inline functions (on at -xO4 in Sun Studio compilers)
-fno-inline-functions
-xinline=
Disables automatic function inlining
-Os
-xspace
Avoids optimizations that increase code size
-fprofile-generate
-xprofile=collect
Generates code to collect profile feedback information
-fprofile-use
-xprofile=use
Uses profile feedback information for optimization
-shared
-G
Linker: Produce a shared object rather than a dynamically linked executable
-static
-Bstatic
Linker: Link with static versions (.a) of libraries (default is -Bdynamic)