This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Difference in assembly
- From: Manmeet Singh Johar <manmeet dot johar at conexant dot com>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 31 Dec 2004 13:10:09 +0530
- Subject: Re: Difference in assembly
- Organization: Conexant India
- References: <41D2903B.9040402@conexant.com>
- Reply-to: manmeet dot johar at conexant dot com
Has anybody faced with such a problem? Please do help me out.
regards
manmeet
Manmeet Singh Johar wrote:
Hello,
I am building cross compilers for SPARC variant for Cygwin and MingW
hosts. In the process I am faced with a very peculiar problem. For the
code shown below, though I am getting same assembly instructions in
same sequence, but the registers used in add are swapped. O0 has no
problem, but the problem comes in as soon as I compile with O1.
Code:
#include <stdio.h>
extern unsigned int index;
extern unsigned char arr[100];
int main(int argc, char *argv[])
{
if(arr[index] != 0) printf("\n FATAL....") ;
return 0;
}
I also built the cross compiler for linux and the assembly generated
matches with the one generated by compiler on Cygwin. Could someone
please help me out.
Regards
Manmeet
--
Manmeet Singh Johar
Software Engineer
Conexant
(+91-93120-54285)
"Forget yourself and you will not be forgotten."