avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-libc-dev] Strange asm output


From: Paul Schlie
Subject: Re: [avr-libc-dev] Strange asm output
Date: Thu, 11 Nov 2004 12:13:53 -0500
User-agent: Microsoft-Entourage/11.1.0.040913

Might someone with a GCC 3.3.x (preferably 3.3.4) avr compiler try:

(and forward me the main.lss file for comparison with 3.4.3?)

/*Compiling: main.c using (for the sake of argument)

avr-gcc -c -mmcu=atmega64 -I. -g   -Os -funsigned-char -funsigned-bitfields
-fpack-struct
-fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=main.lst
-I/usr/local/avr/include
-std=gnu99 -funsafe-math-optimizations
-Wp,-M,-MP,-MT,main.o,-MF,.dep/main.o.d main.c
-o main.o 

Linking: main.elf (again for the sake of argumnet)
avr-gcc -mmcu=atmega64 -I. -g   -Os -funsigned-char -funsigned-bitfields
-fpack-struct
-fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=main.o
-I/usr/local/avr/include
-std=gnu99 -funsafe-math-optimizations
-Wp,-M,-MP,-MT,main.o,-MF,.dep/main.elf.d main.o
--output main.elf -Wl,-Map=main.map,--cref    -lm

File: main.c

*/

int foo0 ( int a ){

    if (a & 0x800000L)
        return 1; 
      else
        return 2 ;
    
}

int foo1 ( int a ){

    if (a & (1L << 23))
        return 1; 
      else
        return 2 ;
    
}

int foo2 ( long a ){

    if (a & 0x800000L)
        return 1; 
      else
        return 2 ;
    
}

int foo3 ( long a ){

    if (a & (1L << 23))
        return 1; 
      else
        return 2 ;
    
}

int main( void ){
    
    volatile int a;
    
    a = foo0 ( a );
    a = foo1 ( a );
    a = foo2 ( a );
    a = foo3 ( a );
    
    return 0;
}






reply via email to

[Prev in Thread] Current Thread [Next in Thread]