------- Comment #10 from rguenth at gcc dot gnu dot org  2008-01-04 15:35 
-------
We can 'abuse' PREs inserting of fake stores machinery to handle the case in
PR33989, where for

union a
{
  int i;
  float f;
};

void f (float *a, int *b)
{
  union a c;
  c.f = *a;
  *b = c.i;
}

we then get (PRE)

<bb 2>:
  # VUSE <SMT.6_5(D)>
  D.1549_2 = *a_1(D);
  # SFT.0_8 = VDEF <SFT.0_6(D)>
  # SFT.1_9 = VDEF <SFT.1_7(D)>
  c.f = D.1549_2;
  uniontmp.12_13 = VIEW_CONVERT_EXPR<int>(D.1549_2);
  D.1550_3 = uniontmp.12_13;
  # SMT.7_11 = VDEF <SMT.7_10(D)>
  *b_4(D) = D.1550_3;
  return;

and before expand:

<bb 2>:
  # SMT.7_11 = VDEF <SMT.7_10(D)>
  *b = VIEW_CONVERT_EXPR<int>(*a);
  return;

and finally

f:
.LFB2:
        movl    (%rdi), %eax
        movl    %eax, (%rsi)
        ret

but we need to make sure VN processes the inserted conversions (which do
not have uses) and we need to enhance PREs poolification of trees to
handle COMPONENT_REFs (and possibly more).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34043

Reply via email to