On 5/23/22 09:56, Iain Buclaw wrote:
> Excerpts from Martin Liška's message of Mai 11, 2022 10:17 am:
>> On 5/9/22 14:03, Richard Biener wrote:
>>> On Thu, May 5, 2022 at 4:30 PM Martin Liška <mli...@suse.cz> wrote:
>>>>
>>>> On 5/5/22 14:58, Iain Buclaw wrote:
>>>>> This D front-end change doesn't look right to me, besides the slight
>>>>
>>>> Hello.
>>>>
>>>> Sorry, I've re-read the patch and fixed some places where the macro usage
>>>> was wrong.
>>>>
>>>> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
>>>
>>> The middle-end parts are OK.  I'd say in files where ARRAY_SIZE is already
>>> used it's OK to introduce more uses.  Otherwise I defer to the more specific
>>> maintainers if they like this or not.
>>
>> All right, CCing the following maintainers for other parts:
>>
>> - David for JIT and Analyzer
>> - Tobias for Fortran part
>> - Jason for C-family part
>>
> 
> Hi Martin,

Hello.

> 
> When running through contrib/config-list.mk, I noticed that this also
> broke the build for the following obsolete targets:

My periodic testers confirm that and I'm going to install the following patch.

Cheers,
Martin

> 
> tilegx-linux-gnu
> tilegxbe-linux-gnu
> tilepro-linux-gnu
> 
> ---
> gcc/config/tilepro/gen-mul-tables.cc: In function ‘void 
> find_sequences(ExpressionTree&, ExpressionTreeMap&)’:
> gcc/config/tilepro/gen-mul-tables.cc:465:26: error: ‘ARRAY_SIZE’ was not 
> declared in this scope
>   465 |   for (size_t f = 0; f < ARRAY_SIZE (ops); f++)
>       |                          ^~~~~~~~~~
> gcc/config/tilepro/gen-mul-tables.cc: In function ‘void 
> create_insn_code_compression_table()’:
> gcc/config/tilepro/gen-mul-tables.cc:567:26: error: ‘ARRAY_SIZE’ was not 
> declared in this scope
>   567 |   for (size_t i = 0; i < ARRAY_SIZE (ops); i++)
>       |                          ^~~~~~~~~~
> ---
From 63798f67dcc848dcd110ce222b97304565c9ea29 Mon Sep 17 00:00:00 2001
From: Martin Liska <mli...@suse.cz>
Date: Mon, 23 May 2022 13:54:53 +0200
Subject: [PATCH] tilepro: fix missing ARRAY_SIZE macro

gcc/ChangeLog:

	* config/tilepro/gen-mul-tables.cc (ARRAY_SIZE): Add new macro.
---
 gcc/config/tilepro/gen-mul-tables.cc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/config/tilepro/gen-mul-tables.cc b/gcc/config/tilepro/gen-mul-tables.cc
index 798766a723b..52183982f65 100644
--- a/gcc/config/tilepro/gen-mul-tables.cc
+++ b/gcc/config/tilepro/gen-mul-tables.cc
@@ -90,6 +90,8 @@ typedef long long MUL_TYPE;
 #define MIN(x, y)  ((x) <= (y) ? (x) : (y))
 #define MAX(x, y)  ((x) >= (y) ? (x) : (y))
 
+#define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0]))
+
 /* For this program a unary op is one which has only one nonconstant
    operand.  So shift left by 5 is considered unary.  */
 typedef MUL_TYPE (*unary_op_func) (MUL_TYPE);
-- 
2.36.1

Reply via email to