public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "schlie at comcast dot net" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/18887] [4.0 Regression] libgcc2.h Improperly determines required built-in function size requirements.
Date: Tue, 21 Dec 2004 20:19:00 -0000	[thread overview]
Message-ID: <20041221201909.2445.qmail@sourceware.org> (raw)
In-Reply-To: <20041208130405.18887.schlie@comcast.net>


------- 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


  parent reply	other threads:[~2004-12-21 20:19 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-08 13:04 [Bug c/18887] New: " schlie at comcast dot net
2004-12-08 14:37 ` [Bug c/18887] " pinskia at gcc dot gnu dot org
2004-12-08 15:24 ` schlie at comcast dot net
2004-12-08 20:25 ` schlie at comcast dot net
2004-12-11 16:37 ` [Bug c/18887] [4.0 Regression] " giovannibajo at libero dot it
2004-12-11 17:58 ` [Bug middle-end/18887] " pinskia at gcc dot gnu dot org
2004-12-12  3:09 ` pinskia at gcc dot gnu dot org
2004-12-12 13:52 ` bernie at develer dot com
2004-12-12 14:12 ` bernie at develer dot com
2004-12-12 14:22 ` bernie at develer dot com
2004-12-14 16:40 ` pinskia at gcc dot gnu dot org
2004-12-21 20:19 ` schlie at comcast dot net [this message]
2004-12-27 17:10 ` berndtrog at yahoo dot com
2004-12-27 18:34 ` schlie at comcast dot net
2004-12-29 19:39 ` berndtrog at yahoo dot com
2005-01-05 19:48 ` bjoern dot m dot haase at web dot de
2005-01-18 21:40 ` bjoern dot m dot haase at web dot de
2005-01-21 17:46 ` mmitchel at gcc dot gnu dot org
2005-01-22 18:28 ` schlie at comcast dot net
2005-03-05 19:52 ` [Bug middle-end/18887] [4.0/4.1 " pinskia at gcc dot gnu dot org
2005-03-13 15:04 ` giovannibajo at libero dot it
2005-03-14 14:25 ` schlie at comcast dot net

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041221201909.2445.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).