diff mbox

[4/N] Introduce new inline functions for GET_MODE_UNIT_SIZE and GET_MODE_UNIT_PRECISION

Message ID FDE8B9D3-4C52-4F1C-A8C9-10AC17DCA57F@t-online.de
State New
Headers show

Commit Message

Oleg Endo Aug. 26, 2015, 2:53 p.m. UTC
On 26 Aug 2015, at 23:27, Oleg Endo <oleg.endo@t-online.de> wrote:

> 
> On 19 Aug 2015, at 22:35, Jeff Law <law@redhat.com> wrote:
> 
>> On 08/19/2015 06:29 AM, David Sherwood wrote:
>>>> I asked Richard S. to give this a once-over which he did.  However, he
>>>> technically can't approve due to the way his maintainership position was
>>>> worded.
>>>> 
>>>> The one request would be a function comment for emit_mode_unit_size and
>>>> emit_mode_unit_precision.  OK with that change.
>>> Thanks. Here's a new patch with the comments added.
>>> 
>>> Good to go?
>>> David.
>>> 
>>> ChangeLog:
>>> 
>>> 2015-08-19  David Sherwood  <david.sherwood@arm.com>
>>> 
>>> 	gcc/
>>> 	* genmodes.c (emit_mode_unit_size_inline): New function.
>>> 	(emit_mode_unit_precision_inline): New function.
>>> 	(emit_insn_modes_h): Emit new #define.  Emit new functions.
>>> 	(emit_mode_unit_size): New function.
>>> 	(emit_mode_unit_precision): New function.
>>> 	(emit_mode_adjustments): Add mode_unit_size adjustments.
>>> 	(emit_insn_modes_c): Emit new arrays.
>>> 	* machmode.h (GET_MODE_UNIT_SIZE, GET_MODE_UNIT_PRECISION): Update to
>>> 	use new inline methods.
>> 
>> Thanks, this is OK for the trunk.
> 
> It seems this broke sh-elf, at least when compiling on OSX with its native clang.
> 
> ../../gcc-trunk/gcc/machmode.h:228:43: error: redefinition of 'mode_unit_size' with a different type:
>      'const unsigned char [56]' vs 'unsigned char [56]'
> extern CONST_MODE_UNIT_SIZE unsigned char mode_unit_size[NUM_MACHINE_MODES];
>                                          ^
> ./insn-modes.h:417:24: note: previous definition is here
>  extern unsigned char mode_unit_size[NUM_MACHINE_MODES];
>                       ^

This following fixes the problem for me:


Cheers,
Oleg

Comments

David Sherwood Aug. 27, 2015, 7:58 a.m. UTC | #1
Hi Oleg,

Oh I'm so sorry I broke the build - I should have spotted that. Have you 
already checked in this fix or do you want me to?

Regards,
David.

