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]

Re: call_value pattern



Actually, I think there's something wrong if the mode of operand[0] 
is not right.

My guess would be that you haven't defined the FUNCTION_VALUE macro correctly.

Note, that if your machine is BIG_ENDIAN and sizeof(int) is larger 
than UNITS_PER_WORD,
you need a special hack for functions returning a char.  [it took me 
entirely too long
to realize this....]

-- Al


At 5:23 PM +0100 1/24/01, James Montgomerie wrote:

>David Korn wrote:
>
>>>-----Original Message-----
>>>From: James Montgomerie [mailto:jrmg@dcs.ed.ac.uk]
>>>Sent: 24 January 2001 11:18
>>
>>
>>
>>>I am in the process of porting GCC to an architecture on which I need to
>>>know the machine mode of the return value of a call inside the code
>>>generated by the call_value instruction pattern.  Testing the mode of the
>>>register passed as operand 0 does not seem to work (it returns the wrong
>>>mode, presumably because it hasn't actually been used yet), and I'm at a
>>>loss to think of another way.  Can anyone point me in the correct
>>>direction?
>>
>>
>>   I'm new to Gcc coding, so this answer might be wrong.  If that is the
>>case,
>>I expect someone more knowledgeable than me will correct my mistake and
>>we'll both have learnt something.  Anyway, my first thought on how to deal
>>with this would be to look up the name of the SYM_REF, find the DECL for
>>the function, and look at it's return type.
>>
>>   Was that even close, anybody ?
>
>Sounds like a good plan to me - then again, I am the person who 
>couldn't figure out how to do it in the first place :-)
>
>My only concern is that your suggestion could tie me to the C/C++ 
>front end.  Is this the case, or I simply being confused by the 
>title of the document describing the internal representation tree 
>being "C/C++ Internal Representation"?
>
>Jamie.

-- 
------------------------------------------------------------------------

		    Quality Software Management
		http://www.tiac.net/users/qsmgmt
			apl@alum.mit.edu
			(978)287-0435 Voice
			(978)808-6836 Cell
			(978)287-0436 Fax

	Software Process Improvement and Management Consulting
	     Language Design and Compiler Implementation

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