This is the mail archive of the gcc-patches@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]

Re: bad integer division library call on sh-elf target


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

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