[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pcc-list
Subject:    Re: pcc fails to compile itself on openbsd/amd64
From:       Steve Kargl <sgk () troutmask ! apl ! washington ! edu>
Date:       2010-11-01 1:14:30
Message-ID: 20101101011430.GA65421 () troutmask ! apl ! washington ! edu
[Download RAW message or body]

On Sun, Oct 31, 2010 at 08:39:51PM +0100, Anders Magnusson wrote:
> On 10/31/2010 08:05 PM, Steve Kargl wrote:
> >On Sun, Oct 31, 2010 at 11:31:04AM -0700, Steve Kargl wrote:
> >   
> >>../../arch/amd64/local.c, line 1086: warning: conversion to 'int' from 
> >>'long' may alter its value
> >>/tmp/ctm.aLv1cg: Assembler messages:
> >>/tmp/ctm.aLv1cg:2045: Error: suffix or operands invalid for `fildll'
> >>*** Error code 1
> >>
> >>I'll try to reduce the code to a testcase.
> >>
> >>     
> >Reduced testcase.
> >
> >#include "pass1.h"
> >
> >void
> >cclocal(NODE *p)
> >{
> >    NODE *l;
> >    int o;
> >    TWORD t;
> >
> >    o = p->n_op;
> >    if (o == ICON) {
> >       CONSZ val = l->n_lval;
> >       l->n_op = FCON;
> >       l->n_dcon = val;
> >    }
> >}
> >
> >Looks like an optimization problem.
> >
> >troutmask:sgk[243] ~/work/bin/pcc -Dos_freebsd -Dmach_amd64 -I. -I../.. 
> >-I../../mip -I../../arch/amd64 -I../../os/freebsd -c -g zxc.c
> >troutmask:sgk[244] ~/work/bin/pcc -Dos_freebsd -Dmach_amd64 -I. -I../.. 
> >-I../../mip -I../../arch/amd64 -I../../os/freebsd -c -g -O2 zxc.c
> >/tmp/ctm.4ZsKel: Assembler messages:
> >/tmp/ctm.4ZsKel:573: Error: suffix or operands invalid for `fildll'
> >   
> Thanks, fixed.  fildll cannot load from general regs.
> 

With this fix, a pcc built with gcc can compile itself.  Unfortunately,
a pcc built with pcc enters an infinite loop when trying to compile
either itself again or anything else.  Attaching gdb to the ccom 
process shows that ccom is stuck at

0x000000000040769b in attr_find () at pftn.c:2858
2858    pftn.c: No such file or directory.
        in pftn.c
(gdb) bt
#0  0x000000000040769b in attr_find () at pftn.c:2858
#1  0x000000000041fa41 in fixdef () at ../../arch/amd64/local.c:1024
#2  0x0000000000402ad0 in defid () at pftn.c:441
#3  0x0000000000420e63 in bjobcode (off=-5848, typ=32767, off=-5848, typ=32767)
    at ../../arch/amd64/code.c:464
#4  0x0000000000439ff6 in main () at main.c:381
(gdb) 

-- 
Steve
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic