This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: merge_pointed_to_info
Diego Novillo wrote:
Yes, and it should only happen if dest == orig. Is that the case?
It appears so.
Do we ICE or generate bad code? I'll take a look.
Well, when I've patched bitmap_or_into to verify that you're not doing
the silly 'bitmap_or_into (a, a)', we'll ICE. At the moment I don't
know if we'll generate bad code. I can see that pt_malloc of orig
can become erroneously cleared, and suspect that'll go wrong.
This patch ok?
booting and testing on i686-pc-linux-gnu.
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk
2004-11-04 Nathan Sidwell <nathan@codesourcery.com>
* tree-ssa-alias.c (merge_pointed_to_info): Protected against DEST
and ORIG being the same node.
Index: tree-ssa-alias.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-alias.c,v
retrieving revision 2.51
diff -c -3 -p -r2.51 tree-ssa-alias.c
*** tree-ssa-alias.c 4 Nov 2004 08:57:54 -0000 2.51
--- tree-ssa-alias.c 4 Nov 2004 09:26:41 -0000
*************** merge_pointed_to_info (struct alias_info
*** 1695,1700 ****
--- 1695,1703 ----
{
struct ptr_info_def *dest_pi, *orig_pi;
+ if (dest == orig)
+ return;
+
/* Make sure we have points-to information for ORIG. */
collect_points_to_info_for (ai, orig);
*************** merge_pointed_to_info (struct alias_info
*** 1725,1730 ****
--- 1728,1735 ----
smart enough to determine that the two come from the same
malloc call. Copy propagation before aliasing should cure
this. */
+ gcc_assert (orig_pi != dest_pi);
+
dest_pi->pt_malloc = 0;
if (orig_pi->pt_malloc || orig_pi->pt_anything)