This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][4/N] Introduce new inline functions for GET_MODE_UNIT_SIZE and GET_MODE_UNIT_PRECISION
- From: Oleg Endo <oleg dot endo at t-online dot de>
- To: Jeff Law <law at redhat dot com>
- Cc: David Sherwood <david dot sherwood at arm dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 26 Aug 2015 23:53:11 +0900
- Subject: Re: [PATCH][4/N] Introduce new inline functions for GET_MODE_UNIT_SIZE and GET_MODE_UNIT_PRECISION
- Authentication-results: sourceware.org; auth=none
- References: <000101d0d8e1$2c74fcd0$855ef670$ at arm dot com> <55D38638 dot 3050403 at redhat dot com> <000001d0da7a$a261d450$e7257cf0$ at arm dot com> <55D4861D dot 1060907 at redhat dot com> <4627DC74-863C-4B7A-8883-B7C31749A94F at t-online dot de>
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