https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121492

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Created attachment 62358
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=62358&action=edit
Patch which helps somewhat

With this (simple) patch on top of
https://gcc.gnu.org/pipermail/gcc-patches/2025-September/694801.html .

We get this from PRE (at -O2 -fno-tree-sra):
```
  <bb 2> [local count: 10737416]:
  a1.a = a_6(D);

  <bb 3> [local count: 1063004408]:
  # i_14 = PHI <i_11(4), 0(2)>
  # prephitmp_4 = PHI <pretmp_16(4), a_6(D)(2)>
  _2 = prephitmp_4 + a_6(D);
  a1 = VIEW_CONVERT_EXPR<union A>(_2);
  i_11 = i_14 + 1;
  if (i_11 != 100)
    goto <bb 4>; [98.99%]
  else
    goto <bb 5>; [1.01%]

  <bb 4> [local count: 1052266995]:
  pretmp_16 = VIEW_CONVERT_EXPR<float>(a1);
  goto <bb 3>; [100.00%]
```

I would have expected pretmp_16 just be _2 here. Or should a represention be
different here?
e.g. Should:
a1 = VIEW_CONVERT_EXPR<union A>(_2);
Be represented as:
VIEW_CONVERT_EXPR<float>(a1) = _2;


I am ok to suggestions and/or improvements to pre.

Reply via email to