[llvm-bugs] [Bug 30922] static volatile is not honored by the optimizer

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Nov 5 08:05:20 PDT 2016


Dimitry Andric <dimitry at andric.com> changed:

           What    |Removed                     |Added
             Status|NEW                         |RESOLVED
                 CC|                            |dimitry at andric.com
         Resolution|---                         |INVALID

--- Comment #2 from Dimitry Andric <dimitry at andric.com> ---
This is expected, in your example the thing pointed to is volatile, the pointer
itself is not.  You probably intended the following:

static int *volatile VAR;
void FOO() { VAR = 0; }

which compiles to:

FOO:                                    # @FOO
# BB#0:                                 # %entry
    pushl    %ebp
    movl    %esp, %ebp
    movl    $0, VAR
    popl    %ebp

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20161105/fdcee94e/attachment-0001.html>

More information about the llvm-bugs mailing list