This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: unwind table not properly populated
2009/9/18 Eric Botcazou <ebotcazou@adacore.com>:
> Hi Pascal,
>
>> The unwind table does not get populated on Win64 because a long is 32
>> bits and an address is 64 bits. The attached patch fixes this problem.
>
> The 'L' now looks superfluous in
>
> ?mask = ((_Unwind_Ptr)1L << (mask << 3)) - 1;
>
> You also don't need to put the "why" in the ChangeLog, just the "what".
>
> --
> Eric Botcazou
>
Ok, I adjusted the patch and backported it for 4.4 branch, too.
2009-09-20 Kai Tietz <kai.tietz@onevision.com>
Pascal Obry <obry@adacore.com>
* unwind-dw2-fde.c (classify_object_over_fdes):
Cast the constant 1 to _Unwind_Ptr.
(add_fdes): Likewise.
(linear_search_fdes): Likewise.
Ok for apply to trunk and 4.4 branch,
Cheers,
Kai
--
| (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination
Index: gcc/gcc/unwind-dw2-fde.c
===================================================================
--- gcc.orig/gcc/unwind-dw2-fde.c 2009-07-12 11:57:44.000000000 +0200
+++ gcc/gcc/unwind-dw2-fde.c 2009-09-20 12:44:25.792000000 +0200
@@ -630,7 +630,7 @@
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;
+ mask = (((_Unwind_Ptr) 1) << (mask << 3)) - 1;
else
mask = -1;
@@ -693,7 +693,7 @@
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;
+ mask = (((_Unwind_Ptr) 1) << (mask << 3)) - 1;
else
mask = -1;
@@ -816,7 +816,7 @@
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;
+ mask = (((_Unwind_Ptr) 1) << (mask << 3)) - 1;
else
mask = -1;
Index: gcc/gcc/unwind-dw2-fde.c
===================================================================
--- gcc.orig/gcc/unwind-dw2-fde.c 2009-04-10 22:09:49.000000000 +0200
+++ gcc/gcc/unwind-dw2-fde.c 2009-09-20 10:31:39.551377400 +0200
@@ -629,7 +629,7 @@
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;
+ mask = (((_Unwind_Ptr) 1) << (mask << 3)) - 1;
else
mask = -1;
@@ -690,7 +690,7 @@
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;
+ mask = (((_Unwind_Ptr) 1) << (mask << 3)) - 1;
else
mask = -1;
@@ -812,7 +812,7 @@
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;
+ mask = (((_Unwind_Ptr) 1) << (mask << 3)) - 1;
else
mask = -1;