This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] DCE and aliasing fixes [patch]
- From: Daniel Berlin <dberlin at dberlin dot org>
- To: Diego Novillo <dnovillo at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 2 Feb 2003 23:14:32 -0500 (EST)
- Subject: Re: [tree-ssa] DCE and aliasing fixes [patch]
- References: <20030203035424.GA26596@tornado.toronto.redhat.com>
On Sun, 2 Feb 2003, Diego Novillo wrote:
> This patch fixes enough bugs in DCE and aliasing that we can now
> at least enable -ftree-dce when running the testsuite. We still
> can't bootstrap with DCE enabled. We reach stage2 and fail when
> the stage2 compiler miscompiles genrecog.
>
> The main changes are:
>
> - When the compiler finds a call to a pure or const function, it
> should consider that any pointer passed to the function will be
> dereferenced.
This is incorrect for const functions, as extend.texi says:
"
@cindex pointer arguments
Note that a function that has pointer arguments and examines the data
pointed to must @emph{not} be declared @code{const}. Likewise, a
function that calls a non-@code{const} function usually must not be
@code{const}. It does not make sense for a @code{const} function to
return @code{void}.
"
If you have problems with aliases and const functions, either
1. your bug lies elsewhere
2. the code in question shouldn't have been marked const