The unwind table does not get populated on Win64 because a long is 32 bits and
an address is 64 bits. The following patch fixes this problem.

<<
2009-09-18  Pascal Obry  <o...@adacore.com>

            * unwind-dw2-fde.c (classify_object_over_fdes):
            Properly cast the 1L constant. This is needed on
            x86-64 Windows where a long is 32bits and an
            address 64bits. With this path the unwind table
            gets properly populated.
            (add_fdes): Likewise.
            (linear_search_fdes): Likewise.

*** gcc/unwind-dw2-fde.c.orig   Thu Sep 17 20:25:26 2009
--- gcc/unwind-dw2-fde.c        Wed Sep 16 20:34:05 2009
*************** classify_object_over_fdes (struct object
*** 634,640 ****
         be representable.  Assume 0 in the representable bits is NULL.  */
        mask = size_of_encoded_value (encoding);
        if (mask < sizeof (void *))
!       mask = (1L << (mask << 3)) - 1;
        else
        mask = -1;

--- 634,640 ----
         be representable.  Assume 0 in the representable bits is NULL.  */
        mask = size_of_encoded_value (encoding);
        if (mask < sizeof (void *))
!       mask = ((_Unwind_Ptr)1L << (mask << 3)) - 1;
        else
        mask = -1;

*************** add_fdes (struct object *ob, struct fde_
*** 695,701 ****
             be representable.  Assume 0 in the representable bits is NULL.  */
          mask = size_of_encoded_value (encoding);
          if (mask < sizeof (void *))
!           mask = (1L << (mask << 3)) - 1;
          else
            mask = -1;

--- 695,701 ----
             be representable.  Assume 0 in the representable bits is NULL.  */
          mask = size_of_encoded_value (encoding);
          if (mask < sizeof (void *))
!           mask = ((_Unwind_Ptr)1L << (mask << 3)) - 1;
          else
            mask = -1;

*************** linear_search_fdes (struct object *ob, c
*** 817,823 ****
             be representable.  Assume 0 in the representable bits is NULL.  */
          mask = size_of_encoded_value (encoding);
          if (mask < sizeof (void *))
!           mask = (1L << (mask << 3)) - 1;
          else
            mask = -1;

--- 817,823 ----
             be representable.  Assume 0 in the representable bits is NULL.  */
          mask = size_of_encoded_value (encoding);
          if (mask < sizeof (void *))
!           mask = ((_Unwind_Ptr)1L << (mask << 3)) - 1;
          else
            mask = -1;

>>


-- 
           Summary: unwind table not properly populated
           Product: gcc
           Version: 4.3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: p dot obry at wanadoo dot fr
 GCC build triplet: i686-pc-mingw32
  GCC host triplet: i686-pc-mingw32
GCC target triplet: x86_64-pc-mingw32


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41400

Reply via email to