g++/i386: 4-byte inline struct return

Martin von Loewis martin@mira.isdn.cs.tu-berlin.de
Thu Sep 17 22:12:00 GMT 1998

> I tried every single trick I could think off to make "foo a = bar(1)" as
> efficient as "long a = 1". I think the problem has to with struct returns
> because when I substitute "struct foo.." with "typedef long foo" I get the
> expected code. Can somebody please work on this?


It might be that somebody steps forward and says 'I've been waiting
all the time to fix this, now it is the time'. In this case, ignore
my comments.

More likely, nothing will happen. There are some serious bugs in gcc
(especially in the non-C front-ends), a lot of missing features, and a
huge amount of missed optimization opportunities.

So if you *really* need this to generate efficient code, why don't you
just look into this and find out how to optimize it better.

Apparently, the problem is that ebp-4 is not used in the function
after it is written, so the write operation could be ignored. Finding
a good generalization of the situation, and implementing it reliably
would surely be appreciated by many. OTOH, if you don't do it, maybe
nobody else will.


More information about the Gcc mailing list