On 10/13/2015 04:50 PM, Chen Gang wrote:
OK, under the bugzilla, the maintainer treated it as expected behavior
(not a bug). For me, we need more explanation for it (why we treat it
as expected behavior).
A global register is under control of the user. If the compiler uses it
as a frame pointer, it will get clobbered outside the user's control,
which is unexpected behaviour. Therefore, the code Mike quoted detects
that case and issues an error, indicating that you must use
-fomit-frame-pointer if you expect to use the frame pointer register for
other purposes.
If you want an address on the stack there's __builtin_frame_address
which may or may not do what was intended. The code quoted in the
bugzilla is just invalid.
to `fix it’, one would simple remove this chunk as misguided and fix up any
code gen issues exposed.
If there were not only one issues related with it, for me, what you said
sounds reasonable to me.
That's totally the wrong thing to do as the issue is not compiler code
generation, it's the danger of clobbering a user variable.
Bernd