This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Avoid generating warnings for -O2 -Wunreachable-code
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Eric Fisher <joefoxreal at gmail dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 4 Nov 2009 07:40:43 +0100
- Subject: Re: [patch] Avoid generating warnings for -O2 -Wunreachable-code
- References: <d6afecde0911032137m38ddf98ax3d5b18467d552305@mail.gmail.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Nov 04, 2009 at 01:37:50PM +0800, Eric Fisher wrote:
> This patch will avoid generating warnings for -O2 -Wunreachable-code,
> and has been tested on my machine. Also two test cases need be
> modified.
This doesn't look like a good idea, while you get rid of an unwanted
warning, you also make the code less debuggable.
> 2009-11-04 Eric Fisher <joefoxreal@gmail.com>
>
> * gcc/tree-ssa-loop-ivcanon.c: Set the statement locations as
> UNKNOW_LOCATION to avoid generating warnings for -Wunreachable-code.
> * gcc.dg/Wunreachable-2.c: Remove xfail from dg-bogus.
> * gcc.dg/Wunreachable-8.c: Remove xfail from dg-bogus.
Jakub