assembler problem with gcc on Pyramid

mr c.m. greif rdt201x at monu6.cc.monash.edu.au
Sun Aug 5 13:40:45 AEST 1990


I have come across the problem of gcc (1.37.1) generating assembler
code that the pyramid as (5.0e) rejects.
The same assembler file does not upset the as (4.1) assembler

Can anyone give me some advice?

Thanks in advance
Simon Hill,
Robotics and Digital Technology,
Monash University, P.O Box 197, Caulfield East, VIC 3145 AUSTRALIA
Phone: 61-3-573-2092  Fax: 61-3-573-2745 INET: sdh at monu6.cc.monash.edu.au

Script started on Sun Aug  5 13:05:07 1990
$ name
name: Machine is Pyramid-MIS/2 
    OS is OSx200DNQ 
    node name is monu6 
$ ln trial_gcc.c trial_cc.c
$ cat trial_gcc.c
#include <stdio.h>
#include <strings.h>

typedef struct item
{ float scl;              /* signed scale factor for this element */
  char* sym;              /* comma-separated character string */
  struct item* nxt;       /* pointer to next item in list */
} item ;

/*
  Returns the number of characters required to print the entry's
  symbol and scalar.
*/
unsigned int
entry_width(it)
  item* it; 
{ unsigned int width;

  width = (unsigned)strlen(it->sym);
  if(width == 1) /* an empty symbol has one DELIM in it */
  { /* set the width for items with empty symbols */
    switch ((int)it->scl)  
    { case 0:
      /* skip over intermediate zeros,
         only set the width when 0 is the last item */
        if(it->nxt == NULL) width = 1;
        else width = 0;
        break;
      case 1:
      case -1:
        width = 2;
        break;
      default:
        abandon("(%s): bad value of it->scl: %f, %d",
	        __FILE__, it->scl,(int)it->scl);
    }
  }
  else
  { /* increment width for the sign */
    width++;
    /* subtract out the number of DELIMs */
    width -= str_nu_tokens(it->sym);
  }
  if(it->nxt != NULL)            /* not at end of entry list */
  { width += entry_width(it->nxt);  /* add the width of the next item */
  }
  return(width);
} /* end of entry_width() */
$ gcc -v -c -S trial_gcc.c
gcc version 1.37.1
 /rdt/rdt/rdt201x/lib/gcc-cpp -v -undef -D__GNUC__ -Dpyr -Dunix -D__pyr__ -D__unix__ trial_gcc.c /usr/tmp/cc001775.cpp
GNU CPP version 1.37.1
 /rdt/rdt/rdt201x/lib/gcc-cc1 /usr/tmp/cc001775.cpp -quiet -dumpbase trial_gcc.c -version -o trial_gcc.s
