Skip to contentSkip to conversation

[Linux-ia64] [[email protected]: Re: Strange problems building bigloo on ia64]

Linux-ia64 Matthew Wilcox 3 participants 3 messages May 19, 2003

lore
Share & tools
lore
#0 lore raw

I don't grok ia64 asm enough to answer his question...

----- Forwarded message from Christian Hinkelbein <[email protected]> -----

Date: Mon, 19 May 2003 10:21:04 +0200
From: Christian Hinkelbein <[email protected]>
To: Yann Dirson <[email protected]>
Cc: [email protected],
Manuel Serrano <[email protected]>
Subject: Re: Strange problems building bigloo on ia64

Hi,

Quoted 9 lines · Yann Dirson

Hi ia64 porters,

#193608 already reports that there are 64bit issues on this package, but I see in the logs a lot of messages which make me suspect some gcc problem:

/tmp/ccnfO17g.s: Assembler messages:
/tmp/ccnfO17g.s:958: Warning: Use of 'mov' may violate WAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 14

i see some similary warnings when compiling following with gcc3.2 and binutils 2.12

//-----------
// waw.c
int sh;

int f(int s)
{
int test = sh;

if(s)

    return (test = 1) ? 0:(13);
  else
    return (test = 2) ? 0:(13);
}

//-----------

~/src/ia64 > gcc -c -O3 waw.c
/tmp/cchXUlJF.s: Assembler messages:
/tmp/cchXUlJF.s:27: Warning: Use of 'addl' may violate WAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 8 /tmp/cchXUlJF.s:27: Warning: Only the first path encountering the conflict is reported
/tmp/cchXUlJF.s:25: Warning: This is the location of the conflicting usage ~/src/ia64 >

This only occurs when using option -O3 to gcc.
This looks like beeing an assembler problem, not one from gcc. Also, when looking into the assembler output, i could not find an error:

        .file   "waw.c"
        .pred.safe_across_calls p1-p5,p16-p63
        .text
        .align 16
        .global f#
        .proc f#
f:
        .prologue
        .body
        .mii
        addl r3 = @ltoff(sh#), gp
        cmp4.eq p8, p9 = 0, r32
        ;;
        nop.i 0
        .mmi
        ld8 r2 = [r3]
        ;;
        ld4 r14 = [r2]
        nop.i 0
        ;;
        .mii
        (p9) cmp4.eq p6, p7 = 1, r14     ! it is this stuff that triggers the
asm warning.
        (p8) cmp4.eq p6, p7 = 2, r14     !
        ;;                               !
        (p6) mov r8 = r0                 !
        .mib                             !
        (p7) addl r8 = 13, r0            !
        nop.i 0                          !
        br.ret.sptk.many rp              !
        .endp f#
        .common sh#,4,4
        .ident  "GCC: (GNU) 3.2"

until now i could savely ignore the warning.
if a ia64 asm guru could please comment ?

i dont see the following anything to do with the asm issue frome above.

Quoted 14 lines

And the build terminates in a strange way as well:

/build/buildd/bigloo-2.5c+really2.5d-alpha-2003-05-16/bin/bigloo -no-hello -O2 -fsharing -unsafe -static-bigloo -c jas/lib.scm -o jas/lib.o /build/buildd/bigloo-2.5c+really2.5d-alpha-2003-05-16/bin/bigloo -no-hello -O2 -fsharing -unsafe -static-bigloo -c jas/classfile.scm -o jas/classfile.o Assembler messages:
FATAL: can't create classfile.o: No such file or directory
make[2]: *** [jas/classfile.o] Error 1
make[2]: Leaving directory `/build/buildd/bigloo-2.5c+really2.5d-alpha-2003-05-16/bde'
make[1]: *** [boot] Error 2
make[1]: Leaving directory `/build/buildd/bigloo-2.5c+really2.5d-alpha-2003-05-16'

Ideas anyone ?
--

Quoted 8 lines
Yann Dirson    <[email protected]> |    Why make M$-Bill richer & richer ?
Debian-related: <[email protected]> |   Support Debian GNU/Linux:
Pro:    <[email protected]> |  Freedom, Power, Stability, Gratuity
     http://ydirson.free.fr/        | Check <http://www.debian.org/>

--
To UNSUBSCRIBE, email to [email protected] with a subject of "unsubscribe". Trouble? Contact [email protected]

cheers
christian

Signature · 10 lines
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]


