Re: gcc-12+: D / phobos runtime

2023-09-13 Thread Rainer Orth
ASSI  writes:

> Rainer Orth writes:
>> Just try to configure gcc with --enable-libphobos, which overrides the
>> default of LIBPHOBOS_SUPPORTED.  In quite a number of cases, this just
>> works, but hasn't yet been verified.  You won't know until you try,
>> though.
>
> I did that and it indeed doesn't build.

then please file bugs on https://gcc.gnu.org/bugzilla/ with the details,
otherwise there's nothing to be done.  You can also search Bugzilla for
other reports that match your problems.  Besides, you can also check the
Bugzilla of the upstream Dlang project: https://dlang.org/bugstats.html.
Sometimes, issues have already been reported there, maybe even with a
tentative patch.  GCC's libphobos mostly just imports the upstream code,
primarily integrating it into GCC's build system.

When I ran into libphobos build problems on Solaris in the past, I went
exactly that route.  The GCC D maintainer, Iain Buclaw, has been
extremly helpful in the process of getting things to work, but
ultimately someone with an interest in the affected target, the
necessary knowledge about it and access to the platform to develop and
test fixes will have to do the work.

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


Compilation Error Regarding RID_MAX

2023-09-13 Thread Ken Matsui via Gcc
Hi,

I have merged all my patches into a single branch for better
maintainability for me, but I am unable to build GCC. Initially, I
faced an error related to RID_MAX, which was fixed in
https://github.com/ken-matsui/gcc-gsoc23/commit/c32d49bc990acde4d3ec5654ddb81b0a7d081378.
The ICE was caused by gcc_assert (RID_MAX <= 255) in gcc/c/c-parser.c.
At this point, my new built-in exceeded the max keyword bound since
c_token->keyword has 8 bits. This patch increased the bit size to 16
and compiled GCC successfully.

However, I still encountered an unusual error and am unable to build
GCC on 
https://github.com/ken-matsui/gcc-gsoc23/commit/c32d49bc990acde4d3ec5654ddb81b0a7d081378.
This is the 4th built-in implementation after the previous RID_MAX fix
patch (i.e., this increases the total number of keywords, now RID_MAX
= 260). The error message indicates that there is a missing
parenthesis after 'unsigned' for the expression (unsigned __int128).

/home/kmatsui/gcc/objdir/gcc/include/bmi2intrin.h:86:38: error:
expected ‘)’ before ‘__int128’
   86 |   unsigned __int128 __res = (unsigned __int128) __X * __Y;
  | ~^
  |  )
/home/kmatsui/gcc/objdir/gcc/include/bmi2intrin.h:86:29: error:
initializer element is not constant
   86 |   unsigned __int128 __res = (unsigned __int128) __X * __Y;
  |

I reordered the commits, but it seems that the 4th built-in (RID_MAX =
260) after the RID_MAX tweak fails, regardless of what the 4th is.
(i.e., the __remove_pointer implementation itself is not the reason.)

I have pushed the
branch to https://github.com/ken-matsui/gcc-gsoc23/commits/me/gsoc23.
Could someone please help me inspect the issue and provide your
suggestions?

Sincerely,
Ken Matsui


Re: Compilation Error Regarding RID_MAX

2023-09-13 Thread Andrew Pinski via Gcc
On Wed, Sep 13, 2023 at 9:09 PM Ken Matsui via Gcc  wrote:
>
> Hi,
>
> I have merged all my patches into a single branch for better
> maintainability for me, but I am unable to build GCC. Initially, I
> faced an error related to RID_MAX, which was fixed in
> https://github.com/ken-matsui/gcc-gsoc23/commit/c32d49bc990acde4d3ec5654ddb81b0a7d081378.
> The ICE was caused by gcc_assert (RID_MAX <= 255) in gcc/c/c-parser.c.
> At this point, my new built-in exceeded the max keyword bound since
> c_token->keyword has 8 bits. This patch increased the bit size to 16
> and compiled GCC successfully.
>
> However, I still encountered an unusual error and am unable to build
> GCC on 
> https://github.com/ken-matsui/gcc-gsoc23/commit/c32d49bc990acde4d3ec5654ddb81b0a7d081378.
> This is the 4th built-in implementation after the previous RID_MAX fix
> patch (i.e., this increases the total number of keywords, now RID_MAX
> = 260). The error message indicates that there is a missing
> parenthesis after 'unsigned' for the expression (unsigned __int128).
>
> /home/kmatsui/gcc/objdir/gcc/include/bmi2intrin.h:86:38: error:
> expected ‘)’ before ‘__int128’
>86 |   unsigned __int128 __res = (unsigned __int128) __X * __Y;
>   | ~^
>   |  )
> /home/kmatsui/gcc/objdir/gcc/include/bmi2intrin.h:86:29: error:
> initializer element is not constant
>86 |   unsigned __int128 __res = (unsigned __int128) __X * __Y;
>   |
>
> I reordered the commits, but it seems that the 4th built-in (RID_MAX =
> 260) after the RID_MAX tweak fails, regardless of what the 4th is.
> (i.e., the __remove_pointer implementation itself is not the reason.)

