------- Comment #5 from sandra at codesourcery dot com 2008-04-30 20:17 ------- Here's another testcase for the same bug, or one closely related to it:
#include <stdio.h> unsigned x = 8; unsigned *addr() { return &x; } int main() { x = 4; *addr() = *addr() / 2; printf ("*addr() = %d, x = %d\n", *addr(), x); return 0; } I've determined that both this test case and the original one reported with this issue were fixed on mainline by the commit r119502, this patch: http://gcc.gnu.org/ml/gcc-patches/2006-12/msg00225.html I'm not familiar enough with this code (yet!) to be able to tell whether this was a lurking bug fixed by that patch, or whether it is a lurking bug that was merely obscured by that patch and is still present on mainline. -- sandra at codesourcery dot com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sandra at codesourcery dot | |com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34363