> -----Original Message-----
> From: Oleg Endo [mailto:oleg.endo@t-online.de]
> Sent: 26 August 2015 15:53
> To: Jeff Law
> Cc: David Sherwood; GCC Patches
> Subject: Re: [PATCH][4/N] Introduce new inline functions for GET_MODE_UNIT_SIZE and
> GET_MODE_UNIT_PRECISION
> 
> 
> On 26 Aug 2015, at 23:27, Oleg Endo <oleg.endo@t-online.de> wrote:
> 
> >
> > On 19 Aug 2015, at 22:35, Jeff Law <law@redhat.com> wrote:
> >
> >> On 08/19/2015 06:29 AM, David Sherwood wrote:
> >>>> I asked Richard S. to give this a once-over which he did.  However, he
> >>>> technically can't approve due to the way his maintainership position was
> >>>> worded.
> >>>>
> >>>> The one request would be a function comment for emit_mode_unit_size and
> >>>> emit_mode_unit_precision.  OK with that change.
> >>> Thanks. Here's a new patch with the comments added.
> >>>
> >>> Good to go?
> >>> David.
> >>>
> >>> ChangeLog:
> >>>
> >>> 2015-08-19  David Sherwood  <david.sherwood@arm.com>
> >>>
> >>> 	gcc/
> >>> 	* genmodes.c (emit_mode_unit_size_inline): New function.
> >>> 	(emit_mode_unit_precision_inline): New function.
> >>> 	(emit_insn_modes_h): Emit new #define.  Emit new functions.
> >>> 	(emit_mode_unit_size): New function.
> >>> 	(emit_mode_unit_precision): New function.
> >>> 	(emit_mode_adjustments): Add mode_unit_size adjustments.
> >>> 	(emit_insn_modes_c): Emit new arrays.
> >>> 	* machmode.h (GET_MODE_UNIT_SIZE, GET_MODE_UNIT_PRECISION): Update to
> >>> 	use new inline methods.
> >>
> >> Thanks, this is OK for the trunk.
> >
> > It seems this broke sh-elf, at least when compiling on OSX with its native clang.
> >
> > ../../gcc-trunk/gcc/machmode.h:228:43: error: redefinition of 'mode_unit_size' with a different
type:
> >      'const unsigned char [56]' vs 'unsigned char [56]'
> > extern CONST_MODE_UNIT_SIZE unsigned char mode_unit_size[NUM_MACHINE_MODES];
> >                                          ^
> > ./insn-modes.h:417:24: note: previous definition is here
> >  extern unsigned char mode_unit_size[NUM_MACHINE_MODES];
> >                       ^
> 
> This following fixes the problem for me:
> 
> Index: gcc/genmodes.c
> ===================================================================
> --- gcc/genmodes.c	(revision 227221)
> +++ gcc/genmodes.c	(working copy)
> @@ -1063,7 +1063,7 @@
>  unsigned char\n\
>  mode_unit_size_inline (machine_mode mode)\n\
>  {\n\
> -  extern unsigned char mode_unit_size[NUM_MACHINE_MODES];\n\
> +  extern CONST_MODE_UNIT_SIZE unsigned char mode_unit_size[NUM_MACHINE_MODES];\n\
>    switch (mode)\n\
>      {");
> 
> 
> Cheers,
> Oleg
Oleg Endo Aug. 27, 2015, 12:02 p.m. UTC | #2
Hi,

On 27 Aug 2015, at 16:58, David Sherwood <david.sherwood@arm.com> wrote:

> Hi Oleg,
> 
> Oh I'm so sorry I broke the build - I should have spotted that. Have you 
> already checked in this fix or do you want me to?

No, I haven't committed the patch.  Please do so if it's OK.

Cheers,
Oleg



>> -----Original Message-----
>> From: Oleg Endo [mailto:oleg.endo@t-online.de]
>> Sent: 26 August 2015 15:53
>> To: Jeff Law
>> Cc: David Sherwood; GCC Patches
>> Subject: Re: [PATCH][4/N] Introduce new inline functions for GET_MODE_UNIT_SIZE and
>> GET_MODE_UNIT_PRECISION
>> 
>> 
>> On 26 Aug 2015, at 23:27, Oleg Endo <oleg.endo@t-online.de> wrote:
>> 
>>> 
>>> On 19 Aug 2015, at 22:35, Jeff Law <law@redhat.com> wrote:
>>> 
>>>> On 08/19/2015 06:29 AM, David Sherwood wrote:
>>>>>> I asked Richard S. to give this a once-over which he did.  However, he
>>>>>> technically can't approve due to the way his maintainership position was
>>>>>> worded.
>>>>>> 
>>>>>> The one request would be a function comment for emit_mode_unit_size and
>>>>>> emit_mode_unit_precision.  OK with that change.
>>>>> Thanks. Here's a new patch with the comments added.
>>>>> 
>>>>> Good to go?
>>>>> David.
>>>>> 
>>>>> ChangeLog:
>>>>> 
>>>>> 2015-08-19  David Sherwood  <david.sherwood@arm.com>
>>>>> 
>>>>> 	gcc/
>>>>> 	* genmodes.c (emit_mode_unit_size_inline): New function.
>>>>> 	(emit_mode_unit_precision_inline): New function.
>>>>> 	(emit_insn_modes_h): Emit new #define.  Emit new functions.
>>>>> 	(emit_mode_unit_size): New function.
>>>>> 	(emit_mode_unit_precision): New function.
>>>>> 	(emit_mode_adjustments): Add mode_unit_size adjustments.
>>>>> 	(emit_insn_modes_c): Emit new arrays.
>>>>> 	* machmode.h (GET_MODE_UNIT_SIZE, GET_MODE_UNIT_PRECISION): Update to
>>>>> 	use new inline methods.
>>>> 
>>>> Thanks, this is OK for the trunk.
>>> 
>>> It seems this broke sh-elf, at least when compiling on OSX with its native clang.
>>> 
>>> ../../gcc-trunk/gcc/machmode.h:228:43: error: redefinition of 'mode_unit_size' with a different
> type:
>>>     'const unsigned char [56]' vs 'unsigned char [56]'
>>> extern CONST_MODE_UNIT_SIZE unsigned char mode_unit_size[NUM_MACHINE_MODES];
>>>                                         ^
>>> ./insn-modes.h:417:24: note: previous definition is here
>>> extern unsigned char mode_unit_size[NUM_MACHINE_MODES];
>>>                      ^
>> 
>> This following fixes the problem for me:
>> 
>> Index: gcc/genmodes.c
>> ===================================================================
>> --- gcc/genmodes.c	(revision 227221)
>> +++ gcc/genmodes.c	(working copy)
>> @@ -1063,7 +1063,7 @@
>> unsigned char\n\
>> mode_unit_size_inline (machine_mode mode)\n\
>> {\n\
>> -  extern unsigned char mode_unit_size[NUM_MACHINE_MODES];\n\
>> +  extern CONST_MODE_UNIT_SIZE unsigned char mode_unit_size[NUM_MACHINE_MODES];\n\
>>   switch (mode)\n\
>>     {");
>> 
>> 
>> Cheers,
>> Oleg
> 
> 
>
Jeff Law Sept. 1, 2015, 6:01 a.m. UTC | #3
On 08/26/2015 08:53 AM, Oleg Endo wrote:
>
> On 26 Aug 2015, at 23:27, Oleg Endo <oleg.endo@t-online.de> wrote:
>
>>
>> On 19 Aug 2015, at 22:35, Jeff Law <law@redhat.com> wrote:
>>
>>> On 08/19/2015 06:29 AM, David Sherwood wrote:
>>>>> I asked Richard S. to give this a once-over which he did.  However, he
>>>>> technically can't approve due to the way his maintainership position was
>>>>> worded.
>>>>>
>>>>> The one request would be a function comment for emit_mode_unit_size and
>>>>> emit_mode_unit_precision.  OK with that change.
>>>> Thanks. Here's a new patch with the comments added.
>>>>
>>>> Good to go?
>>>> David.
>>>>
>>>> ChangeLog:
>>>>
>>>> 2015-08-19  David Sherwood  <david.sherwood@arm.com>
>>>>
>>>> 	gcc/
>>>> 	* genmodes.c (emit_mode_unit_size_inline): New function.
>>>> 	(emit_mode_unit_precision_inline): New function.
>>>> 	(emit_insn_modes_h): Emit new #define.  Emit new functions.
>>>> 	(emit_mode_unit_size): New function.
>>>> 	(emit_mode_unit_precision): New function.
>>>> 	(emit_mode_adjustments): Add mode_unit_size adjustments.
>>>> 	(emit_insn_modes_c): Emit new arrays.
>>>> 	* machmode.h (GET_MODE_UNIT_SIZE, GET_MODE_UNIT_PRECISION): Update to
>>>> 	use new inline methods.
>>>
>>> Thanks, this is OK for the trunk.
>>
>> It seems this broke sh-elf, at least when compiling on OSX with its native clang.
>>
>> ../../gcc-trunk/gcc/machmode.h:228:43: error: redefinition of 'mode_unit_size' with a different type:
>>       'const unsigned char [56]' vs 'unsigned char [56]'
>> extern CONST_MODE_UNIT_SIZE unsigned char mode_unit_size[NUM_MACHINE_MODES];
>>                                           ^
>> ./insn-modes.h:417:24: note: previous definition is here
>>   extern unsigned char mode_unit_size[NUM_MACHINE_MODES];
>>                        ^
>
> This following fixes the problem for me:
>
> Index: gcc/genmodes.c
> ===================================================================
> --- gcc/genmodes.c	(revision 227221)
> +++ gcc/genmodes.c	(working copy)
> @@ -1063,7 +1063,7 @@
>   unsigned char\n\
>   mode_unit_size_inline (machine_mode mode)\n\
>   {\n\
> -  extern unsigned char mode_unit_size[NUM_MACHINE_MODES];\n\
> +  extern CONST_MODE_UNIT_SIZE unsigned char mode_unit_size[NUM_MACHINE_MODES];\n\
>     switch (mode)\n\
>       {");
OK with the usual testing.

jeff
diff mbox

Patch

Index: gcc/genmodes.c
===================================================================
--- gcc/genmodes.c	(revision 227221)
+++ gcc/genmodes.c	(working copy)
@@ -1063,7 +1063,7 @@ 
 unsigned char\n\
 mode_unit_size_inline (machine_mode mode)\n\
 {\n\
-  extern unsigned char mode_unit_size[NUM_MACHINE_MODES];\n\
+  extern CONST_MODE_UNIT_SIZE unsigned char mode_unit_size[NUM_MACHINE_MODES];\n\
   switch (mode)\n\
     {");