https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101242
--- Comment #6 from David Binderman <dcb314 at hotmail dot com> --- (In reply to David Binderman from comment #4) > Created attachment 51078 [details] > gzipped C++ source code > > I also see this with -O3 with the attached C++ code. Poor example - too big to reduce easily. Here is some reduced C code from a different example: --- /home/dcb/cvise/test/bug733b.c --- typedef struct { int height, width } ufraw_image_data; typedef struct { ufraw_image_data thumb } ufraw_data; ufraw_data ufraw_convert_embedded_uf; int ufraw_convert_embedded_uf_1; void ufraw_convert_embedded(void) { unsigned srcHeight = ufraw_convert_embedded_uf.thumb.height, srcWidth = ufraw_convert_embedded_uf.thumb.width; int scaleDenom = 1; srcSize(); if (ufraw_convert_embedded_uf_1) scaleDenom = srcSize; unsigned dstWidth = srcWidth / scaleDenom; unsigned dstHeight = srcHeight / scaleDenom; if (dstWidth != srcWidth || dstHeight != srcHeight) { unsigned width = dstHeight; dstHeight = dstWidth; dstWidth = width; } ufraw_convert_embedded_uf.thumb.height = dstHeight; ufraw_convert_embedded_uf.thumb.width = dstWidth; }