https://bugs.llvm.org/show_bug.cgi?id=50645

vit9696 <vit9...@avp.su> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vit9...@avp.su
         Resolution|INVALID                     |---
             Status|RESOLVED                    |REOPENED

--- Comment #2 from vit9696 <vit9...@avp.su> ---
The issue is legit, but the example is a bit too incomplete to properly
understand the problem. What happens inbetween the declaration and the read
operation (and was omitted from the original example) is access made via dma.
I.e. more like this:

uintptr_t get_phys_addr(volatile const void* ptr, size_t sz);
void read_data(uintptr_t addr);

bool test(void)
{
  volatile int var;
  uintptr_t phys = get_phys_addr(&var, sizeof(var));
  read_data(phys);
  return var != 0;
}

It is not correct to drop const from get_phys_addr, as we may want to get one
from a read-only object as well.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to