This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR c/10175: Fix for -Wunreachable-code
- From: Roger Sayle <roger at www dot eyesopen dot com>
- To: Mark Mitchell <mark at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 31 Mar 2003 13:25:14 -0700 (MST)
- Subject: Re: [PATCH] PR c/10175: Fix for -Wunreachable-code
On 31 Mar 2003, Mark Mitchell wrote:
> > This doesn't actually slow down the compiler. Previously, we'd
> > traverse the entire expression emitting RTL as we went, now we
> > just traverse the same RTL looking for labels. So all the same
> > memory is touched.
>
> Aren't we now walking types and such as well?
To be honest I'm not sure. If someone could explain which additional
code I'd need to add to appropriately set walk_subtrees such that it
doesn't traverse into types, I'd very much appreciate it.
The same bug, if we do traverse into types, also exists for
find_alloca_call in tree-inline.c and several other places where
we currently use walk_tree without explicitly pruning the search.
> I guess I feel that this patch is too risky for 3.3, and not the right
> approach for 3.4. I don't want us adding more cruft in here; we should
> either fix it right in the front ends or using the current approach in
> the existing code, or both.
I agree with you about 3.3. But remember that the original motivation
for this patch had nothing to do with warnings, but to improve the
performance of the compiler and improve the quality of the code we
generate at -O0. It was Steven that pointed out the side-effect that
a minor change to the same code could be used to close a high priority
PR.
Hopefully the patch will get approved for 3.4 on its compiler performance
and code quality merits alone.
Roger
--