Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: stack.c 7246 2007-01-29 18:49:05Z twisti $
+ $Id: stack.c 7420 2007-02-28 22:30:31Z edwin $
*/
} while (sd.repeat && !deadcode);
- /* reset locals of TYPE_RET to TYPE_ADR */
+ /* reset locals of TYPE_RET|VOID to TYPE_ADR */
+
+ /* A local variable may be used as both a returnAddress and a reference */
+ /* type variable, as we do not split variables between these types when */
+ /* renaming locals. While returnAddresses have been eliminated now, we */
+ /* must assume that the variable is still used as TYPE_ADR. */
+ /* The only way that a local can be TYPE_VOID at this point, is that it */
+ /* was a TYPE_RET variable for which incompatible returnAddresses were */
+ /* merged. Thus we must treat TYPE_VOID in the same way as TYPE_RET */
+ /* here. */
+ /* XXX: It would be nice to remove otherwise unused returnAddress */
+ /* variables from the local variable array, so they are not */
+ /* allocated by simplereg. (For LSRA this is not needed). */
for (i=0; i<sd.localcount; ++i) {
- if (sd.var[i].type == TYPE_RET)
+ if (sd.var[i].type == TYPE_RET || sd.var[i].type == TYPE_VOID)
sd.var[i].type = TYPE_ADR;
}