Comment 2 for bug 1072650

Revision history for this message
Rafał Mużyło (galtgendo) wrote : Re: gcc -O2 produces incorrect code for accessing struct by its address

The bug in gcc seems to be not printing "dereferencing type-punned pointer will break strict-aliasing rules" warning, as either '-fno-strict-aliasing' or wrapping the struct in an union with short[6] seems to fix the problem.

On not quite related note: would have been nice if the intended output of that test program was noted. While you can calculate it on your own, it would make for a better testcase.