Don't enable PGO-related options if .gcda file is not found. 61/49461/1 tizen
authorMaxim Ostapenko <m.ostapenko@partner.samsung.com>
Tue, 13 Oct 2015 12:00:40 +0000 (15:00 +0300)
committerMaxim Ostapenko <m.ostapenko@partner.samsung.com>
Tue, 13 Oct 2015 12:00:40 +0000 (15:00 +0300)
commitc0406c5f6bb590b8f8920ade470c7ccda8ca9723
treec72ae15345d41783c362789aeb46881ca44f5e84
parent77e83fcfda82c750ba99a9244358d3cd3adc1659
Don't enable  PGO-related options if .gcda file is not found.
@TC-440

gcc/

* common.opt (profile_file_name): New variable.
* toplev.c (do_compile): Pass it into coverage_init.
* opts.c: Include gcov-io.h.
(common_handle_option): Factor out enabling PGO-related
optimizations into separate function. Defer enabling these
optimizations until we know if corresponding .gcda file exists.
(maybe_setup_aux_base_name): New function.
(setup_coverage_filename): Likewise.
(enable_fdo_optimizations): Likewise.
(finish_options): Call maybe_setup_aux_base_name and setup coverage
filename. Enable PGO-related optimizations if corresponding .gcda file
exists.
* coverage.c (coverage_init): Adjust to use profile_file_name.

Change-Id: Ib085add4697d2a37a38d069a37818fdf53bb9f77
gcc/common.opt
gcc/coverage.c
gcc/opts.c
gcc/toplev.c