both gave the buggy output if -O optimization is enabled
Yeah ... I should've thought of testing that. I see the same - and I'll report it to gcc bugzilla tonight.
Thanks to all.
UPDATE: Bug report is at
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80692
Cheers,
Rob