First Last Prev Next    No search results available
Details
: [cbackend] C backend does not respect 'volatile'
Bug#: 511
: libraries
: Backend: C
Status: RESOLVED
Resolution: FIXED
: All
: All
: 1.0
: P2
: normal
: 1.5

:
: miscompilation
:
:
  Show dependency tree - Show dependency graph
People
Reporter: Chris Lattner <sabre@nondot.org>
Assigned To: Unassigned LLVM Bugs <unassignedbugs@nondot.org>

Attachments


Note

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

Related actions


Description:   Opened: 2005-02-14 10:50
Consider this testcase:

void %test(int* %P) {
        %X = volatile load int*%P
        volatile store int %X, int* %P
        ret void
}

The CBE currently emits:

void test(int *l1_P) {
  int l2_X;
  l2_X = *l1_P;
  *l1_P = l2_X;
  return;
}

... which GCC correctly optimizes to:

test:
        ret

The C Backend should emit volatile pointer qualifiers to get the right thing to
happen.
------- Comment #2 From Chris Lattner 2005-02-14 23:54:01 -------
Actually that patch was not quite right.  This one fixes it:
http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20050214/024121.html

First Last Prev Next    No search results available