I am using gcc 3.3.1 release as my port, and looks
like I have hit a problem with greg.

The source program is the sqrt.c math function
__ieee754_sqrt. ( I am pasting the relevent part
here)

typedef union
{
  double value;
  struct
  {
    unsigned int lsw;
    unsigned int msw;
  } parts;
} ieee_double_shape_type;


double
__ieee754_sqrt (double x)
{
  double z;
  int sign = (int) 0x80000000;
  unsigned int r, t1, s1, ix1, q1;
  int ix0, s0, q, m, t, i;
..
..
if ((q & 1) == 1)
  ix1 |= sign;
ix0 += (m << 20);
do
  {
    ieee_double_shape_type iw_u;
    iw_u.parts.msw = (ix0);   // line 140
    iw_u.parts.lsw = (ix1);    // line 141
    (z) = iw_u.value; // line 142
  }
}

The dump of corresponding BBs of .23.lreg is as

(insn 419 516 420 38 0x1002f450 (set (reg/v:SI 77)
        (ior:SI (reg/v:SI 77)
            (const_int -2147483648 [0x80000000]))) 26
{iorsi3} (nil)
    (nil))
;; End of basic block 38, registers live:
 20 [r20] 21 [r21] 30 [r30] 64 [ap] 77 79 82 153

;; Start of basic block 39, registers live: 20 [r20]
21 [r21] 30 [r30] 64 [ap] 7
7 79 82 153
(code_label 420 419 517 39 43 "" [1 uses])

(note 517 420 421 39 [bb 39] NOTE_INSN_BASIC_BLOCK)

(note 421 517 422 39 ("sqrt.c") 136)

(insn 422 421 423 39 0x1002f450 (set (reg/v:SI 82)
        (ashift:SI (reg/v:SI 82)
            (const_int 20 [0x14]))) 22 {ashlsi3} (nil)
    (nil))

(note 423 422 427 39 NOTE_INSN_DELETED)

(note 427 423 428 39 ("sqrt.c") 139)

(note 428 427 429 39 ("sqrt.c") 140)

(insn 429 428 430 39 0x1002f420 (set (subreg:SI
(reg/v:DI 153) 4)
        (plus:SI (reg/v:SI 79)
            (reg/v:SI 82))) 12 {addsi3} (insn_list 422
(nil))
    (expr_list:REG_DEAD (reg/v:SI 82)
        (expr_list:REG_DEAD (reg/v:SI 79)
            (nil))))

(note 430 429 431 39 ("sqrt.c") 141)

(insn 431 430 432 39 0x1002f420 (set (subreg:SI
(reg/v:DI 153) 0)
        (reg/v:SI 77)) 6 {*movsi} (insn_list 429
(nil))
    (expr_list:REG_DEAD (reg/v:SI 77)
        (nil)))

(note 432 431 433 39 ("sqrt.c") 142)

(insn 433 432 436 39 0x1002f420 (set (reg:DF 70)
        (subreg:DF (reg/v:DI 153) 0)) 10 {*movdf}
(insn_list 431 (nil))
    (expr_list:REG_DEAD (reg/v:DI 153)
        (nil)))


And the dump of .24.greg pass is as:
(insn 419 516 420 38 0x1002f450 (set (reg/v:SI 12 r12
[77])
        (ior:SI (reg/v:SI 12 r12 [77])
            (const_int -2147483648 [0x80000000]))) 26
{iorsi3} (nil)
    (nil))
;; End of basic block 38, registers live:
 20 [r20] 21 [r21] 30 [r30] 64 [ap] 77 79 82 153

;; Start of basic block 39, registers live: 20 [r20]
21 [r21] 30 [r30] 77 79 82
153
(code_label 420 419 517 39 43 "" [1 uses])

(note 517 420 421 39 [bb 39] NOTE_INSN_BASIC_BLOCK)

(note 421 517 422 39 ("sqrt.c") 136)

(insn 422 421 423 39 0x1002f450 (set (reg/v:SI 4 r4
[82])
        (ashift:SI (reg/v:SI 4 r4 [82])
            (const_int 20 [0x14]))) 22 {ashlsi3} (nil)
    (nil))

(note 423 422 427 39 NOTE_INSN_DELETED)

(note 427 423 428 39 ("sqrt.c") 139)

(note 428 427 429 39 ("sqrt.c") 140)

(insn 429 428 618 39 0x1002f420 (set (reg/v:SI 4 r4
[82])
        (plus:SI (reg/v:SI 4 r4 [82])
            (reg/v:SI 3 r3 [79]))) 12 {addsi3}
(insn_list 422 (nil))
    (nil))

(insn 618 429 619 39 0x0 (set (reg:SI 0 r0)
        (reg/v:SI 4 r4 [82])) 6 {*movsi} (nil)
    (nil))

(insn 619 618 430 39 0x0 (set (mem:SI (plus:SI
(reg/f:SI 21 r21)
                (const_int -4 [0xfffffffc])) [3 iw_u
S4 A32])
        (reg:SI 0 r0)) 6 {*movsi} (nil)
    (nil))

(note 430 619 431 39 ("sqrt.c") 141)

(insn 431 430 620 39 0x1002f420 (set (reg:SI 0 r0)
        (reg/v:SI 12 r12 [77])) 6 {*movsi} (insn_list
429 (nil))
    (nil))

(insn 620 431 621 39 0x0 (set (reg:DI 2 r2)
        (reg:DI 0 r0)) 7 {*movdi} (nil)
    (nil))

(insn 621 620 432 39 0x0 (set (mem:DI (plus:SI
(reg/f:SI 21 r21)
                (const_int -8 [0xfffffff8])) [3 iw_u
S8 A32])
        (reg:DI 2 r2)) 7 {*movdi} (nil)
    (nil))

(note 432 621 433 39 ("sqrt.c") 142)

(insn 433 432 436 39 0x1002f420 (set (reg:DF 14 r14
[70])
        (reg:DF 0 r0)) 10 {*movdf} (insn_list 431
(nil))
    (nil))


I couldn't understand why the insns 620 and 621 are
being generated here as DI moves.
This is creating problem since insn 621 gets splitted
after reload into two SI moves,i.e. @(r21, -8) and
@(r21, -4).
This renders insns 619 as dead and hence insns 618 and
insn 429 as dead, which are eliminated by flow2.

I could not analyze beyond this and need your help to
move further.

Thanks in advance.
Sanjiv

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Reply via email to