>From c-common.h:
#define C_SET_RID_CODE(id, code) \
  (((struct c_common_identifier *) (id))->node.rid_code = (unsigned char) code)

This is definitely incorrect now. It should be using `unsigned short`.

Thanks,
Andrew

>
> I have pushed the
> branch to https://github.com/ken-matsui/gcc-gsoc23/commits/me/gsoc23.
> Could someone please help me inspect the issue and provide your
> suggestions?
>
> Sincerely,
> Ken Matsui


Re: Compilation Error Regarding RID_MAX

2023-09-13 Thread Andrew Pinski via Gcc
On Wed, Sep 13, 2023 at 9:35 PM Ken Matsui  wrote:
>
> On Wed, Sep 13, 2023 at 9:23 PM Andrew Pinski  wrote:
> >
> > On Wed, Sep 13, 2023 at 9:09 PM Ken Matsui via Gcc  wrote:
> > >
> > > Hi,
> > >
> > > I have merged all my patches into a single branch for better
> > > maintainability for me, but I am unable to build GCC. Initially, I
> > > faced an error related to RID_MAX, which was fixed in
> > > https://github.com/ken-matsui/gcc-gsoc23/commit/c32d49bc990acde4d3ec5654ddb81b0a7d081378.
> > > The ICE was caused by gcc_assert (RID_MAX <= 255) in gcc/c/c-parser.c.
> > > At this point, my new built-in exceeded the max keyword bound since
> > > c_token->keyword has 8 bits. This patch increased the bit size to 16
> > > and compiled GCC successfully.
> > >
> > > However, I still encountered an unusual error and am unable to build
> > > GCC on 
> > > https://github.com/ken-matsui/gcc-gsoc23/commit/c32d49bc990acde4d3ec5654ddb81b0a7d081378.
> > > This is the 4th built-in implementation after the previous RID_MAX fix
> > > patch (i.e., this increases the total number of keywords, now RID_MAX
> > > = 260). The error message indicates that there is a missing
> > > parenthesis after 'unsigned' for the expression (unsigned __int128).
> > >
> > > /home/kmatsui/gcc/objdir/gcc/include/bmi2intrin.h:86:38: error:
> > > expected ‘)’ before ‘__int128’
> > >86 |   unsigned __int128 __res = (unsigned __int128) __X * __Y;
> > >   | ~^
> > >   |  )
> > > /home/kmatsui/gcc/objdir/gcc/include/bmi2intrin.h:86:29: error:
> > > initializer element is not constant
> > >86 |   unsigned __int128 __res = (unsigned __int128) __X * __Y;
> > >   |
> > >
> > > I reordered the commits, but it seems that the 4th built-in (RID_MAX =
> > > 260) after the RID_MAX tweak fails, regardless of what the 4th is.
> > > (i.e., the __remove_pointer implementation itself is not the reason.)
> >
> > From c-common.h:
> > #define C_SET_RID_CODE(id, code) \
> >   (((struct c_common_identifier *) (id))->node.rid_code = (unsigned char) 
> > code)
> >
> > This is definitely incorrect now. It should be using `unsigned short`.
> >
>
> That worked! Thank you so much!
>
> I would like to attribute this change to you, but if you're
> comfortable with it, could you please share the relevant commit
> information (name and email address)?

Andrew Pinski  

Thanks,
Andrew

>
> > Thanks,
> > Andrew
> >
> > >
> > > I have pushed the
> > > branch to https://github.com/ken-matsui/gcc-gsoc23/commits/me/gsoc23.
> > > Could someone please help me inspect the issue and provide your
> > > suggestions?
> > >
> > > Sincerely,
> > > Ken Matsui


Re: Compilation Error Regarding RID_MAX

2023-09-13 Thread Ken Matsui via Gcc
On Wed, Sep 13, 2023 at 9:23 PM Andrew Pinski  wrote:
>
> On Wed, Sep 13, 2023 at 9:09 PM Ken Matsui via Gcc  wrote:
> >
> > Hi,
> >
> > I have merged all my patches into a single branch for better
> > maintainability for me, but I am unable to build GCC. Initially, I
> > faced an error related to RID_MAX, which was fixed in
> > https://github.com/ken-matsui/gcc-gsoc23/commit/c32d49bc990acde4d3ec5654ddb81b0a7d081378.
> > The ICE was caused by gcc_assert (RID_MAX <= 255) in gcc/c/c-parser.c.
> > At this point, my new built-in exceeded the max keyword bound since
> > c_token->keyword has 8 bits. This patch increased the bit size to 16
> > and compiled GCC successfully.
> >
> > However, I still encountered an unusual error and am unable to build
> > GCC on 
> > https://github.com/ken-matsui/gcc-gsoc23/commit/c32d49bc990acde4d3ec5654ddb81b0a7d081378.
> > This is the 4th built-in implementation after the previous RID_MAX fix
> > patch (i.e., this increases the total number of keywords, now RID_MAX
> > = 260). The error message indicates that there is a missing
> > parenthesis after 'unsigned' for the expression (unsigned __int128).
> >
> > /home/kmatsui/gcc/objdir/gcc/include/bmi2intrin.h:86:38: error:
> > expected ‘)’ before ‘__int128’
> >86 |   unsigned __int128 __res = (unsigned __int128) __X * __Y;
> >   | ~^
> >   |  )
> > /home/kmatsui/gcc/objdir/gcc/include/bmi2intrin.h:86:29: error:
> > initializer element is not constant
> >86 |   unsigned __int128 __res = (unsigned __int128) __X * __Y;
> >   |
> >
> > I reordered the commits, but it seems that the 4th built-in (RID_MAX =
> > 260) after the RID_MAX tweak fails, regardless of what the 4th is.
> > (i.e., the __remove_pointer implementation itself is not the reason.)
>
> From c-common.h:
> #define C_SET_RID_CODE(id, code) \
>   (((struct c_common_identifier *) (id))->node.rid_code = (unsigned char) 
> code)
>
> This is definitely incorrect now. It should be using `unsigned short`.
>

