gcc-3.0.3 mips structure return problem

Rainer Keuchel keuchel@netwave.de
Sun Feb 3 22:51:00 GMT 2002


Anyone also had this problem with mips or did I misconfigure?

The following code produced an abort in emit_move_ins()
where QImode != SImode. 

struct st
{
  unsigned char x;
};

struct st
f1()
{
  struct st st;
  st.x = 1;
  return st;
}

I had to redefine RETURN_IN_MEMORY from 

#define RETURN_IN_MEMORY(TYPE)	\
  (TYPE_MODE (TYPE) == BLKmode)

to

#define RETURN_IN_MEMORY(TYPE)	\
  (TYPE_MODE (TYPE) == BLKmode || TREE_CODE(TYPE) == RECORD_TYPE)

BTW: -fpcc-struct-return did not fix it.

I had a similar problem in calls.c where
the function return type should have been promoted from
QImode to SImode for a recordtype, which failed
because promote_mode() does not handle records types
and does not call PROMOTE_MODE.



------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com



More information about the crossgcc mailing list