This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: bad integer division library call on sh-elf target
- To: amylaar at cygnus dot co dot uk
- Subject: Re: bad integer division library call on sh-elf target
- From: kaz Kojima <kkojima at rr dot iij4u dot or dot jp>
- Date: Sat, 03 Jun 2000 08:08:24 +0900
- Cc: gcc-patches at gcc dot gnu dot org
- References: <200006021822.TAA24512@phal.cygnus.co.uk>
Hello,
Thank for your reply.
> : mov r8,r4
> : jal @r10
> : mov #100,r5
> : ..
>
> : but no one sets the value to r10.
>
> I cannot reproduce this.
Hmm... Sorry, perhaps I was wrong when I made the example shorter.
This is the original code which causes the problem. Can you please
try it? If you cannot find any problem about __sdivsi3 libcall, my
gcc is broken as you say. (I'm using gcc form today's cvs configured
for the sh-any-elf target compiled by gcc-2.95.1 in RedHat 6.1.)
extern int len_years[];
extern int len_months[2][12];
rpytime(rp, wantedy)
register const int rp;
register const int wantedy;
{
register int y, m, i;
register long dayoff;
register int t;
dayoff = 0;
m = 0;
y = 1970;
while (wantedy != y) {
i = len_years[(((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0))];
++y;
dayoff = oadd(dayoff, eitol(i));
}
while (m != rp) {
i = len_months[(((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0))][m];
dayoff = oadd(dayoff, eitol(i));
++m;
}
return 0;
}
--
Regards,
kaz