This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: why -mhitachi gives ICE for SH-coff toolchain [gcc 3.4]
- From: "Nitin Yewale" <NitinY at KPITCummins dot com>
- To: "Jim Wilson" <wilson at specifixinc dot com>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Wed, 14 Apr 2004 17:53:23 +0530
- Subject: RE: why -mhitachi gives ICE for SH-coff toolchain [gcc 3.4]
Hi,
I was trying to add sh_promote_prototypes in FUNCTION_VALUE macro but not able to do so.
Declaration of FUNCTION_VALUE macro is as follows in sh.h file
#define FUNCTION_VALUE(VALTYPE, FUNC) \
gen_rtx (REG, \
((GET_MODE_CLASS (TYPE_MODE (VALTYPE)) == MODE_INT \
&& GET_MODE_SIZE (TYPE_MODE (VALTYPE)) < UNITS_PER_WORD \
&& (TREE_CODE (VALTYPE) == INTEGER_TYPE \
|| TREE_CODE (VALTYPE) == ENUMERAL_TYPE \
|| TREE_CODE (VALTYPE) == BOOLEAN_TYPE \
|| TREE_CODE (VALTYPE) == CHAR_TYPE \
|| TREE_CODE (VALTYPE) == REAL_TYPE \
|| TREE_CODE (VALTYPE) == OFFSET_TYPE)) \
? (TARGET_SHMEDIA ? DImode : SImode) : TYPE_MODE (VALTYPE)), \
BASE_RETURN_VALUE_REG (TYPE_MODE (VALTYPE)))
gen_rtx accepts only two parameters, I am not able to fit in the "sh_promote_prototypes" function in the same.
Apart from above if I do small change my test program then it does not gives any ICE.
Earlier foo function was returning char, now I have changed to int, so it won't give ICE.
************************************************************************************
char foo(void) | int foo(void)
{ | {
return 1; | return 1;
} | }
void bar (void) | void bar (void)
{ | {
char gc = foo(); | char gc = foo();
} | }
int main () | int main ()
{ | {
return 1; | return 1;
} | }
************************************************************************************
Any help in this issue will be appreciated.
Regards,
Nitin Yewale.
-----Original Message-----
From: Jim Wilson [mailto:wilson@specifixinc.com]
Sent: Thursday, April 08, 2004 7:29 AM
To: Nitin Yewale
Cc: gcc@gcc.gnu.org
Subject: Re: why -mhitachi gives ICE for SH-coff toolchain [gcc 3.4]
Nitin Yewale wrote:
> why -mhitachi option generates ICE [http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14093]?
> The condition which generates ICE checks for the mode of function.
Actually, it fails because the two arguments to emit_move_insn have
different modes. There is a QImode dest and a SImode source.
It appears the problem is that FUNCTION_VALUE disagrees with
TARGET_PROMOTE_FUNCTION_RETURN. One says the function result is
promoted, and the other says it isn't. Probably FUNCTION_VALUE is
wrong. It probably needs a call to sh_promote_prototypes passing in the
function type.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com