This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


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

gcc-3.0.3 mips structure return problem


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


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