That worked! Thank you so much!

I would like to attribute this change to you, but if you're
comfortable with it, could you please share the relevant commit
information (name and email address)?

> Thanks,
> Andrew
>
> >
> > I have pushed the
> > branch to https://github.com/ken-matsui/gcc-gsoc23/commits/me/gsoc23.
> > Could someone please help me inspect the issue and provide your
> > suggestions?
> >
> > Sincerely,
> > Ken Matsui


Re: Compilation Error Regarding RID_MAX

2023-09-13 Thread Ken Matsui via Gcc
On Wed, Sep 13, 2023 at 9:38 PM Andrew Pinski  wrote:
>
> On Wed, Sep 13, 2023 at 9:35 PM Ken Matsui  wrote:
> >
> > On Wed, Sep 13, 2023 at 9:23 PM Andrew Pinski  wrote:
> > >
> > > On Wed, Sep 13, 2023 at 9:09 PM Ken Matsui via Gcc  
> > > wrote:
> > > >
> > > > Hi,
> > > >
> > > > I have merged all my patches into a single branch for better
> > > > maintainability for me, but I am unable to build GCC. Initially, I
> > > > faced an error related to RID_MAX, which was fixed in
> > > > https://github.com/ken-matsui/gcc-gsoc23/commit/c32d49bc990acde4d3ec5654ddb81b0a7d081378.
> > > > The ICE was caused by gcc_assert (RID_MAX <= 255) in gcc/c/c-parser.c.
> > > > At this point, my new built-in exceeded the max keyword bound since
> > > > c_token->keyword has 8 bits. This patch increased the bit size to 16
> > > > and compiled GCC successfully.
> > > >
> > > > However, I still encountered an unusual error and am unable to build
> > > > GCC on 
> > > > https://github.com/ken-matsui/gcc-gsoc23/commit/c32d49bc990acde4d3ec5654ddb81b0a7d081378.
> > > > This is the 4th built-in implementation after the previous RID_MAX fix
> > > > patch (i.e., this increases the total number of keywords, now RID_MAX
> > > > = 260). The error message indicates that there is a missing
> > > > parenthesis after 'unsigned' for the expression (unsigned __int128).
> > > >
> > > > /home/kmatsui/gcc/objdir/gcc/include/bmi2intrin.h:86:38: error:
> > > > expected ‘)’ before ‘__int128’
> > > >86 |   unsigned __int128 __res = (unsigned __int128) __X * __Y;
> > > >   | ~^
> > > >   |  )
> > > > /home/kmatsui/gcc/objdir/gcc/include/bmi2intrin.h:86:29: error:
> > > > initializer element is not constant
> > > >86 |   unsigned __int128 __res = (unsigned __int128) __X * __Y;
> > > >   |
> > > >
> > > > I reordered the commits, but it seems that the 4th built-in (RID_MAX =
> > > > 260) after the RID_MAX tweak fails, regardless of what the 4th is.
> > > > (i.e., the __remove_pointer implementation itself is not the reason.)
> > >
> > > From c-common.h:
> > > #define C_SET_RID_CODE(id, code) \
> > >   (((struct c_common_identifier *) (id))->node.rid_code = (unsigned char) 
> > > code)
> > >
> > > This is definitely incorrect now. It should be using `unsigned short`.
> > >
> >
> > That worked! Thank you so much!
> >
> > I would like to attribute this change to you, but if you're
> > comfortable with it, could you please share the relevant commit
> > information (name and email address)?
>
> Andrew Pinski  
>

Thank you!

> Thanks,
> Andrew
>
> >
> > > Thanks,
> > > Andrew
> > >
> > > >
> > > > I have pushed the
> > > > branch to https://github.com/ken-matsui/gcc-gsoc23/commits/me/gsoc23.
> > > > Could someone please help me inspect the issue and provide your
> > > > suggestions?
> > > >
> > > > Sincerely,
> > > > Ken Matsui