On Sun, 2006-01-01 at 10:22 -0800, Mark Mitchell wrote: > Steven Bosscher wrote: > > Hi rth, > > > > The stack space sharing you added to cfgexpand.c breaks RTL alias > > analysis. > > > > For example, the attached test case breaks for pentiumpro at -O2. > > The problem apparently is that the second store to c is moved up > > before before the load. > > My guess at a solution is that when A (with alias set S_a) and B (with > alias set S_b) are given the same stack slot, we should create a new > alias set S_c which is a subset of both S_a and S_b, and give the > combined stack slot that aliase set.
Won't work here, sadly, AFAIK. This is because it's not TBAA that gets you here, and in fact, it won't help (In fact, they already should be in the same alias set because they are union'd together). Take a look at true_dependence, or canon_true_dependence, in alias.c, and you'll see that there are a bunch of times that even if the alias sets say they conflict, we will return that they don't conflict. This is one of those times. If this is the same testcase steven was discussing on IRC, the real solution is to transfer the information that the stack space sharing knows into some simple set form, and use *that directly* in alias.c, and check it *first*, so that if they have the same stack slot, we say there is a dependence, even if the memory expressions/types/etc look different. This also lets you say for sure whether things have a different stack slot or not, which we seem to try to fathom using the reg_*_value stuff (why guess when we could just ask where it put them?) >