llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

Miscompile with -basicaa-recphi=1 -gvn

Open bjope opened this issue 8 years ago • 2 comments

Bugzilla Link 37952
Resolution FIXED
Resolved on Jul 10, 2020 01:52
Version trunk
OS Linux
Attachments reproducer
CC @DMG862,@hfinkel

Extended Description

The attached llvm-lit adapted test case fails for the RUN line using "-basicaa-recphi=1 -gvn". Afaict it is a miscompile.

Note that -basicaa-recphi seems to have been defaulted to 0 since it was introduced in 2015 (r242320). If it turns out that the fault is related to that option, maybe the easy solution is to remove it?

The problem was detected when doing fuzzy testing using randomized options (normally we don't use -basicaa-recphi=1).

bjope avatar Jun 27 '18 11:06 bjope

This was the same problem as D82987, where a MustAlias between %results.0 and %results doesn't imply a MustAlias for every element of the %result.current phi.

With and without the option now produce identical code: https://godbolt.org/z/6W8hc8

DMG862 avatar Jul 10 '20 08:07 DMG862

If the option is off by default and no one is using it (and no one has plans to fix it or improve it) then removing the essentially-dead code is certainly reasonable.

hfinkel avatar Jun 27 '18 16:06 hfinkel