Description of problem: on the testcase below gcc gives the above #!/bin/sh cat >a.c <<'EOF' struct foo {char x, y, z[2];}; struct foo f(); void bar(int baz) { f().z[baz] = 1; } EOF gcc -S -ansi -freg-struct-return -Wall a.c run the above and watch a.c: In function `bar': a.c:5: Internal compiler error in expand_assignment, at expr.c:3450 Please submit a full bug report. See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions. gcc -v output: gcc version 2.96 20000731 (Red Hat Linux 7.2 2.96-112.7.2)
Indeed, the problem persists through to current mainline. It appears that -freg-struct-return Just Doesn't Work.
gcc 2.96 is too old now. Its release cycle was finished long ago. Therefore I am closing the case. If it is still important, we could reopen it.
Um, Vlad, my comment from just yesterday indicates that the problem is still present in gcc 4.0. Whether or not the proper resolution of this bug is to remove the code for -freg-struct-return, since I suspect that it hasn't worked in a very long time, is another issue.
Pushed upstream to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17855