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]
Other format: [Raw text]

[avr] Patch for -mint8 option


Hello,

I have put together a little patch for setting the size of the long long type when the -mint8 option is used. As there are no 32-bits type in -mint8 mode, and the fact that none of the other sizeof's are compliant to the C-specification, I think that it would be appropriate to do this.

I have also modified the specs to define the symbol __AVR_INT8__, making it possible for applications to differentiate when -mint8 are used or not.


Svein

gcc/ChangeLog:
2002-11-25 Svein E. Seldal <Svein.Seldal@solidas.com>

* config/avr/avr.h: Reduce the long long type to 32-bit in
-mint8 mode and define __AVR_INT8__
Index: gcc/config/avr/avr.h
===================================================================
RCS file: /prosjekt/gnu/gcc/gcc/gcc/config/avr/avr.h,v
retrieving revision 1.71
diff -c -3 -p -r1.71 avr.h
*** gcc/config/avr/avr.h	24 Sep 2002 12:48:52 -0000	1.71
--- gcc/config/avr/avr.h	20 Nov 2002 10:40:46 -0000
*************** Boston, MA 02111-1307, USA.  */
*** 38,43 ****
--- 38,45 ----
  	builtin_define ("__AVR_MEGA__");	\
        if (TARGET_NO_INTERRUPTS)			\
  	builtin_define ("__NO_INTERRUPTS__");	\
+       if (TARGET_INT8)                          \
+         builtin_define ("__AVR_INT8__");        \
      }						\
    while (0)
  
*************** extern int avr_asm_only_p;
*** 204,210 ****
     used in `cpp'.  */
  
  
! #define LONG_LONG_TYPE_SIZE 64
  /* A C expression for the size in bits of the type `long long' on the
     target machine.  If you don't define this, the default is two
     words.  If you want to support GNU Ada on your machine, the value
--- 206,212 ----
     used in `cpp'.  */
  
  
! #define LONG_LONG_TYPE_SIZE ( INT_TYPE_SIZE == 8 ? 32 : 64 )
  /* A C expression for the size in bits of the type `long long' on the
     target machine.  If you don't define this, the default is two
     words.  If you want to support GNU Ada on your machine, the value
*************** extern int avr_case_values_threshold;
*** 2508,2514 ****
     (and ANSI C) library functions `memcpy' and `memset' rather than
     the BSD functions `bcopy' and `bzero'.  */
  
! #define CPP_SPEC "%{posix:-D_POSIX_SOURCE}"
  
  /* A C string constant that tells the GNU CC driver program options to
     pass to CPP.  It can also specify how to translate options you
--- 2510,2516 ----
     (and ANSI C) library functions `memcpy' and `memset' rather than
     the BSD functions `bcopy' and `bzero'.  */
  
! #define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{mint8:-D__AVR_INT8__}"
  
  /* A C string constant that tells the GNU CC driver program options to
     pass to CPP.  It can also specify how to translate options you

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