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

llvm miscompiles gcc.target/i386/sse4_1-mpsadbw.c

Open llvmbot opened this issue 17 years ago • 7 comments

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.

llvmbot avatar Jan 29 '09 20:01 llvmbot

Nice!

lattner avatar Apr 08 '10 03:04 lattner

Fixed thusly:

http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20100405/099469.html

echristo avatar Apr 08 '10 03:04 echristo

I'll grab this.

echristo avatar Sep 04 '09 03:09 echristo

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.

llvmbot avatar Jan 29 '09 21:01 llvmbot

How is it miscompiling it? Is it unsafe to hoist mpsadbw etc? IF so, mpsadbw should not be marked readnone.

lattner avatar Jan 29 '09 20:01 lattner

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.

llvmbot avatar Jan 29 '09 20:01 llvmbot

assigned to @echristo

llvmbot avatar Jan 29 '09 20:01 llvmbot