----- Ursprüngliche Nachricht ----- Von: Peter Bigot Gesendet am: 30 Mrz 2011 18:30:31
> SF 3260589 proposes that uniarch mspgcc change the value of r4 when used as > a frame pointer to be value [A] described below. Please provide comments on > this change. This is probably only relevant to you if you believe you need > to decode frame contents in your code. Which is true for functions like printf which use stack parameters (or even forward them to other functions, like the different printf variants do). > [A] and [B] are different for interrupts. yes, but then, MSPGCC usually knows that it is in an interrupt function. And for modifying the saved SR there's already an intrinsic. > mspgcc puts the frame pointer in r4 when it's used, but gcc eliminates the > use by substituting references based on sp where possible. And this badly corrupts the code if you 1) try to save the status register, clear GIE, do somethign that includes access to local variables and then restore SR. Between the push and pop, all local variables are accessed wrong. (Workaround: I use a global counter that is incremented and decremented by a macro surrounding the critical section, and only set GIE again if the counter reaches zero. Any better ideas?) 2) have a function with parameters passed on stack and local variables that won't fit into registers completely. Then everything is messed-up. At least on mspgcc3 up to the latest version. (Workaround: don't do such functions) JMGross ------------------------------------------------------------------------------ Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf _______________________________________________ Mspgcc-users mailing list Mspgcc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mspgcc-users