FW: wrong code generation in newlib 1.1.14 PPC ?!

Frank Juergen-r58616 Juergen.Frank@freescale.com
Thu Jan 12 10:33:00 GMT 2006


No no,

after the compilation I get code like this 

.
.
.
cmpwr cr7,r5,0
cmpwr cr6,r9,0
addi	r3,r1,8
.long	0x7C89209e		<-- looks like an unown opcode , this address produce the crash
li	r3,-2
.
.
.

I dig in the assembler code and found many other values like this one. But all of them are only in the function which are deliverd by newlib. The code which was written by me looks good ... I now this sounds strange but this is the situation. If you has this problem in general I would say oh this is a problem of the compiler (finally the compiler produce the opcodes) but why are only the newlib part buggy ??

	Juergen Frank





-----Original Message-----
From: Sriharsha [mailto:sriharsha.v@redpinesignals.com] 
Sent: Donnerstag, 12. Januar 2006 11:33
To: newlib@sources.redhat.com
Cc: Frank Juergen-r58616
Subject: Re: FW: wrong code generation in newlib 1.1.14 PPC ?!

Just for understanding, do you mean to say that the compiler is generating two different codes for a same function, one present in newlib and the other is the one you've written? This is strange !! One thing that I might consider looking at is optimization switch used to compile both the versions. Is everything (being used for compilation) the same at command-line?

Sriharsha.

Frank Juergen-r58616 wrote:

> 
>Hi !!
> 
>I generate my own version of gcc and newlib for the PowerPC. 
> 
>If I compile and link my program it looks good, but if I execute the code it crashes !! Ok I debug and find out that the compiler generate wrong opcodes but I compile and create everything with the same cpu option ( mcpu=603e ). So what kind of problem is this ... has anyone else similar effects ?
> 
>I see this problem only in the newlib functions not in my own program code ?!
> 
>    thank you for your help
>  
>



More information about the Newlib mailing list