This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Trivial cleanup of uses of flag_lto || flag_whopr
Hi Diego, thanks for thinking about this.
Note that flag_generate_lto is not equivalent to flag_lto||flag_whopr.
In particular, flag_lto and flag_generate_lto are typically not set
at the same time. I haven't checked at these spots, but in principle
this change does not seem sound.
Yes, I hadn't spotted that lto/lto-lang.c also sets flag_generate_lto.
However if flag_lto or flag_whopr is set then flag_generate_lto will
be set (see opts.c). As far as I can see, all the places that check
flag_lto || flag_whopr actually want flag_generate_lto (with the possible
exception of fortran/options.c), so I still think the change is correct.
The reason I would like this change is that my plugin does an additional
type of LTO, and all the places that do flag_lto || flag_whopr should do
flag_lto || flag_whopr || flag_baldrick. Rather than do this or fake it
by setting flag_lto or flag_whopr, I would rather be able to simply set
flag_generate_lto, which in any case seems to be the right thing to do
(but which currently does not have all the right consequences).
Ciao,
Duncan.