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]

In m68k, FUNCTION_VALUE macro don't work???



Hello:

    I am working on modifing gcc for 68000.
    I want to change return value of function =>
           if return value size  > 4bytes , then put return value in memory and put address in A1.
           if return value size < 4bytes , then put return value in D0.
    
    Ok. I use two macro=> RETURN_IN_MEMORY and FUNCTION_VALUE
     #undef RETURN_IN_MEMORY
     #define RETURN_IN_MEMORY(type)                                  \
                  ((TYPE_MODE (type) == BLKmode)                      \
                    || AGGREGATE_TYPE_P (type)                            \
                    || (int_size_in_bytes (type) > 4))

     #undef FUNCTION_VALUE
     #define FUNCTION_VALUE (VALTYPE, FUNC)		\
           gen_rtx (REG, TYPE_MODE (VALTYPE),		\
                         (int_size_in_bytes (type) > 4) ? 9 : 0)

     Now, PROBLEMS comes.
     It doesn't work.
     I check FUNCTION_VALUE's VALTYPE, it is always 4-bytes and SImode.
     I can't fininsh the work.
     What is worng during the modification?
     How to do it?
     Thanks very much. Thanks your help.

							Ps. Chen

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