This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
gcc port to StarCore
- From: "David Livshin" <dlivshin at internet-zahav dot net>
- To: <gcc at gcc dot gnu dot org>
- Date: Fri, 17 May 2002 13:26:07 +0200
- Subject: gcc port to StarCore
Hi,
I am working on the port of the gcc version 3.0.1 to the StarCore
architecture ( DSP from Motorola/Agere ). Compiling ( without
optimizations ):
foo()
{
int i;
switch (i)
case 1:
break;
}
compiler generates the following pattern:
...
(insn 17 32 18 (set (cc0)
(compare (reg:SI 3 d3 [43])
(reg:SI 2 d2 [44]))) 63 {cmpsiEXPANDED} (nil)
(nil))
(jump_insn 18 17 29 (set (pc)
(if_then_else (eq (cc0)
(const_int 0 [0x0]))
(label_ref 21)
(pc))) 52 {beqEXPANDED} (nil)
(nil))
;; End of basic block 0, registers live:
23 [r7] 32 [sp]
;; Start of basic block 1, registers live: 23 [r7] 32 [sp]
...
which stays valid till flow analysis ( last seen in ".postpreload" dump ).
In ".flow2" dump the above pattern is transformed into:
(insn 17 32 11 (set (cc0)
(compare (reg:SI 3 d3 [43])
(reg:SI 2 d2 [44]))) 63 {cmpsiEXPANDED} (nil)
(nil))
;; End of basic block 0, registers live:
23 [r7] 32 [sp]
( jump instruction being deleted ).
Is that correct? Documentation states that "GCC always generates a pair of
consecutive RTL insns, possibly separated by note insns, one to set the
condition code and one to test it, and _keeps the pair inviolate until the
end_."
While handling compare I am calling "next_cc0_usr" which in this case
returned 0; In addition to that I tried "find_reg_note (insn, REG_UNUSED,
cc0_rtx)" but it also failed. If the observed behavior of gcc is correct,
how should I treat this situation ( e.g. not generate code for compare )?
I checked my implementation of NOTICE_UPDATE_CC and it performed
CC_STATUS_INIT before handling compare ( as required ).
What could be wrong in my implementation?
Thank you in advance,
David Livshin
dlivshin@internet-zahav.net
Tel: +972 - 8 - 935 - 4597
Mobile: +972 - 67 - 290 - 998
Laskov 11/31
Rehovot, 76654
Israel
http://www.dalsoft.esmartweb.com/