public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Iain Sandoe <iain@sandoe.co.uk>
To: Alan Modra <amodra@gmail.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>, "H.J. Lu" <hjl.tools@gmail.com>
Subject: Re: RFC: Changing AC_PROG_CC to AC_PROG_CC_C99 in top level configure
Date: Mon, 10 May 2021 09:49:25 +0100	[thread overview]
Message-ID: <AC83FC9C-1439-4F80-9533-748242E83B56@sandoe.co.uk> (raw)
In-Reply-To: <20210505072052.GA14297@bubble.grove.modra.org>

Alan Modra <amodra@gmail.com> wrote:

> On Wed, May 05, 2021 at 08:05:29AM +0100, Iain Sandoe wrote:
>> Alan Modra via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
>>> diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
>>> index 97d6f3863cb..cc3b1b6d666 100644
>>> --- a/gcc/config/i386/i386.h
>>> +++ b/gcc/config/i386/i386.h
>>> @@ -73,8 +73,8 @@ struct stringop_algs
>>> {
>>>  const enum stringop_alg unknown_size;
>>>  const struct stringop_strategy {
>>> -    const int max;
>>> -    const enum stringop_alg alg;
>>> +    int max;
>>> +    enum stringop_alg alg;
>>>    int noalign;
>>>  } size [MAX_STRINGOP_ALGS];
>>> };
>>
>> does this relate to / fix PR 100246 (which seems to fire for some GCC
>> versions as well
>> as older clang)?
>
> Yes, looks like the same issue.  I started making a similar fix to the
> one you attached to the PR, then laziness kicked in after noticing the
> errors were only given on the const elements.

I added a third variant to the PR (as below), which preserves the const-ness
but provides a CTOR.  TBH, I have no especial preference for the solution,
but it would be nice to commit one of them :-)

cheers
Iain

The condition is because this header gets pulled in by gcov stuff which is  
built
with a C compiler.

diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 97d6f38..a417c93 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -73,6 +73,11 @@ struct stringop_algs
  {
    const enum stringop_alg unknown_size;
    const struct stringop_strategy {
+#ifdef __cplusplus
+    stringop_strategy(int _max = -1, enum stringop_alg _alg = libcall,
+                     int _noalign = false)
+      : max (_max), alg (_alg), noalign (_noalign) {}
+#endif
      const int max;
      const enum stringop_alg alg;
      int noalign;



      parent reply	other threads:[~2021-05-10  8:49 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-26 11:32 Nick Clifton
2021-04-26 19:32 ` Joseph Myers
2021-04-26 20:05   ` Mike Frysinger
2021-04-26 21:31   ` Christian Biesinger
2021-04-27 10:49   ` Nick Clifton
2021-04-27 16:58     ` Joseph Myers
2021-04-30 18:36 ` Simon Marchi
2021-04-30 21:48   ` Jeff Law
2021-05-03  6:28     ` Alan Modra
2021-05-03 14:47       ` Simon Marchi
2021-05-03 16:26         ` Tom Tromey
2021-05-03 21:51         ` Alan Modra
2021-05-03 23:30           ` Simon Marchi
2021-05-04 12:42   ` Nick Clifton
2021-05-04 15:16     ` Simon Marchi
2021-05-05  0:18       ` Alan Modra
2021-05-05  7:05         ` Iain Sandoe
2021-05-05  7:20           ` Alan Modra
2021-05-05  7:23             ` Iain Sandoe
2021-05-10  8:49             ` Iain Sandoe [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AC83FC9C-1439-4F80-9533-748242E83B56@sandoe.co.uk \
    --to=iain@sandoe.co.uk \
    --cc=amodra@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hjl.tools@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).