On Sat, Apr 06, 2024 at 05:54:43PM -0600, Neil Carlson wrote:
> What are the recommended options to use (e.g., --enable-libsanitize) when
> building GCC from source for the purpose of locating gfortran bugs? I'm
> trying to pin down a runtime memory corruption error, and I recall seeing
> at various times in the past recommendations for creating a suitable
> gfortran build and the associated gfortran command line options for dumping
> internal info, but I can't seem to find that info now.

Neil,

Are you debugging on linux- or BSD-based OS?

By default, gcc will build itself with "-g -O2" in the
compiler options.  -O2 can make it more challenging to
debug issues in gfortran.  Once can force gcc to use
either "-g -O" or "-Og" by setting a few environmental
variable.  Looking at my build script, I use 

CFLAGS="-O -g"
BOOT_CFLAGS="-O -g"
CFLAGS_FOR_TARGET="-O -g"
CXXFLAGS="-O -g"
BOOT_CXXFLAGS="-O -g"
CXXFLAGS_FOR_TARGET="-O -g"
LDFLAGS="-O -g"

-- 
steve

Reply via email to