From: jer@mcnc.org (John E. Rose)
Subject: gcc-2.1 on HP9000/750
Organization: GNUs Not Usenet
Distribution: gnu
Date: Mon, 6 Apr 1992 12:30:22 GMT

Here are the diffs for things I had to do to get gcc-2.1 running on our
HP9000/750.
I put in the ``ifdef''s as __hp9000s800 at the suggestion of my system
administrator, and because it saved me from having to set up new configuration
files.
This is my first attempt at this sort of thing, so there might be better ways
to do some of these fixes, but it should at least provide a starting point
for those who know what they are doing.

===============================================================================

collect2.c:

These changes mostly involve the stdarg/varargs macros as implemented for gcc.

gcc-2.1/collect2.c gcc-new/collect2.c
186a187,189
> #ifdef __hp9000s800
> extern pid_t   vfork ();
> #else
187a191
> #endif
298a303,306
> #ifdef __hp9000s800
> typedef double * hp_va_list; /* for (casts) below */
> #endif
> 
306a315,317
> #ifdef __hp9000s800
>   vfprintf (stderr, string, (hp_va_list) vptr.__va_int);
> #else
307a319
> #endif
321a334,336
> #ifdef __hp9000s800
>   vfprintf (stderr, string, (hp_va_list) vptr.__va_int);
> #else
322a338
> #endif
336a353,355
> #ifdef __hp9000s800
>   vfprintf (stderr, string, (hp_va_list) vptr.__va_int);
> #else
337a357
> #endif

===============================================================================

config/hp800hpux.h (tm.h):

gcc-2.1/config/hp800hpux.h gcc-new/config/hp800hpux.h
14a15
> #define HAVE_ATEXIT

===============================================================================

toplev.c:

This code was inserted after the code which sets flag_no_inline = 0 when
``-finline'' is used.
This code is also at line 2565.

gcc-2.1/toplev.c gcc-new/toplev.c
2952,2959d2951
<   /* Inlining does not work if not optimizing,
<      so force it not to be done.  */
<   if (optimize == 0)
<     {
<       flag_no_inline = 1;
<       warn_inline = 0;
<     }
< 

===============================================================================

varasm.c:

Some calls to ASM_GLOBALIZE_LABEL are inside CODE spaces, so the exported
name was getting the HP default attribute of ``CODE''.
This makes sure that variables are declared as ``DATA''.
I don't think this can be done by redefining ASM_GLOBALIZE_LABEL because it
does not take ``decl'' as an argument (TREE_CODE(decl) could then be used to
determine if the decl is a VAR_DECL, and hence would need the ``,DATA'').

gcc-2.1/varasm.c gcc-new/varasm.c
843a844,849
> #if __hp9000s800
> 	{ fputs ("\t.EXPORT ", asm_out_file);
> 	  assemble_name (asm_out_file, name);
> 	  fputs (",DATA\n", asm_out_file);
> 	}
> #else
844a851
> #endif

===============================================================================

config/hp800.h:

This problme is the IMPORT counterpart to the previous EXPORT problem.
The test for ``! TREE_READONLY (DECL)'' was causing some variables (DATA) to be
declared as CODE.

gcc-2.1/config/hp800.h gcc-new/config/hp800.h
1413c1413
<        if (TREE_CODE (DECL) == VAR_DECL && ! TREE_READONLY (DECL))     	\
---
>        if (TREE_CODE (DECL) == VAR_DECL)		     	\

===============================================================================

hp800.md (md):

This change fixes the problem where gcc gets an ``unrecognized insn'' when
compiling toplev.c with CC=stage1/gcc.
I'm not really sure why this works, or what other problems it will cause,
although I haven't found any yet.

gcc-2.1/hp800.md gcc-new/hp800.md
1308c1308
<    (set (reg:SI 25) (match_operand:SI 2 "general_operand" ""))
---
>    (set (reg:SI 25) (match_operand:SI 2 "register_operand" "r"))

===============================================================================


Newsgroups: gnu.gcc.bug