llvm miscompiles gcc.target/i386/sse4_1-mpsadbw.c
| Bugzilla Link | 3440 |
| Resolution | FIXED |
| Resolved on | Apr 07, 2010 20:03 |
| Version | trunk |
| OS | All |
| Attachments | bugpoint-tonotoptimize.bc, bugpoint-tooptimize.bc |
| Reporter | LLVM Bugzilla Contributor |
| CC | @lattner,@echristo |
Extended Description
Dale noticed lots of gcc sse4.1 tests are failing (when they are run on sse4.1 capable machines!). I looked into one of them: sse4_1-mpsadbw.c. It turns out to be an optimizer bug.
Nice!
Fixed thusly:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20100405/099469.html
I'll grab this.
I haven't had a chance to look into it. mpsadbw sums absolute difference. It doesn't touch memory. I don't see how it can be unsafe to hoist it.
How is it miscompiling it? Is it unsafe to hoist mpsadbw etc? IF so, mpsadbw should not be marked readnone.
To reproduce: opt -licm on bugpoint-tooptimize.bc -f -o bad.bc llc -f bad.bc llc -f bugpoint-tonooptimize.bc gcc bad.s bugpoint-tonooptimize.s ./a.out
The program will abort.
assigned to @echristo