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

--- Comment #5 from Albi <albrecht.guendel at web dot de> ---
OK ok, i see. Its a missed optimization due to volatile-problems.. 

I got a workaround however:

#define IO_READ(x) ( static_cast<decltype(x)>( *const_cast< typename
std::remove_volatile<decltype(x)>::type* >(&(x)) ))


The volatile is taken away and then added again: no redundant instructions
anymore. 
However i am not sure if that breaks anything (volatile related).. but at least
for me it worked fine so far.

Reply via email to