Need a bit of help in tracking down a problem with gcc -fprofile-arcs -ftest-coverage

Bradley Lucier lucier@math.purdue.edu
Tue Feb 3 20:24:00 GMT 2015


I'm finding that the following command

     /pkgs/gcc-4.9.2/bin/gcc -Q -save-temps -Wno-unused 
-Wno-write-strings -O1 -fno-math-errno -fschedule-insns2 
-fno-strict-aliasing -fno-trapping-math -fwrapv -fomit-frame-pointer 
-fPIC -fno-common -mieee-fp  -fprofile-arcs -ftest-coverage 
-I"../include" -c -o "_io.o" -I. -DHAVE_CONFIG_H 
-D___GAMBCDIR="\"/usr/local/Gambit-C\"" -D___SYS_TYPE_CPU="\"x86_64\"" 
-D___SYS_TYPE_VENDOR="\"unknown\"" -D___SYS_TYPE_OS="\"linux-gnu\"" 
-D___CONFIGURE_COMMAND="\"./configure 'CC=/pkgs/gcc-4.9.2/bin/gcc -Q 
-save-temps' '--enable-track-scheme' '--enable-coverage'"\" 
-D___OBJ_EXTENSION="\".o\"" -D___EXE_EXTENSION="\"\"" 
-D___BAT_EXTENSION="\"\"" -D___PRIMAL _io.c -D___LIBRARY


With gcc configured as

     firefly:~/Downloads/gambit> /pkgs/gcc-4.9.2/bin/gcc -v
     Using built-in specs.
     COLLECT_GCC=/pkgs/gcc-4.9.2/bin/gcc
 
COLLECT_LTO_WRAPPER=/pkgs/gcc-4.9.2/libexec/gcc/x86_64-unknown-linux-gnu/4.9.2/lto-wrapper
     Target: x86_64-unknown-linux-gnu
     Configured with: ../../gcc-4.9.2/configure --prefix=/pkgs/gcc-4.9.2
     Thread model: posix
     gcc version 4.9.2 (GCC)


takes effectively infinite amount of memory (>80GB) on some (rather 
large) functions in (rather large) C files.

So I put in the -Q to try to track what gcc was doing; I killed it at

     Analyzing compilation unit
     Performing interprocedural optimizations
      <*free_lang_data> <visibility> <early_local_cleanups> 
<*free_inline_summary> <profile> <whole-program> <profile_estimate> 
<inline> <pure-const> <static-var>Assembling functions:
      ___setup_mod ___init_mod 
___H__23__23_make_2d_standard_2d_readtable ___H__23__23_six_2d_type_3f_ 
___H__23__23_read_2d_six_2d_datum_2d_or_2d_eof {GC 737902k -> 689272k}^C


So, some questions:

1.  Is it really performing interprocedural optimizations at -O1?

2.  Was it really processing 
___H__23__23_read_2d_six_2d_datum_2d_or_2d_eof when I killed it?

3.  How can I get some more detailed information about what gcc is doing?

This is C code automatically generated from a Scheme file.  Without the 
-ftest-coverage -fprofile-arcs gcc has no problem dealing with it, even 
if I compile the entire .scm file to a single C function.

Thanks.

Brad



More information about the Gcc-help mailing list