This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/66086] Casting a pointer to an uintptr_t and later to a double confuses the optimizer


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66086

--- Comment #3 from Andrea Griffini <agriff at tin dot it> ---
The problem remains even storing the intermediate result to a named variable
(not really surprising)...

    uintptr_t ip = (uintptr_t)ptr;
    return (double)ip;

but of course goes away if storing the pointer to a global variable.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]