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

Incorrect loop generation code generated by gcc-2.95.2 configured for PPC target (powerpc-rtems) (extracted directly from cvs the 21/10/99)


This bug is present in gcc-2.95.1 and in the gcc snapshot extracted the
21 th October from CVS with the correct gcc-2.95.2 branch tag.

Attached with this mail you will find :
	1) The C code that triggers the bug (standalone so that you can
regenerate it)
	2) The side by side asm code generated by egcc 1.1.2 (-mcpu=604) and
gcc-2.95.2 (-mcpu=750) (and probably gcc-2.95.1 as the bug also happens
with this gcc version) 
	3) The explanation of the bug in the form of commented asm,

Basically the bug is due to the new way used to generate C "for"
instruction. Now for the PPC targets the PPC' "CTR" register is used in
cunjunction of the "bdnz". The problem is that the CTR register is
automatically decremented by the bdnz instruction but the CTR value is
not always used as the input value for the index variable of the loop.
See comments in the asm code.


NB : THIS IS A VERY SEVERE BUG. 

-- 
   __                 
  /  `                   	Eric Valette
 /--   __  o _.          	Canon CRF
(___, / (_(_(__         	Rue de la touche lambert
				35517 Cesson-Sevigne  Cedex

Tel: +33 (0)2 99 87 68 91	Fax: +33 (0)2 99 84 11 30
E-mail: valette@crf.canon.fr

mail-gcc-bug2


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