public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix inconsistent use of integer types in gcc/lto-streamer-out.c
@ 2015-11-15  8:21 Andris Pavenis
  2015-11-16 11:12 ` Richard Biener
  0 siblings, 1 reply; 4+ messages in thread
From: Andris Pavenis @ 2015-11-15  8:21 UTC (permalink / raw)
  To: GCC Patches, DJ Delorie

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

This fixes use of pointers different unsigned integer types as function parameter.
Function prototype is (see gcc/tree-streamer.h):

bool streamer_tree_cache_lookup (struct streamer_tree_cache_d *, tree,
                  unsigned *);

gcc/lto-streamer-out.c passes uint32_t int * as parameter to this method in 2 places.
Current type unisgned is used elsewhere in the same file.

uint32_t is not guaranteed to be the same as unsigned (for DJGPP uint32_t is actually
unsigned long). That causes compile failure for DJGPP native build.

Andris

2015-11-15 Andris Pavenis <andris.pavenis@iki.fi>

* gcc/lto-streamer-out.c (write_global_references): Adjust integer type
   (lto_output_decl_state_refs): Likewise


[-- Attachment #2: 0001-lto-streamer-out.c-Fix-inconsistent-use-unsigned-int.patch --]
[-- Type: text/x-patch, Size: 1173 bytes --]

From 8962f5b60f3ea241634a5e50cda04dc17ebb1322 Mon Sep 17 00:00:00 2001
From: Andris Pavenis <andris.pavenis@iki.fi>
Date: Sun, 15 Nov 2015 09:57:24 +0200
Subject: [PATCH] lto-streamer-out.c: Fix inconsistent use unsigned integer
 types

* lto-streamer-out (write_global_references, lto_output_decl_state_streams): use integer
 type passed to streamer_tree_cache_lookup.
---
 gcc/lto-streamer-out.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c
index 11daf7a..7d008b5 100644
--- a/gcc/lto-streamer-out.c
+++ b/gcc/lto-streamer-out.c
@@ -2402,7 +2402,7 @@ write_global_references (struct output_block *ob,
 
   for (index = 0; index < size; index++)
     {
-      uint32_t slot_num;
+      unsigned slot_num;
 
       t = lto_tree_ref_encoder_get_tree (encoder, index);
       streamer_tree_cache_lookup (ob->writer_cache, t, &slot_num);
@@ -2437,7 +2437,7 @@ lto_output_decl_state_refs (struct output_block *ob,
 			    struct lto_out_decl_state *state)
 {
   unsigned i;
-  uint32_t ref;
+  unsigned ref;
   tree decl;
 
   /* Write reference to FUNCTION_DECL.  If there is not function,
-- 
2.4.3


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

* Re: [PATCH] Fix inconsistent use of integer types in gcc/lto-streamer-out.c
  2015-11-15  8:21 [PATCH] Fix inconsistent use of integer types in gcc/lto-streamer-out.c Andris Pavenis
@ 2015-11-16 11:12 ` Richard Biener
  2015-11-16 16:23   ` Andris Pavenis
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Biener @ 2015-11-16 11:12 UTC (permalink / raw)
  To: Andris Pavenis; +Cc: GCC Patches, DJ Delorie

On Sun, Nov 15, 2015 at 9:21 AM, Andris Pavenis <andris.pavenis@iki.fi> wrote:
> This fixes use of pointers different unsigned integer types as function
> parameter.
> Function prototype is (see gcc/tree-streamer.h):
>
> bool streamer_tree_cache_lookup (struct streamer_tree_cache_d *, tree,
>                  unsigned *);
>
> gcc/lto-streamer-out.c passes uint32_t int * as parameter to this method in
> 2 places.
> Current type unisgned is used elsewhere in the same file.
>
> uint32_t is not guaranteed to be the same as unsigned (for DJGPP uint32_t is
> actually
> unsigned long). That causes compile failure for DJGPP native build.

Ok.

Thanks,
Richard.

> Andris
>
> 2015-11-15 Andris Pavenis <andris.pavenis@iki.fi>
>
> * gcc/lto-streamer-out.c (write_global_references): Adjust integer type
>   (lto_output_decl_state_refs): Likewise
>

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

* Re: [PATCH] Fix inconsistent use of integer types in gcc/lto-streamer-out.c
  2015-11-16 11:12 ` Richard Biener
@ 2015-11-16 16:23   ` Andris Pavenis
  2015-11-16 21:13     ` Jeff Law
  0 siblings, 1 reply; 4+ messages in thread
From: Andris Pavenis @ 2015-11-16 16:23 UTC (permalink / raw)
  To: Richard Biener; +Cc: GCC Patches, DJ Delorie

On 11/16/2015 01:12 PM, Richard Biener wrote:
> On Sun, Nov 15, 2015 at 9:21 AM, Andris Pavenis <andris.pavenis@iki.fi> wrote:
>> This fixes use of pointers different unsigned integer types as function
>> parameter.
>> Function prototype is (see gcc/tree-streamer.h):
>>
>> bool streamer_tree_cache_lookup (struct streamer_tree_cache_d *, tree,
>>                   unsigned *);
>>
>> gcc/lto-streamer-out.c passes uint32_t int * as parameter to this method in
>> 2 places.
>> Current type unisgned is used elsewhere in the same file.
>>
>> uint32_t is not guaranteed to be the same as unsigned (for DJGPP uint32_t is
>> actually
>> unsigned long). That causes compile failure for DJGPP native build.
> Ok.
>
> Thanks,
> Richard.

Could somebody apply it as I do not have SVN write access.

Andris

>
>> Andris
>>
>> 2015-11-15 Andris Pavenis <andris.pavenis@iki.fi>
>>
>> * gcc/lto-streamer-out.c (write_global_references): Adjust integer type
>>    (lto_output_decl_state_refs): Likewise
>>

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

* Re: [PATCH] Fix inconsistent use of integer types in gcc/lto-streamer-out.c
  2015-11-16 16:23   ` Andris Pavenis
@ 2015-11-16 21:13     ` Jeff Law
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff Law @ 2015-11-16 21:13 UTC (permalink / raw)
  To: Andris Pavenis, Richard Biener; +Cc: GCC Patches, DJ Delorie

On 11/16/2015 09:22 AM, Andris Pavenis wrote:
> On 11/16/2015 01:12 PM, Richard Biener wrote:
>> On Sun, Nov 15, 2015 at 9:21 AM, Andris Pavenis
>> <andris.pavenis@iki.fi> wrote:
>>> This fixes use of pointers different unsigned integer types as function
>>> parameter.
>>> Function prototype is (see gcc/tree-streamer.h):
>>>
>>> bool streamer_tree_cache_lookup (struct streamer_tree_cache_d *, tree,
>>>                   unsigned *);
>>>
>>> gcc/lto-streamer-out.c passes uint32_t int * as parameter to this
>>> method in
>>> 2 places.
>>> Current type unisgned is used elsewhere in the same file.
>>>
>>> uint32_t is not guaranteed to be the same as unsigned (for DJGPP
>>> uint32_t is
>>> actually
>>> unsigned long). That causes compile failure for DJGPP native build.
>> Ok.
>>
>> Thanks,
>> Richard.
>
> Could somebody apply it as I do not have SVN write access.
Done.
jeff

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

end of thread, other threads:[~2015-11-16 21:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-15  8:21 [PATCH] Fix inconsistent use of integer types in gcc/lto-streamer-out.c Andris Pavenis
2015-11-16 11:12 ` Richard Biener
2015-11-16 16:23   ` Andris Pavenis
2015-11-16 21:13     ` Jeff Law

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