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: Fix disable-checking bootstrap problem on ppc-darwin



On Aug 10, 2004, at 1:56 PM, Geoffrey Keating wrote:



Under just the right circumstances, usually involving --disable-checking, and dependent on environment size and ulimit settings, you can get a hash collision in value_table which causes two things with different vuses to compare the same, which is (I think) not what is wanted.

It's not.

I see that the whole vuses thing is a work-in-progress, so I won't
worry too much about some of the things I saw.  I would point out,
though, that it seems somewhat strange that in

x = a + b;
y = *x;

the two 'x's get numbered differently; there might be an opportunity
there.

Yes, i had noticed this a while ago.
There isn't really an opportunity because:
1. We don't want to eliminate simply duplicate instances of x, it would just increase register pressure (and copy-prop would undo it anyway).
2. We can't eliminate duplicate *x's unless the vuses are the same, which they will be.
3. If the RHS was *(a + b) instead, it would be GIMPLIFIED into a temporary which we could eliminate.


In other words, it just looks weird, but there's nothing we can't eliminate because of it.


Bootstrapped & tested on powerpc-darwin.

--
- Geoffrey Keating <geoffk@apple.com>

===File ~/patches/gcc-treevn-hasheq.patch===================
2004-08-10  Geoffrey Keating  <geoffk@apple.com>

	* tree-vn.c (val_expr_pair_expr_eq): Compare vuses, to match the
	hash function.
...

+
+  for (i = 0; i < NUM_VUSES (ve1->vuses); i++)
+    if (! expressions_equal_p (VUSE_OP (ve1->vuses, i),
+			       VUSE_OP (ve2->vuses, i)))
+      return false;


My only concern is here:
Diego, are the vuse lists sorted, such that we can simply compare them in order and get the right result for equality testing?
If not, can we make them so, so that we can do something like the above?



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