This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

xgcc fails to compile cc files under OSF 3.2


Hi
 I saw similar complains about not being able to compile 2.95.x under OSF 3.2.
What I'll describe is true for both 2.95.1 and 2.95.2.
During the compilation of any cc file xgcc failed to compile (I guess it
was still stage1 (?))  I added -fno-exceptions option to xgcc for those files 
and xgcc were able to compile them. However, cp/new1.cc requires exceptions. 
I don't know about gcc distribution but I'd like to help if I can. I think 
xgcc (or whatever internal program it calls) generates somewhat wrong assembly 
code for cc files when compiles without -fno-exceptions error. In order to show
my point I wrote the following simple file 

int somefunction()
{
 int i;
}

and saved it to a.c

$xgcc -c a.c
generated the object file.

When I saved the same code with the name a.cc (i.e. c++)

$xgcc -c a.cc
 gave the following errors

as0: Error: a.cc, line 5: undefined symbol in expression
      .long $LECIE1-$LSCIE1
as0: Error: a.cc, line 5: undefined symbol in expression
      .long $LEFDE1-$LSFDE1
as0: Error: a.cc, line 5: Symbol must have absolute value: __FRAME_BEGIN__
      .long $LSFDE1-__FRAME_BEGIN__
as0: Error: a.cc, line 5: Symbol must have absolute value: $LFB1
      .quad $LFE1-$LFB1
as0: Error: a.cc, line 5: Symbol must have absolute value: $LFB1
      .long $LCFI0-$LFB1
as0: Error: a.cc, line 5: Symbol must have absolute value: $LCFI0
      .long $LCFI1-$LCFI0
as0: Error: a.cc, line 5: Symbol must have absolute value: $LCFI1
      .long $LCFI2-$LCFI1
as0: Error: a.cc, line 5: Symbol must have absolute value: $LCFI2
      .long $LCFI3-$LCFI2

when I compiled with 
$xgcc -fno-exceptions -c a.cc 
it compiles.

The assembly code generated for -fno-exceptions is

        .verstamp 3 11
        .set noreorder
        .set volatile
        .set noat
        .file   1 "a.cc"
.text
        .align 5
        .globl somefunction__Fv
        .ent somefunction__Fv
somefunction__Fv:
        .frame $15,32,$26,0
        .mask 0x4008000,-32
$somefunction__Fv..ng:
        lda $30,-32($30)
        stq $26,0($30)
        stq $15,8($30)
        mov $30,$15
        .prologue 0
        br $31,$L3
        br $31,$L2
$L3:
$L2:
        mov $15,$30

        ldq $26,0($30)
        ldq $15,8($30)
        lda $30,32($30)
        ret $31,($26),1
        .end somefunction__Fv

The assembly code generated for exceptions is the following.
Please notice that the complains of as0 are true since 
  .long $VAR1-$VAR2 lines refer to the variables declared a few lines later.
Also there are lines like 
__FRAME_BEGIN__:
which do not exists on the no-exception case. So I believe without
-fno-exceptions flag, the generated asm code is not for OSF 3.2 but
maybe Digital Unix 4.0 or maybe there are some options that has to be set.
 I would like to work on the problem if the solution is not obvious. However 
I'm not familier with gcc code. If you show me some pointers to start with
(like where the asm code is generated) I appriciate it.
Thanks a lot
burchan




        .verstamp 3 11
        .set noreorder
        .set volatile
        .set noat
        .file   1 "a.cc"
.text
        .align 5
        .globl somefunction__Fv
        .ent somefunction__Fv
somefunction__Fv:
        .frame $15,32,$26,0
        .mask 0x4008000,-32
$somefunction__Fv..ng:
$LFB1:
        lda $30,-32($30)
$LCFI0:
        stq $26,0($30)
$LCFI1:
        stq $15,8($30)
$LCFI2:
        mov $30,$15
$LCFI3:
        .prologue 0
        br $31,$L3
        br $31,$L2
$L3:
$L2:
        mov $15,$30
        ldq $26,0($30)
        ldq $15,8($30)
        lda $30,32($30)
        ret $31,($26),1
$LFE1:
        .end somefunction__Fv

.data
        .align 3
        .globl _GLOBAL_$F$somefunction__Fv
_GLOBAL_$F$somefunction__Fv:
__FRAME_BEGIN__:
        .align 0
        .long   $LECIE1-$LSCIE1
$LSCIE1:
        .align 0
        .long   0x0
        .byte   0x1
        .byte   0x0
        .byte   0x1
        .byte   0x78
        .byte   0x40
        .byte   0xc
        .byte   0x1e
        .byte   0x0
        .byte   0x9
        .byte   0x40
        .byte   0x1a
        .align 3
$LECIE1:
        .align 0
        .long   $LEFDE1-$LSFDE1
$LSFDE1:
        .align 0
        .long   $LSFDE1-__FRAME_BEGIN__
        .align 0
        .quad   $LFB1
        .quad   $LFB1
        .align 0
        .quad   $LFE1-$LFB1
        .byte   0x4
        .align 0
        .long   $LCFI0-$LFB1
        .byte   0xe
        .byte   0x20
        .byte   0x4
        .align 0
        .long   $LCFI1-$LCFI0
        .byte   0x9a
        .byte   0x4
        .byte   0x4
        .align 0
        .long   $LCFI2-$LCFI1
        .byte   0x8f
        .byte   0x3
        .byte   0x4
        .align 0
        .long   $LCFI3-$LCFI2
        .byte   0xc
        .byte   0xf
        .byte   0x20
        .align 3
$LEFDE1:
        .align 0
        .long   0x0




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]