[LLVMbugs] [Bug 1647] volatile attribute lost on pointer array dereferences

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Mon Sep 10 06:45:56 PDT 2007


giuma <giuma.cordes at gmail.com> changed:

           What    |Removed                     |Added
         Resolution|DUPLICATE                   |WONTFIX

--- Comment #2 from giuma <giuma.cordes at gmail.com>  2007-09-10 08:45:55 ---
Hi again,

Sorry to bother again, but the bug is indeed induced by the same code snippet
as of bug 1603 in c-typeck.c, however the patch given for it doesn't fix this
one too.

I'm no gcc front-end expert at all, but it looks to me the volatility flag is
used in a different way that the readonly flag (associated to bug 1603).
Read only is one is applied towards the memory location while the volatility
against the reference itself, in fact the same simple example above still
generates a non volatile store instead of a volatile one even if the patch is

The problem is that once a build_modify_expr method is invoked in tree.c (e.g.
by the assignment) it finds the volatile_flag of the arg0 (the array reference
built by the previous call to patched build_array_ref code) being false, this
because the flag is instead attached to the type and not the reference itself.
Note that when a pointer dereference is used in place of the array one, the
associated tree contains an indirect_ref with a volatile_flag set.

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list