----- End forwarded message -----

-- 
"It's not Hollywood.  War is real, war is primarily not about defeat or
victory, it is about death.  I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk
#1 lore raw

Re: [Linux-ia64] [[email protected]: Re: Strange problems

Comments inline.

Quoted 20 lines
        .file   "waw.c"
        .pred.safe_across_calls p1-p5,p16-p63
        .text
        .align 16
        .global f#
        .proc f#
f:
        .prologue
        .body
        .mii
        addl r3 = @ltoff(sh#), gp
        cmp4.eq p8, p9 = 0, r32
        ;;
        nop.i 0
        .mmi
        ld8 r2 = [r3]
        ;;
        ld4 r14 = [r2]
        nop.i 0
        ;;
Quoted 8 lines
        .mii
        (p9) cmp4.eq p6, p7 = 1, r14     ! it is this stuff that triggers the
asm warning.
        (p8) cmp4.eq p6, p7 = 2, r14     !
        ;;                               !
        (p6) mov r8 = r0                 !
        .mib                             !
        (p7) addl r8 = 13, r0            !

It is at this place the assembler is cribbing.
There are two statements which are writing to the same register ofcourse with appropriate predicate registers.

(p6) mov r8 = r0
(p7) addl r8 = r13,r0

But the predicate register p6 and p7 are set by the just above statements

Quoted 2 lines
        (p9) cmp4.eq p6, p7 = 1, r14     
        (p8) cmp4.eq p6, p7 = 2, r14     

which are again dependent on the predicates p8 and p9 which are set by the statment:

Quoted 1 line
        cmp4.eq p8, p9 = 0, r32

I feel that the assembler is not able to recognize that the two statements which are writing to the same register(r8) are mutually exclusive ( only one of them can be executed), as it is two levels dependant on predicate registers.

Anyway, it's just a warning, not an error.

Regards,
Gowri Kumar

#2 lore raw
In reply to Matthew Wilcox
Quoted 41 lines · Matthew Wilcox

I don't grok ia64 asm enough to answer his question...
Yann Dirson schrieb:
~/src/ia64 > gcc -c -O3 waw.c
/tmp/cchXUlJF.s: Assembler messages:
/tmp/cchXUlJF.s:27: Warning: Use of 'addl' may violate WAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 8 /tmp/cchXUlJF.s:27: Warning: Only the first path encountering the conflict is reported
/tmp/cchXUlJF.s:25: Warning: This is the location of the conflicting usage ~/src/ia64 >

This only occurs when using option -O3 to gcc.
This looks like beeing an assembler problem, not one from gcc. Also, when looking into the assembler output, i could not find an error:

       .file   "waw.c"
       .pred.safe_across_calls p1-p5,p16-p63
       .text
       .align 16
       .global f#
       .proc f#
f:
       .prologue
       .body
       .mii
       addl r3 = @ltoff(sh#), gp
       cmp4.eq p8, p9 = 0, r32
       ;;
       nop.i 0
       .mmi
       ld8 r2 = [r3]
       ;;
       ld4 r14 = [r2]
       nop.i 0
       ;;
       .mii
       (p9) cmp4.eq p6, p7 = 1, r14     ! it is this stuff that triggers the
asm warning.
       (p8) cmp4.eq p6, p7 = 2, r14     !
       ;;                               !
Quoted 8 lines
       (p6) mov r8 = r0                 !
       .mib                             !
       (p7) addl r8 = 13, r0            !
       nop.i 0                          !
       br.ret.sptk.many rp              !
       .endp f#
       .common sh#,4,4
       .ident  "GCC: (GNU) 3.2"

The assembler normally recognises that two predicates are exclusive. In this case the setting of p6 and p7 is itself predicated (by p8, p9) so the assembler cannot analyse the logic flow well enough to see that p6 and p7 are exclusive. IMHO gcc should issue .pred.rel directives for complex predicates like this, e.g.

	.pred.rel "mutex", p6, p7
        (p6) mov r8 = r0
        (p7) addl r8 = 13, r0
	.pred.rel "clear", p6, p7

gcc knows that the predicates are exclusive and it is far easier for gcc to issue the .pred.rel directives than for the assembler to do complex logic path analysis to deduce what gcc already knows.