https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90571
Daniel Henrique Barboza <daniel.barboza at oss dot qualcomm.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |daniel.barboza at oss dot
qualcomm
| |.com
--- Comment #9 from Daniel Henrique Barboza <daniel.barboza at oss dot
qualcomm.com> ---
I have a WIP patch for this issue that is currently failing bootstrap
(miscompare between stage2 and stage3). It works with this testcase though.
The idea, as Richi said in comment #3, is to split the indirect calls into
direct ones. Doing that in phiopt allows t0 to be optimized by vrp later.
I am not sure what I'm missing in that code. I think I need to add a vphi to
split the mem operands but doing that makes the bootstrap fail faster (which
may indicate that I don't know how to add the vphi). I tried cloning the
original gcall, got scared of potential issues with debug stmts being carried
over, so I ended up copying each gcall arg manually.
I am not sure if I'm creating the additional block the right way too.
Also worth mentioning: my first prototype was a forwprop code that would change
the PHI args containing the function pointers to the folded CST vals. I
dropped that because I didn't find a way to know whether the function pointers
represent functions that could be folded to constants (tried
gimple_fold_stmt_to_constant() and other fold_* variations, no luck).