🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #5940

m68k-hp-hpux & long long

#5940
From: Walter Misar
Date: Wed, 08 Jan 1997 00:00
53 lines
2275 bytes
"long long" is broken on m68k-hp-hpux for gcc 2.7.x (it worked for 2.6.x).

This short testprogram (compiled without further options) demonstrates the
problem (it prints 17 instead of 21):
-----------------------------------------------------------------------------
#include <stdio.h>

long long add(long long x, long long y)
{ return x+y;
}

int main()
{ long long a, b;

  a=17;
  b=4;

  printf("%d\n", (long)add(a,b));
}
-----------------------------------------------------------------------------

The problem is, that print_operand was changed in m68k.c, but hp320.h
uses an own version, which wasn't changed. A diff for hp320.h (against
the 2.7.2.1 version of config/m68k/hp320.h) which corrects the problem is
included below, but crds.h, news.h and tower-as.h should probably modified
in a similar way (they redefine PRINT_OPERAND too).

	Walter

*** hp320.h.old	Wed Jan  8 21:27:19 1997
--- hp320.h	Wed Jan  8 21:40:26 1997
***************
*** 362,368 ****
    else if (CODE == '/')							\
      fprintf (FILE, "%%");						\
    else if (GET_CODE (X) == REG)						\
!     fprintf (FILE, "%s", reg_names[REGNO (X)]);				\
    else if (GET_CODE (X) == MEM)						\
      output_address (XEXP (X, 0));					\
    else if (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) == SFmode)	\
--- 362,372 ----
    else if (CODE == '/')							\
      fprintf (FILE, "%%");						\
    else if (GET_CODE (X) == REG)						\
!   { if (CODE == 'R')							\
!       fprintf (FILE, "%s", reg_names[REGNO (X) + 1]);			\
!     else								\
!       fprintf (FILE, "%s", reg_names[REGNO (X)]);			\
!   }									\
    else if (GET_CODE (X) == MEM)						\
      output_address (XEXP (X, 0));					\
    else if (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) == SFmode)	\
Technical Details
Message-ID: <199701082139.QAA13877@gnu-life.ai.mit.edu>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 113d02,e33a2222cbbcc232,start
X-Google-Attributes: gid113d02,public
From: misar@rbg.informatik.th-darmstadt.de (Walter Misar)
Subject: m68k-hp-hpux & long long
Date: 1997/01/08
Message-ID: <199701082139.QAA13877@gnu-life.ai.mit.edu>
X-Deja-AN: 208514752
sender: bug-gcc-request@prep.ai.mit.edu
x-gateway: relay2.UU.NET from bug-gcc to gnu.gcc.bug; Wed, 8 Jan 1997 16:39:44 EST
newsgroups: gnu.gcc.bug