public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [avr] Patch for -mint8 option
@ 2002-11-24 23:55 Svein E. Seldal
  2002-12-17  8:58 ` unreviewed patch Svein E. Seldal
  2003-05-10 10:57 ` [avr] Patch for -mint8 option -- " Svein E. Seldal
  0 siblings, 2 replies; 5+ messages in thread
From: Svein E. Seldal @ 2002-11-24 23:55 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 626 bytes --]

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__

[-- Attachment #2: avr-mint8.diff --]
[-- Type: text/plain, Size: 2036 bytes --]

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-06-04 18:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-24 23:55 [avr] Patch for -mint8 option Svein E. Seldal
2002-12-17  8:58 ` unreviewed patch Svein E. Seldal
2003-05-10 10:57 ` [avr] Patch for -mint8 option -- " Svein E. Seldal
2003-05-30 14:05   ` unreviwed patch -- 3rd attempt (since 2002-11) Svein E. Seldal
2003-06-04 18:13   ` [avr] Patch for -mint8 option -- unreviewed patch Jim Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).