🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #135

gcc 2.2.2 for the hp700 series generates incorrect assembler code.

#135
From: Michial Gunter
Date: Fri, 31 Jul 1992 03:33
40 lines
2025 bytes
The problem is that the "pa.h" config file defines ASM_DECLARE_FUNCTION_NAME
such that an argument of type double in the fourth position will result in 
generation of ARGW4 --- which is incorrect. (See below.)

I'll leave the fix to those more knowledgable.

		thanks,
		mike

P.S. I would like to be send any patch via e-mail, if possible.


#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
    do { tree fntype = DECL_RESULT (DECL);	 			\
	 tree tree_type = TREE_TYPE (DECL);				\
	 tree parm;							\
	 int i;								\
	 if (TREE_PUBLIC (DECL))					\
	   {								\
	     fputs ("\t.EXPORT ", FILE); assemble_name (FILE, NAME);	\
	     fputs (",PRIV_LEV=3", FILE);				\
	     for (parm = DECL_ARGUMENTS (DECL), i = 0; parm && i < 4;	\
--->							       ^^^^^
		  parm = TREE_CHAIN (parm))				\
	       {							\
		 if (TYPE_MODE (DECL_ARG_TYPE (parm)) == SFmode)	\
		   fprintf (FILE, ",ARGW%d=FR", i++);			\
		 else if (TYPE_MODE (DECL_ARG_TYPE (parm)) == DFmode)	\
		   {							\
		      if (i == 1) i++;				        \
		      ASM_DOUBLE_ARG_DESCRIPTORS (FILE, i++, i++);	\
--->							^^^  ^^^
			   }							\
		etc.




gcc version 2.2.2
 /usr/unsupported/lib/gcc-lib/hp720-hpux/2.2.2/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -Dhppa -Dhp9000s800 -D__hp9000s800 -Dhp9k8 -DPWB-Dhpux -Dunix -D_HPUX_SOURCE -D__hppa__ -D__hp9000s800__ -D__hp9000s800 -D__hp9k8__ -D__PWB__ -D__hpux__ -D__unix__ -D___HPUX_SOURCE__ -D__hppa -D__hp9000s800 -D__hp9000s800 -D__hp9k8 -D__PWB -D__hpux -D__unix -D___HPUX_SOURCE
Technical Details
Message-ID: <GUNTER.92Jul30193352@mayhem.Berkeley.EDU>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!mayhem.berkeley.edu!gunter

Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!mayhem.berkeley.edu!gunter
From: gunter@mayhem.berkeley.edu (Michial Gunter)
Subject: gcc 2.2.2 for the hp700 series generates incorrect assembler code.
Message-ID: <GUNTER.92Jul30193352@mayhem.Berkeley.EDU>
Sender: gnulists@ai.mit.edu
Organization: /users/gunter/.organization
Distribution: gnu
Date: Fri, 31 Jul 1992 03:33:52 GMT
Approved: bug-g++@prep.ai.mit.edu
Lines: 43