[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: flag issue in AC_PROG_CXX for Sun Studio

From: Bob Friesenhahn
Subject: Re: flag issue in AC_PROG_CXX for Sun Studio
Date: Fri, 26 Feb 2010 10:24:49 -0600 (CST)
User-agent: Alpine 2.01 (GSO 1266 2009-07-14)

On Fri, 26 Feb 2010, Ralf Wildenhues wrote:

Thankfully, CFLAGS and CXXFLAGS are separate variables.  So it sounds like
all we have to do is teach AC_PROG_CXX to decide if this is the Sun C++
compiler, and if so, use -g0 instead of -g. But I don't have quick access
to the Sun compiler, to write a reliable test for deciding between the two
ideas, so I'm relying on some help on that front.

I agree that also disabling inlining may be weird, and that the default
choices for CFLAGS and CXXFLAGS may make questionable assumptions about
bug distribution in (esp. past) compilers, but is it worth changing this
long-known semantics for that?

More, is it worth deviating from feature tests for this setting?  Other
compilers accept -g0 too, for example GCC does and it doesn't do what
we would like to have.

The decision to pass -g as a default is strongly influenced by GCC's almost unique ability to achieve full optimization with debugging enabled. While Sun Studio will accept -g or -g0 (and provide a level of debugging), either of these may have a negative influence on optimizations. In my opinion, it does not make sense for debugging to be applied to most non-GCC compilers as a default since the resulting code may run slower and the default should provide well optimized code.

There are other issues with Sun Studio as well. When I want to profile GraphicsMagick I use CFLAGS '-g -xO3' because an optimization level of less than -xO3 disables OpenMP support, and the profiler needs -g in order to provide human readable output. Optimization levels greater than -xO3 don't provide the profiler with the data it needs.

Bob Friesenhahn
GraphicsMagick Maintainer,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]