This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Stack parameter - pass by value - frame usage




Ian Lance Taylor wrote:
Hariharan Sandanagobalane <hariharans@picochip.com> writes:

I looked at an inefficient code sequence for a simple program using
GCC's picochip port (not yet submitted to mainline).

Are you working with mainline sources?

I was not. I tried the same with gcc 4.3 branch and it does fix most of the problems. There are still corner cases where it produces unoptimal code. I will try to figure out whats wrong in those and get back to you.


Regards
Hari


Note that the parameter is being written to the frame in the last 2
instructions above. This, i am guessing is the reason for the
get_frame_size() returning 4 later on, though the actual save of the
struct parameter value on the stack is being eliminated at later
optimization phases (CSE and DCE, i believe).

Why does the compiler do this? I vaguely remember x86 storing all
parameter values on stack. Is that the reason for this behaviour? Is
there anything i can do in the port to get around this problem?

At a guess, it's because the frontend decided that the struct was addressable and needed to be pushed on the stack. I thought this got cleaned up recently, though.

Ian
This email and any files transmitted with it are confidential and intended solely for the use of the individuals to whom they are addressed. If you have received this email in error please notify the sender and delete the message from your system immediately.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]