GNU C version 1.37.1 (pyr) compiled by CC.
default target switches: -munix -mindex -mgnu-stdarg
$ strings /bin/as |fgrep AS_
@(#)AS_5.0e
$ as trial_gcc.s
as:
line 21: operands clobber for this op on isis
as:
line 50: operands clobber for this op on isis
as:
line 52: operands clobber for this op on isis
$ cat trial_gcc.s
gcc_compiled.:
.text
        .align 2
LC0:
        .ascii "(%s): bad value of it->scl: %f, %d\0"
        .align 2
LC1:
        .ascii "trial_gcc.c\0"
        .align 2
.globl _entry_width
_entry_width:
        adsf $8
        movw pr0,-4(cfp)
        movw -4(cfp),pr0
        movw 4(pr0),tr0
        call _strlen
        movw tr0,-8(cfp)
        cmpw $1,tr0
        bne L1
        movw -4(cfp),pr0
        cvtfw (pr0),pr0
        mtstw pr0,pr0
        beq L3
        mtstw pr0,pr0
        bgt L10
        cmpw $-1,pr0
        beq L7
        br L8
L10:
        cmpw $1,pr0
        beq L6
        br L8
L3:
        movw -4(cfp),pr0
        movw 8(pr0),pr0
        mtstw pr0,pr0
        bne L4
        movw $1,-8(cfp)
        br L5
L4:
        movw $0,-8(cfp)
L5:
        br L2
L6:
L7:
        movw $2,-8(cfp)
        br L2
L8:
        movw -4(cfp),pr0
        cvtfd (pr0),pr0
        movw -4(cfp),pr2
        cvtfw (pr2),pr2
        movw $LC0,tr0
        movw $LC1,tr1
        movl pr0,tr2
        movw pr2,tr4
        call _abandon
L2:
        br L11
L1:
        movw -8(cfp),pr0
        movw -8(cfp),pr0
        addw $1,pr0
        movw pr0,-8(cfp)
        movw -4(cfp),pr0
        movw 4(pr0),tr0
        call _str_nu_tokens
        movw tr0,pr0
        rsubw -8(cfp),pr0
        movw pr0,-8(cfp)
L11:
        movw -4(cfp),pr0
        movw 8(pr0),pr0
        mtstw pr0,pr0
        beq L12
        movw -4(cfp),pr0
        movw 8(pr0),tr0
        call _entry_width
        movw tr0,pr0
        movw -8(cfp),pr1
        mova (pr0)[pr1*1],pr0
        movw pr0,-8(cfp)
L12:
        movw -8(cfp),pr0
        retd $0
        retd $0
$ cc -g -v -S trial_cc.c
$ as trial_cc.s
$ cat trial_cc.s
        .stabs  "trial_cc.c",0x64,0x0,0x0,L13
L13:
        .data   0
        .stabs  "_cnt",0x60,0x0,0x4,0x0
        .stabs  "_cnt",0xfe,0x1,0x0,0x4
        .stabs  "_ptr",0x60,0x0,0x12,0x4
        .stabs  "_ptr",0xfe,0x1,0x0,0x4
        .stabs  "_base",0x60,0x0,0x12,0x8
        .stabs  "_base",0xfe,0x1,0x0,0x4
        .stabs  "_bufsiz",0x60,0x0,0x4,0xc
        .stabs  "_bufsiz",0xfe,0x1,0x0,0x4
        .stabs  "_flag",0x60,0x0,0x3,0x10
        .stabs  "_flag",0xfe,0x1,0x0,0x2
        .stabs  "_file",0x60,0x0,0x2,0x12
        .stabs  "_file",0xfe,0x1,0x0,0x1
        .stabs  "_iobuf",0x20,0x0,0x8,0x0
        .stabs  "_iobuf",0xfe,0x1,0x0,0x14
        .stabs  "_iob",0x20,0x0,0x38,0x0
        .stabs  "_iob",0xfe,0x1,0x0,0x14
        .stabs  "scl",0x60,0x0,0x6,0x0
        .stabs  "scl",0xfe,0x1,0x0,0x4
        .stabs  "sym",0x60,0x0,0x12,0x4
        .stabs  "sym",0xfe,0x1,0x0,0x4
        .stabs  "nxt",0x60,0x0,0x18,0x8
        .stabs  "nxt",0xfe,0x1,0x0,0x4
        .stabs  "item",0x20,0x0,0x8,0x0
        .stabs  "item",0xfe,0x1,0x0,0xc
        .stabs  "item",0x20,0x0,0x8,0x0
        .stabs  "item",0xfe,0x1,0x0,0xc
        .data   1
        .align  2
L23:
        .string "(%s): bad value of it->scl: %f, %d"
        .align  2
L24:
        .string "trial_cc.c"
        .text   0
        .stabs  "entry_width",0x24,0x0,0xf,L14
        .globl  _entry_width
_entry_width:
L14:
        .stabs  "it",0x40,0x0,0x18,0x10
        .stabs  "it",0xfe,0x1,0x0,0x4
        .stabn  0x44,0x0,0xf,L14
        .stabd  0x44,0x0,0x11
        .stabs  "width",0x40,0x0,0xe,0x20
        .stabs  "width",0xfe,0x1,0x0,0x4
        .stabd  0xc0,0x0,0x2
        .stabd  0x44,0x0,0x13
        movw    0x4(pr0),tr0
        call    _strlen
        movw    tr0,lr0
        .stabd  0x44,0x0,0x14
        ucmpw   $0x1,lr0
        bne     L15
        .stabd  0x44,0x0,0x15
        .stabd  0xc0,0x0,0x3
        .stabd  0x44,0x0,0x16
        cvtfw   (pr0),tr0
        cmpw    $0xffffffff,tr0
        blt     L22
        cmpw    $0x1,tr0
        bgt     L22
        movw    L25+0x4[tr0*0x4],tr0
        jump    (tr0)
        .data   0
        .align  2
L25:
        .word   L21
        .word   L17
        .word   L20
        .text   0
        .stabd  0x44,0x0,0x17
        .stabd  0xc0,0x0,0x4
L17:
        .stabd  0x44,0x0,0x1a
        mtstw   0x8(pr0),tr0
        bne     L18
        movw    $0x1,lr0
        br      L19
L18:
        .stabd  0x44,0x0,0x1b
        movw    $0x0,lr0
L19:
        .stabd  0x44,0x0,0x1c
        br      L16
        .stabd  0x44,0x0,0x1d
L20:
        .stabd  0x44,0x0,0x1e
L21:
        .stabd  0x44,0x0,0x1f
        movw    $0x2,lr0
        .stabd  0x44,0x0,0x20
        br      L16
        .stabd  0x44,0x0,0x21
L22:
        .stabd  0x44,0x0,0x23
        cvtfd   (pr0),tr2
        cvtfw   (pr0),tr4
        movw    $L23,tr0
        movw    $L24,tr1
        call    _abandon
        .stabd  0x44,0x0,0x24
        .stabd  0xe0,0x0,0x4
L16:
        .stabd  0x44,0x0,0x25
        .stabd  0xe0,0x0,0x3
        br      L26
L15:
        .stabd  0x44,0x0,0x27
        .stabd  0xc0,0x0,0x3
        .stabd  0x44,0x0,0x28
        addw    $0x1,lr0
        .stabd  0x44,0x0,0x2a
        movw    0x4(pr0),tr0
        call    _str_nu_tokens
        subw    tr0,lr0
        .stabd  0x44,0x0,0x2b
        .stabd  0xe0,0x0,0x3
L26:
        .stabd  0x44,0x0,0x2c
        mtstw   0x8(pr0),tr0
        beq     L27
        .stabd  0x44,0x0,0x2d
        .stabd  0xc0,0x0,0x3
        movw    0x8(pr0),tr0
        call    _entry_width
        addw    tr0,lr0
        .stabd  0x44,0x0,0x2e
        .stabd  0xe0,0x0,0x3
L27:
        .stabd  0x44,0x0,0x2f
        movw    lr0,pr0
        ret     
        .stabd  0x44,0x0,0x30
        .stabd  0xe0,0x0,0x2
        ret     
$
script done on Sun Aug  5 13:06:53 1990

The assembler file trial_gcc.s is then ftp'd to a machine running
as (4.1) and assembles ok.

Script started on Sun Aug  5 13:16:21 1990
% name
name: Machine is Pyramid-9820 
    OS is OSx65MN 
    node name is bruce 
% as trial_gcc.s
% strings /bin/as |fgrep AS_
@(#)AS_4.1
% 
script done on Sun Aug  5 13:17:54 1990



More information about the Comp.sys.pyramid mailing list