[PATCH] To fix PR 14093.. Internal compiler error for code when using -mhitachi option in SH

Nitin Yewale NitinY@KPITCummins.com
Tue Apr 20 07:13:00 GMT 2004


Hi,
	Kindly review the attached patch to fix bug 14093.

Regards,
Nitin Yewale.

******************************************************************
ChangeLog:
2004-04-20  Nick Clifton  <nickc@redhat.com>

	* gcc/config/sh/sh-protos.h (sh_promote_prototypes): Declared a function.
	* gcc/config/sh/sh.c (sh_promote_prototypes): Removed function declaration.
	* gcc/config/sh/sh.h: Modified macro FUNCTION_VALUE with 
	sh_promote_prototypes function.

*********************PATCH STARTS HERE********************************
Index: gcc/config/sh/sh-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sh/sh-protos.h,v
retrieving revision 1.53
diff -c -3 -p -r1.53 sh-protos.h
*** gcc/config/sh/sh-protos.h	12 Jan 2004 16:20:13 -0000	1.53
--- gcc/config/sh/sh-protos.h	14 Apr 2004 17:32:19 -0000
*************** extern rtx sh_function_arg (CUMULATIVE_A
*** 141,145 ****
--- 141,146 ----
  extern void sh_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, tree, int);
  extern int sh_pass_in_reg_p (CUMULATIVE_ARGS *, enum machine_mode, tree);
  extern const char *sh_pch_valid_p (const void *data_p, size_t sz);
+ extern bool sh_promote_prototypes (tree);
  
  #endif /* ! GCC_SH_PROTOS_H */
Index: gcc/config/sh/sh.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sh/sh.c,v
retrieving revision 1.264
diff -c -3 -p -r1.264 sh.c
*** gcc/config/sh/sh.c	6 Apr 2004 05:58:43 -0000	1.264
--- gcc/config/sh/sh.c	14 Apr 2004 17:32:29 -0000
*************** struct save_schedule_s;
*** 272,278 ****
  static struct save_entry_s *sh5_schedule_saves (HARD_REG_SET *,
  						struct save_schedule_s *, int);
  
- static bool sh_promote_prototypes (tree);
  static rtx sh_struct_value_rtx (tree, int);
  static bool sh_return_in_memory (tree, tree);
  static rtx sh_builtin_saveregs (void);
--- 272,277 ----
*************** sh_va_arg (tree valist, tree type)
*** 6352,6358 ****
    return result;
  }
  
! static bool
  sh_promote_prototypes (tree type)
  {
    if (TARGET_HITACHI)
--- 6351,6357 ----
    return result;
  }
  
! bool
  sh_promote_prototypes (tree type)
  {
    if (TARGET_HITACHI)
Index: gcc/config/sh/sh.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sh/sh.h,v
retrieving revision 1.238
diff -c -3 -p -r1.238 sh.h
*** gcc/config/sh/sh.h	24 Feb 2004 17:28:33 -0000	1.238
--- gcc/config/sh/sh.h	14 Apr 2004 17:32:33 -0000
*************** extern enum reg_class reg_class_from_let
*** 1644,1649 ****
--- 1644,1650 ----
  		 || TREE_CODE (VALTYPE) == CHAR_TYPE			\
  		 || TREE_CODE (VALTYPE) == REAL_TYPE			\
  		 || TREE_CODE (VALTYPE) == OFFSET_TYPE))		\
+              && sh_promote_prototypes (VALTYPE)				\
  	    ? (TARGET_SHMEDIA ? DImode : SImode) : TYPE_MODE (VALTYPE)), \
  	   BASE_RETURN_VALUE_REG (TYPE_MODE (VALTYPE)))
  
*********************PATCH ENDS HERE********************************** 



More information about the Gcc-patches mailing list