This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Resurrecting -Wunreachable
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: GCC <gcc at gcc dot gnu dot org>
- Date: Wed, 7 May 2014 14:04:07 +0200
- Subject: Re: Resurrecting -Wunreachable
- Authentication-results: sourceware.org; auth=none
- References: <5368ED25 dot 7090901 at redhat dot com> <CAFiYyc0+1TwHdez4hiop=PVyebTArswFKfebDPwAn_xpoad=qQ at mail dot gmail dot com> <536A1F83 dot 5050703 at redhat dot com>
On Wed, May 7, 2014 at 1:56 PM, Florian Weimer <fweimer@redhat.com> wrote:
> On 05/06/2014 04:30 PM, Richard Biener wrote:
>
>> Like I have suggested in the past a good point to do this kind of analysis
>> on the (mostly, as you say) unoptimized IL is right after going into SSA
>> form and implementing said analysis as an IPA pass (yeah, that somewhat
>> conflicts).
>
>
> I don't think this works for -Wunreachable because trivially unreachable
> code is already gone when we enter SSA. Or am I missing something?
Depends on what "trivially" unreachable is. Yes,
int main()
{
if (0)
foo ();
}
will already be optimized. But I doubt you want to warn for that
given C++ and templates which often have this kind of specializations.
Richard.
>
> --
> Florian Weimer / Red Hat Product Security Team