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: [patch] for PR23509


On 8/27/05, Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz> wrote:
> Hello,
> 
> the patch
> 
> http://gcc.gnu.org/ml/gcc-patches/2005-08/msg00283.html
> 
> removed the check that prevents propagation of pointers
> when phi nodes are removed during basic block merging.
> This PR occurs in situation like
> 
> p = phi(q);
> # VUSE (something)
> use (*p);
> 
> when q is not dereferenced anywhere.  The pointers that are
> not dereferenced at all have neither name_mem_tag nor type_mem_tag
> set.  Therefore, when the code is replaced with
> 
> use(*q);
> 
> we lose the VUSE, which could in worst case lead to misscompilations.
> In this particular case it only confuses ivopts that expect name_mem_tag
> or type_mem_tag to be set for every dereferenced pointer, and leads to
> ICE.
> 
> This patch puts the check that prevents the propagation of pointers
> back.  The patch also adds the assert that dereferenced pointers have a tag
> set to get_ref_tag, so that the problem is caught before it causes
> memory corruption in get_expr_operands.

Please try to add a testcase for this.

Thanks,
Richard.


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