From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2500 invoked by alias); 21 Dec 2004 20:19:21 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 2446 invoked by uid 48); 21 Dec 2004 20:19:09 -0000 Date: Tue, 21 Dec 2004 20:19:00 -0000 Message-ID: <20041221201909.2445.qmail@sourceware.org> From: "schlie at comcast dot net" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20041208130405.18887.schlie@comcast.net> References: <20041208130405.18887.schlie@comcast.net> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug middle-end/18887] [4.0 Regression] libgcc2.h Improperly determines required built-in function size requirements. X-Bugzilla-Reason: CC X-SW-Source: 2004-12/txt/msg03101.txt.bz2 List-Id: ------- Additional Comments From schlie at comcast dot net 2004-12-21 20:19 ------- Minimal changes required to get avr to build: (which disables DI/DF emulation modes which appear to exceed avr's allocatable registers. ) *** In File: config/avr.h, Beginning line: 111 *** #define BITS_BIG_ENDIAN 0 #define BYTES_BIG_ENDIAN 0 #define WORDS_BIG_ENDIAN 0 #ifdef IN_LIBGCC2 - /* This is to get correct SI and DI modes in libgcc2.c (32 and 64 bits). */ + /* To map SI/DI modes in libgcc2.c to HI/SI modes (16 and 32 bits). */ - #define UNITS_PER_WORD 4 + #define UNITS_PER_WORD 2 #else /* Width of a word, in units (bytes). */ #define UNITS_PER_WORD 1 #endif #define POINTER_SIZE 16 *** In File: config/avr.h, Beginning line: 142 *** #define INT_TYPE_SIZE (TARGET_INT8 ? 8 : 16) #define SHORT_TYPE_SIZE (INT_TYPE_SIZE == 8 ? INT_TYPE_SIZE : 16) #define LONG_TYPE_SIZE (INT_TYPE_SIZE == 8 ? 16 : 32) - #define LONG_LONG_TYPE_SIZE (INT_TYPE_SIZE == 8 ? 32 : 64) + #define LONG_LONG_TYPE_SIZE (INT_TYPE_SIZE == 8 ? 32 : 32) #define FLOAT_TYPE_SIZE 32 #define DOUBLE_TYPE_SIZE 32 #define LONG_DOUBLE_TYPE_SIZE 32 #define DEFAULT_SIGNED_CHAR 1 + #define SMALL_EH_ENCODEING 1 + #define SIZE_TYPE (INT_TYPE_SIZE == 8 ? "long unsigned int" : "unsigned int") #define PTRDIFF_TYPE (INT_TYPE_SIZE == 8 ? "long int" :"int") *** In File: unwind.h, beginning line: 55 *** /* @@@ The IA-64 ABI uses a 64-bit word to identify the producer and consumer of an exception. We'll go along with this for now even on 32-bit machines. We'll need to provide some other option for 16-bit machines and for machines with > 8 bits per byte. */ + #include "tm.h" /* Fixme: just a temporary hack for small targets. */ + #if (SMALL_EH_ENCODEING) + typedef unsigned _Unwind_Exception_Class __attribute__((__mode__(__SI__))); + #else typedef unsigned _Unwind_Exception_Class __attribute__((__mode__(__DI__))); + #endif /* The unwind interface uses reason codes in several contexts to identify the reasons for failures or other actions. */ *** In File: unwind-pe.h, beginning line: 37 *** /* If using C++, references to abort have to be qualified with std::. */ #if __cplusplus #define __gxx_abort std::abort #else #define __gxx_abort abort #endif + #include "tm.h" /* Fixme: just a temporary hack for small targets. */ + /* Pointer encodings, from dwarf2.h. */ #define DW_EH_PE_absptr 0x00 #define DW_EH_PE_omit 0xff *** In File: unwind-pe.h, beginning line: 184 *** static const unsigned char * read_encoded_value_with_base (unsigned char encoding, _Unwind_Ptr base, const unsigned char *p, _Unwind_Ptr *val) { + #if (SMALL_EH_ENCODEING) /* Fixme: just a temporary hack for small targets. */ + union unaligned + { + void *ptr; + unsigned u2 __attribute__ ((mode (QI))); + unsigned u4 __attribute__ ((mode (HI))); + unsigned u8 __attribute__ ((mode (SI))); + signed s2 __attribute__ ((mode (QI))); + signed s4 __attribute__ ((mode (HI))); + signed s8 __attribute__ ((mode (SI))); + } __attribute__((__packed__)); + #else union unaligned { void *ptr; unsigned u2 __attribute__ ((mode (HI))); unsigned u4 __attribute__ ((mode (SI))); unsigned u8 __attribute__ ((mode (DI))); signed s2 __attribute__ ((mode (HI))); signed s4 __attribute__ ((mode (SI))); signed s8 __attribute__ ((mode (DI))); } __attribute__((__packed__)); + #endif const union unaligned *u = (const union unaligned *) p; _Unwind_Internal_Ptr result; *** end *** -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18887