Bugzilla – Bug 491
[dse] DSE deletes stores that are partially overwritten by smaller stores later
Last modified: 2005-10-27 11:59:33
You need to log in before you can comment on or make changes to this bug.
On linux/i386 and using CWriter, the program attached below gets translated into wrong source code and after compilation with gcc the assertion failed in line 16: 'u.l == 128' triggers.
Created an attachment (id=193) [details] Original program.
Created an attachment (id=194) [details] Output from CWriter which triggers the bug.
Update: this might be some subtle aliasing problem, and not all combinations of gcc versions and options seem to trigger it. Here are some that do: Stock GNU gcc-2.95.3 gcc-2.95.3 -O0 -fno-strict-aliasing bug491_llvm.c gcc version 3.4.3 (Mandrakelinux 10.2 3.4.3-1mdk) gcc -O2 -fno-strict-aliasing bug491_llvm.c
Here is a reduced testcase. Run it though DSE and the first store is deleted, as DSE thinks that the second store kills it. This is clearly incorrect. int %test() { %V = alloca int store int 1234567, int* %V %V2 = cast int* %V to sbyte* store sbyte 0, sbyte* %V2 %X = load int* %V ret int %X }
Fixed. Testcase here: http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20041227/022738.html Patch here: http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20041227/022740.html Thanks a lot for the bug report!! -Chris
Update: this program (attachment "Original program") fails with CVS 20051027 when using the i386 code generator.
Nice catch. Fixed, patch here: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20051024/029098.html -Chris
Note: I checked the testcase into llvm-test so we don't regress on this again. -Chris