This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] for PR 27865
- From: Diego Novillo <dnovillo at redhat dot com>
- To: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 14 Aug 2006 13:50:43 -0400
- Subject: Re: [patch] for PR 27865
- References: <20060808082036.GA27794@atrey.karlin.mff.cuni.cz>
Zdenek Dvorak wrote on 08/08/06 04:20:
> + static bool
> + pointer_used_p (tree ptr)
> + {
> + use_operand_p use_p;
> + imm_use_iterator imm_iter;
> + tree stmt, rhs;
> +
> + if (get_ptr_info (ptr)->is_dereferenced)
> + return true;
> +
Hmm, why not test for the presence of a symbol or name tag? If either
of these is present, the pointer is dereferenced. Copy propagation
sets that. But that won't help you when the pointer is used only in
comparisons, so I guess you still need the imm-use traversal.
The rest looks fine.