This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [tree-ssa] DCE and aliasing fixes [patch]



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]