First Last Prev Next    No search results available
Details
: [dse] DSE deletes stores that are partially overwritten b...
Bug#: 491
: libraries
: Scalar Optimizations
Status: RESOLVED
Resolution: FIXED
: All
: All
: 1.4
: P2
: normal
: 1.5

:
: miscompilation
:
:
  Show dependency tree - Show dependency graph
People
Reporter: Markus F.X.J. Oberhumer <markus@oberhumer.com>
Assigned To: Chris Lattner <sabre@nondot.org>

Attachments
Original program. (618 bytes, text/plain)
2004-12-28 12:18, Markus F.X.J. Oberhumer
Details
Output from CWriter which triggers the bug. (5.05 KB, text/plain)
2004-12-28 12:19, Markus F.X.J. Oberhumer
Details


Note

You need to log in before you can comment on or make changes to this bug.

Related actions


Description:   Opened: 2004-12-28 12:17
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.
------- Comment #1 From Markus F.X.J. Oberhumer 2004-12-28 12:18:45 -------
Created an attachment (id=193) [details]
Original program.
------- Comment #2 From Markus F.X.J. Oberhumer 2004-12-28 12:19:44 -------
Created an attachment (id=194) [details]
Output from CWriter which triggers the bug.
------- Comment #3 From Markus F.X.J. Oberhumer 2004-12-28 12:33:30 -------
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

------- Comment #4 From Chris Lattner 2004-12-28 22:25:10 -------
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
}
------- Comment #5 From Chris Lattner 2004-12-28 22:38:00 -------
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
------- Comment #6 From Markus F.X.J. Oberhumer 2005-10-27 01:55:18 -------
Update: this program (attachment "Original program") fails with CVS 20051027
when using the i386 code generator.
------- Comment #7 From Chris Lattner 2005-10-27 02:11:01 -------
Nice catch.  Fixed, patch here:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20051024/029098.html

-Chris
------- Comment #8 From Chris Lattner 2005-10-27 11:59:33 -------
Note: I checked the testcase into llvm-test so we don't regress on this again.

-Chris

First Last Prev Next    No search results available