This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Where does GCC pick passes for different opt. levels
- From: Marc Glisse <marc dot glisse at inria dot fr>
- To: Steve Ellcey <sellcey at mips dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 11 Aug 2014 23:16:49 +0200 (CEST)
- Subject: Re: Where does GCC pick passes for different opt. levels
- Authentication-results: sourceware.org; auth=none
- References: <42bd6319-2c9b-4c0d-b04d-aed54d8a43ec at BAMAIL02 dot ba dot imgtec dot org>
- Reply-to: gcc at gcc dot gnu dot org
On Mon, 11 Aug 2014, Steve Ellcey wrote:
I have a basic question about optimization selection in GCC. There used to
be some code in GCC (passes.c?) that would set various optimize pass flags
depending on if the 'optimize' flag was > 0, > 1, or > 2; later I think
there may have been a table.
There is still a table in opts.c, with entries that look like:
{ OPT_LEVELS_2_PLUS, OPT_ftree_vrp, NULL, 1 },
This code seems gone now and I can't figure
out how GCC is selecting what optimization passes to run at what optimization
levels (-O1 vs. -O2 vs. -O3). How is this handled in the top-of-tree GCC code?
I see passes.def but there doesn't seem to be anything in there to tie
specific passes to specific optimization levels. Likewise in common.opt
I see flags for various optimization passes but nothing to tie them to
-O1 or -O2, etc.
I'm probably missing something obvious, but a pointer would be much
appreciated.
--
Marc Glisse