public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/93059] char and char8_t does not talk with each other with memcpy. std::copy std::copy_n, std::fill, std::fill_n, std::uninitialized_copy std::uninitialized_copy_n, std::fill, std::uninitialized_fill_n fails to convert to memxxx functions
       [not found] <bug-93059-4@http.gcc.gnu.org/bugzilla/>
@ 2019-12-29  3:33 ` euloanty at live dot com
  2019-12-31  6:03 ` euloanty at live dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: euloanty at live dot com @ 2019-12-29  3:33 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 260223 bytes --]

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93059

--- Comment #11 from fdlbxtqi <euloanty at live dot com> ---
(In reply to Marc Glisse from comment #8)
> (In reply to fdlbxtqi from comment #6)
> > void copy_char_vector_with_iter(std::vector<char8_t>::iterator
> > out,std::vector<char> const& bits)
> > {
> > 	std::copy_n(bits.begin(),bits.size(),out);
> > }
> > 
> > https://godbolt.org/z/_yA_Ls
> > See the assembly
> 
> Thanks, I just filed PR 93063 about a subpart that the compiler should be
> able to do without help from the library.

TBH. I would rather see the library does the optimization instead of the
compiler. I do not trust the compiler can always optimize this stuff.
>From gcc-bugs-return-664129-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 29 04:15:36 2019
Return-Path: <gcc-bugs-return-664129-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 41935 invoked by alias); 29 Dec 2019 04:15:20 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 41822 invoked by uid 48); 29 Dec 2019 04:15:05 -0000
From: "phdofthehouse at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/93093] New: __builtin_source_location reports values for default arguments not aligned with the Standard
Date: Sun, 29 Dec 2019 04:15:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: phdofthehouse at gmail dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone
Message-ID: <bug-93093-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02199.txt.bz2
Content-length: 2147

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93093

            Bug ID: 93093
           Summary: __builtin_source_location reports values for default
                    arguments not aligned with the Standard
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: phdofthehouse at gmail dot com
  Target Milestone: ---

Consider the following example from the C++ Standard N4842 (nice website
version: eel.is/c++draft/support.srcloc#cons-4):

===========

struct s {
  source_location member = source_location::current();
  int other_member;
  s(source_location loc = source_location::current())
    : member(loc)         // values of member refer to the location of the
calling function ([dcl.fct.default])
  {}
  s(int blather) :        // values of member refer to this location
    other_member(blather)
  {}
  s(double)              // values of member refer to this location
  {}
};
void f(source_location a = source_location::current()) {
  source_location b = source_location::current();       // values in b refer to
this line
}

void g() {
  f();                   // f's first argument corresponds to this line of code

  source_location c = source_location::current();
  f(c);                  // f's first argument gets the same values as c, above
}

===========

When source_location is implemented with __builtin_source_location, code like
the above does not report those locations. s{}.member does not refer to the
calling location, s(2.0).member does not refer to the constructor declaration
s, and s(1).member does not refer to that location, and so forth.

Some talking on IRC revealed that this might be because of constant evaluation
/ constant folding, changing how the source location attribute behaves in
instances like these. This also affects the patch at
https://gcc.gnu.org/ml/gcc-patches/2019-12/msg01579.html whose tests fail in
both static_assert and regular runtime VERIFYs.
>From gcc-bugs-return-664130-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 29 04:28:35 2019
Return-Path: <gcc-bugs-return-664130-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 91575 invoked by alias); 29 Dec 2019 04:28:34 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 91521 invoked by uid 48); 29 Dec 2019 04:28:30 -0000
From: "phdofthehouse at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/12245] [8/9/10 regression] Uses lots of memory when compiling large initialized arrays
Date: Sun, 29 Dec 2019 04:28:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c
X-Bugzilla-Version: 3.3.1
X-Bugzilla-Keywords: memory-hog
X-Bugzilla-Severity: normal
X-Bugzilla-Who: phdofthehouse at gmail dot com
X-Bugzilla-Status: NEW
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P4
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 8.4
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc
Message-ID: <bug-12245-4-mgZl6gbaKV@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-12245-4@http.gcc.gnu.org/bugzilla/>
References: <bug-12245-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02200.txt.bz2
Content-length: 1135

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=12245

JeanHeyd Meneide <phdofthehouse at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |phdofthehouse at gmail dot com

--- Comment #75 from JeanHeyd Meneide <phdofthehouse at gmail dot com> ---
I would like to add to this post. I experience severe memory usage and
compilation time consumption that ramps up heavily when dealing with binary
data. I documented much of my struggles here:

https://thephd.github.io/embed-the-details

I am being told that the functionality I am developing is more suited for a bug
report and that this should be compiler QoI. Upon attempting to file this bug,
I decided to throw my own data and woes into the ring here.

Is there a place I should start looking to help out with this? I would like to
start getting closer to the theoretical near-perfect overhead of dealing with
what essentially ends up being a large binary payload, without resorting to
#embed or any special builtins.
>From gcc-bugs-return-664131-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 29 04:37:18 2019
Return-Path: <gcc-bugs-return-664131-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 102180 invoked by alias); 29 Dec 2019 04:37:18 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 102132 invoked by uid 48); 29 Dec 2019 04:37:14 -0000
From: "euloanty at live dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/93059] char and char8_t does not talk with each other with memcpy. std::copy std::copy_n, std::fill, std::fill_n, std::uninitialized_copy std::uninitialized_copy_n, std::fill, std::uninitialized_fill_n fails to convert to memxxx functions
Date: Sun, 29 Dec 2019 04:37:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: euloanty at live dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-93059-4-aeg3Jbf3tY@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93059-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93059-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02201.txt.bz2
Content-length: 804

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93059

--- Comment #12 from fdlbxtqi <euloanty at live dot com> ---
(In reply to Marc Glisse from comment #8)
> (In reply to fdlbxtqi from comment #6)
> > void copy_char_vector_with_iter(std::vector<char8_t>::iterator
> > out,std::vector<char> const& bits)
> > {
> > 	std::copy_n(bits.begin(),bits.size(),out);
> > }
> > 
> > https://godbolt.org/z/_yA_Ls
> > See the assembly
> 
> Thanks, I just filed PR 93063 about a subpart that the compiler should be
> able to do without help from the library.

I think the implementation is still problematic since C++ 20 adds the
contiguous_iterator concept. The current implementation looks not to allow
custom 
 contiguous iterators types to be optimized as memmove.

It needs certain kinds of revamping IMO.
>From gcc-bugs-return-664132-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 29 08:22:23 2019
Return-Path: <gcc-bugs-return-664132-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 45111 invoked by alias); 29 Dec 2019 08:22:22 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 45072 invoked by uid 48); 29 Dec 2019 08:22:16 -0000
From: "glisse at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/93059] char and char8_t does not talk with each other with memcpy. std::copy std::copy_n, std::fill, std::fill_n, std::uninitialized_copy std::uninitialized_copy_n, std::fill, std::uninitialized_fill_n fails to convert to memxxx functions
Date: Sun, 29 Dec 2019 08:22:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: glisse at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-93059-4-gBNmpddodN@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93059-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93059-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02202.txt.bz2
Content-length: 350

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93059

--- Comment #13 from Marc Glisse <glisse at gcc dot gnu.org> ---
(In reply to fdlbxtqi from comment #11)
> TBH. I would rather see the library does the optimization instead of the
> compiler. I do not trust the compiler can always optimize this stuff.

If we have both, that looks even safer ;-)
>From gcc-bugs-return-664133-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 29 08:30:59 2019
Return-Path: <gcc-bugs-return-664133-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 94436 invoked by alias); 29 Dec 2019 08:30:52 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 94217 invoked by uid 55); 29 Dec 2019 08:30:28 -0000
From: "euloanty at live dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/93059] char and char8_t does not talk with each other with memcpy. std::copy std::copy_n, std::fill, std::fill_n, std::uninitialized_copy std::uninitialized_copy_n, std::fill, std::uninitialized_fill_n fails to convert to memxxx functions
Date: Sun, 29 Dec 2019 08:30:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: euloanty at live dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-93059-4-G0apmc55wv@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93059-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93059-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02203.txt.bz2
Content-length: 1348

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93059

--- Comment #14 from fdlbxtqi <euloanty at live dot com> ---
I think It is worth the effort to rewrite these functions since they are so
fundamental to the performance of entire C++. What I am worry about is that
whether revamping these functions would be a new ABI breaking.

If it won’t, I would like to contribute my implementation.

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: glisse at gcc dot gnu.org<mailto:gcc-bugzilla@gcc.gnu.org>
Sent: Sunday, December 29, 2019 03:22
To: euloanty@live.com<mailto:euloanty@live.com>
Subject: [Bug libstdc++/93059] char and char8_t does not talk with each other
with memcpy. std::copy std::copy_n, std::fill, std::fill_n,
std::uninitialized_copy std::uninitialized_copy_n, std::fill,
std::uninitialized_fill_n fails to convert to memxxx functions

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93059

--- Comment #13 from Marc Glisse <glisse at gcc dot gnu.org> ---
(In reply to fdlbxtqi from comment #11)
> TBH. I would rather see the library does the optimization instead of the
> compiler. I do not trust the compiler can always optimize this stuff.

If we have both, that looks even safer ;-)

--
You are receiving this mail because:
You are on the CC list for the bug.
You reported the bug.
>From gcc-bugs-return-664134-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 29 08:34:05 2019
Return-Path: <gcc-bugs-return-664134-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 96708 invoked by alias); 29 Dec 2019 08:34:04 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 96608 invoked by uid 48); 29 Dec 2019 08:33:58 -0000
From: "euloanty at live dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/93059] char and char8_t does not talk with each other with memcpy. std::copy std::copy_n, std::fill, std::fill_n, std::uninitialized_copy std::uninitialized_copy_n, std::fill, std::uninitialized_fill_n fails to convert to memxxx functions
Date: Sun, 29 Dec 2019 08:34:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: euloanty at live dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-93059-4-qhywgMXsY3@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93059-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93059-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02204.txt.bz2
Content-length: 1781

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93059

--- Comment #15 from fdlbxtqi <euloanty at live dot com> ---
(In reply to fdlbxtqi from comment #14)
> I think It is worth the effort to rewrite these functions since they are so
> fundamental to the performance of entire C++. What I am worry about is that
> whether revamping these functions would be a new ABI breaking.
> 
> If it won’t, I would like to contribute my implementation.
> 
> Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
> 
> From: glisse at gcc dot gnu.org<mailto:gcc-bugzilla@gcc.gnu.org>
> Sent: Sunday, December 29, 2019 03:22
> To: euloanty@live.com<mailto:euloanty@live.com>
> Subject: [Bug libstdc++/93059] char and char8_t does not talk with each
> other with memcpy. std::copy std::copy_n, std::fill, std::fill_n,
> std::uninitialized_copy std::uninitialized_copy_n, std::fill,
> std::uninitialized_fill_n fails to convert to memxxx functions
> 
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93059
> 
> --- Comment #13 from Marc Glisse <glisse at gcc dot gnu.org> ---
> (In reply to fdlbxtqi from comment #11)
> > TBH. I would rather see the library does the optimization instead of the
> > compiler. I do not trust the compiler can always optimize this stuff.
> 
> If we have both, that looks even safer ;-)
> 
> --
> You are receiving this mail because:
> You are on the CC list for the bug.
> You reported the bug.

I think It is worth the effort to rewrite these functions since they are so
fundamental to the performance of entire C++. Revamping them would create 100%
of performance benefits in a lot of important benchmarks. What I am worried
about is that whether revamping these functions would be a new wave of ABI
breaking.
>From gcc-bugs-return-664135-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 29 08:44:19 2019
Return-Path: <gcc-bugs-return-664135-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 109258 invoked by alias); 29 Dec 2019 08:44:18 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 109214 invoked by uid 48); 29 Dec 2019 08:44:13 -0000
From: "euloanty at live dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/93059] char and char8_t does not talk with each other with memcpy. std::copy std::copy_n, std::fill, std::fill_n, std::uninitialized_copy std::uninitialized_copy_n, std::fill, std::uninitialized_fill_n fails to convert to memxxx functions
Date: Sun, 29 Dec 2019 08:44:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: euloanty at live dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-93059-4-di13NnREib@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93059-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93059-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02205.txt.bz2
Content-length: 445

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93059

--- Comment #16 from fdlbxtqi <euloanty at live dot com> ---
(In reply to Marc Glisse from comment #13)
> (In reply to fdlbxtqi from comment #11)
> > TBH. I would rather see the library does the optimization instead of the
> > compiler. I do not trust the compiler can always optimize this stuff.
> 
> If we have both, that looks even safer ;-)

Concepts are no doubt a huge deal breaker.
>From gcc-bugs-return-664136-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 29 10:21:10 2019
Return-Path: <gcc-bugs-return-664136-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 45811 invoked by alias); 29 Dec 2019 10:21:10 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 45762 invoked by uid 48); 29 Dec 2019 10:21:05 -0000
From: "glisse at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/93059] char and char8_t does not talk with each other with memcpy. std::copy std::copy_n, std::fill, std::fill_n, std::uninitialized_copy std::uninitialized_copy_n, std::fill, std::uninitialized_fill_n fails to convert to memxxx functions
Date: Sun, 29 Dec 2019 10:21:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: glisse at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-93059-4-TNFkDMvWqG@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93059-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93059-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02206.txt.bz2
Content-length: 405

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93059

--- Comment #17 from Marc Glisse <glisse at gcc dot gnu.org> ---
(In reply to fdlbxtqi from comment #15)
> What I am worried about is that whether revamping these functions would be a new wave of ABI breaking.

I don't foresee any ABI issue here. Do make sure your code doesn't break with
-std=c++03, and run the testsuite before submitting it.
>From gcc-bugs-return-664137-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 29 11:04:03 2019
Return-Path: <gcc-bugs-return-664137-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 84642 invoked by alias); 29 Dec 2019 11:04:03 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 84561 invoked by uid 55); 29 Dec 2019 11:03:57 -0000
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/93078] Missing fma and round functions auto-vectorization with x86-64 (sse2)
Date: Sun, 29 Dec 2019 11:04:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 9.2.0
X-Bugzilla-Keywords: missed-optimization
X-Bugzilla-Severity: normal
X-Bugzilla-Who: jakub at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-93078-4-hSQyKpP6z7@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93078-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93078-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02207.txt.bz2
Content-length: 1179

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93078

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Sun Dec 29 11:03:25 2019
New Revision: 279754

URL: https://gcc.gnu.org/viewcvs?rev=279754&root=gcc&view=rev
Log:
        PR target/93078
        * config/i386/i386-builtins.c (ix86_builtin_vectorized_function):
        Remove CASE_CFN_RINT handling.
        * config/i386/i386-builtin.def (IX86_BUILTIN_RINTPD,
        IX86_BUILTIN_RINTPS, IX86_BUILTIN_RINTPD256, IX86_BUILTIN_RINTPS256):
        Remove.
        * config/i386/sse.md (nearbyint<mode>2, rint<mode>2): New expanders
        with VF iterator.

        * gcc.target/i386/sse4_1-pr93078.c: New test.
        * gcc.target/i386/avx-pr93078.c: New test.
        * gcc.target/i386/avx512f-pr93078.c: New test.

Added:
    trunk/gcc/testsuite/gcc.target/i386/avx-pr93078.c
    trunk/gcc/testsuite/gcc.target/i386/avx512f-pr93078.c
    trunk/gcc/testsuite/gcc.target/i386/sse4_1-pr93078.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/i386/i386-builtin.def
    trunk/gcc/config/i386/i386-builtins.c
    trunk/gcc/config/i386/sse.md
    trunk/gcc/testsuite/ChangeLog
>From gcc-bugs-return-664138-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 29 11:49:19 2019
Return-Path: <gcc-bugs-return-664138-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 54019 invoked by alias); 29 Dec 2019 11:49:10 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 53862 invoked by uid 48); 29 Dec 2019 11:48:42 -0000
From: "tkoenig at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/91310] Read overflow generated by character array assignment to self
Date: Sun, 29 Dec 2019 11:49:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 9.1.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: tkoenig at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc
Message-ID: <bug-91310-4-j6pYTAFOni@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-91310-4@http.gcc.gnu.org/bugzilla/>
References: <bug-91310-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02208.txt.bz2
Content-length: 1059

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91310

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tkoenig at gcc dot gnu.org

--- Comment #5 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
Just going through the test cases...

Test case number 1 is invalid.

F2018, 9.4.1:

3 Let the characters in the parent string be numbered 1, 2, 3, ..., n, where n
is the length of the parent string.
Then the characters in the substring are those from the parent string from the
starting point and proceeding in
sequence up to and including the ending point. If the starting point is greater
than the ending point, the substring
has length zero; otherwise, both the starting point and the ending point shall
be within the range 1, 2, ..., n. If
the starting point is not specified, the default value is 1. If the ending
point is not specified, the default value is
n.
>From gcc-bugs-return-664139-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 29 11:56:14 2019
Return-Path: <gcc-bugs-return-664139-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 62433 invoked by alias); 29 Dec 2019 11:56:12 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 62409 invoked by uid 48); 29 Dec 2019 11:56:09 -0000
From: "tkoenig at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/91310] Read overflow generated by character array assignment to self
Date: Sun, 29 Dec 2019 11:56:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 9.1.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: tkoenig at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-91310-4-z5RLUPD3Sw@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-91310-4@http.gcc.gnu.org/bugzilla/>
References: <bug-91310-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02209.txt.bz2
Content-length: 358

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91310

--- Comment #6 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
Comment on attachment 46648
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46648
test case 1

Oops, correction. If len is small enough, the test case can be
valid (well, it could be if str was ever assigned).

Digging further...
>From gcc-bugs-return-664140-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 29 12:30:54 2019
Return-Path: <gcc-bugs-return-664140-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 94781 invoked by alias); 29 Dec 2019 12:30:54 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 94724 invoked by uid 48); 29 Dec 2019 12:30:49 -0000
From: "tkoenig at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/91310] Read overflow generated by character array assignment to self
Date: Sun, 29 Dec 2019 12:30:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 9.1.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: tkoenig at gcc dot gnu.org
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Resolution: INVALID
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status resolution
Message-ID: <bug-91310-4-nPCjliEoAe@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-91310-4@http.gcc.gnu.org/bugzilla/>
References: <bug-91310-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02210.txt.bz2
Content-length: 581

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91310

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #7 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
OK, so finally:

If len + 3 > 512, _then_ the test case is invalid.

It would be nice to add bounds checking for that case, but
that's another kettle if fish.
>From gcc-bugs-return-664141-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 29 12:54:33 2019
Return-Path: <gcc-bugs-return-664141-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 9433 invoked by alias); 29 Dec 2019 12:54:32 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 9399 invoked by uid 48); 29 Dec 2019 12:54:28 -0000
From: "euloanty at live dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/93059] char and char8_t does not talk with each other with memcpy. std::copy std::copy_n, std::fill, std::fill_n, std::uninitialized_copy std::uninitialized_copy_n, std::fill, std::uninitialized_fill_n fails to convert to memxxx functions
Date: Sun, 29 Dec 2019 12:54:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: euloanty at live dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-93059-4-n5xqwAtRsd@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93059-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93059-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02211.txt.bz2
Content-length: 678

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93059

--- Comment #18 from fdlbxtqi <euloanty at live dot com> ---
(In reply to Marc Glisse from comment #17)
> (In reply to fdlbxtqi from comment #15)
> > What I am worried about is that whether revamping these functions would be a new wave of ABI breaking.
> 
> I don't foresee any ABI issue here. Do make sure your code doesn't break
> with -std=c++03, and run the testsuite before submitting it.

Also, I have found another bug??? in both libstdc++ and libc++????

memmove is not allowed for using volatile. Only MSVC passes the test.

libstdc++&libc++ are wrong.

https://godbolt.org/z/FoTCbk

I will fix this as well.
>From gcc-bugs-return-664142-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 29 13:58:47 2019
Return-Path: <gcc-bugs-return-664142-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 116622 invoked by alias); 29 Dec 2019 13:58:47 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 116593 invoked by uid 48); 29 Dec 2019 13:58:43 -0000
From: "asolokha at gmx dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/93094] New: [10 Regression] ICE in maybe_gen_insn, at optabs.c:7433
Date: Sun, 29 Dec 2019 13:58:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: rtl-optimization
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: asolokha at gmx dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter target_milestone cf_gcctarget
Message-ID: <bug-93094-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02212.txt.bz2
Content-length: 2589

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93094

            Bug ID: 93094
           Summary: [10 Regression] ICE in maybe_gen_insn, at
                    optabs.c:7433
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---
            Target: x86_64-unknown-linux-gnu

gcc-10.0.0-alpha20191222 snapshot (r279712) ICEs when compiling the following
testcase w/ -mavx512bw -O3 -fno-tree-pre:

void
ll (char *un, char *rr, int te, int fp, int nb)
{
  const int xe = nb & 1;

  while (fp-- != 0)
    {
      if ((rr[0] & xe) == 0)
        un[0] = 0;

      un += te;
      rr += te;
    }
}

% x86_64-unknown-linux-gnu-gcc-10.0.0-alpha20191222 -mavx512bw -O3
-fno-tree-pre -c rgldkcen.c
during RTL pass: expand
rgldkcen.c: In function 'll':
rgldkcen.c:9:15: internal compiler error: in maybe_gen_insn, at optabs.c:7433
    9 |         un[0] = 0;
      |         ~~~~~~^~~
0x65fcb3 maybe_gen_insn(insn_code, unsigned int, expand_operand*)
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191222/work/gcc-10-20191222/gcc/optabs.c:7433
0xc329db maybe_expand_insn(insn_code, unsigned int, expand_operand*)
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191222/work/gcc-10-20191222/gcc/optabs.c:7477
0xc329db expand_insn(insn_code, unsigned int, expand_operand*)
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191222/work/gcc-10-20191222/gcc/optabs.c:7508
0xaf75ee expand_mask_store_optab_fn
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191222/work/gcc-10-20191222/gcc/internal-fn.c:2542
0x8c9ebe expand_call_stmt
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191222/work/gcc-10-20191222/gcc/cfgexpand.c:2609
0x8c9ebe expand_gimple_stmt_1
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191222/work/gcc-10-20191222/gcc/cfgexpand.c:3679
0x8c9ebe expand_gimple_stmt
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191222/work/gcc-10-20191222/gcc/cfgexpand.c:3844
0x8ce352 expand_gimple_basic_block
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191222/work/gcc-10-20191222/gcc/cfgexpand.c:5884
0x8d02e3 execute
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191222/work/gcc-10-20191222/gcc/cfgexpand.c:6539
>From gcc-bugs-return-664143-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 29 14:53:58 2019
Return-Path: <gcc-bugs-return-664143-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 64542 invoked by alias); 29 Dec 2019 14:53:58 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 64499 invoked by uid 48); 29 Dec 2019 14:53:54 -0000
From: "euloanty at live dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/93059] char and char8_t does not talk with each other with memcpy. std::copy std::copy_n, std::fill, std::fill_n, std::uninitialized_copy std::uninitialized_copy_n, std::fill, std::uninitialized_fill_n fails to convert to memxxx functions
Date: Sun, 29 Dec 2019 14:53:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: euloanty at live dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: attachments.created
Message-ID: <bug-93059-4-jTZzs8tHlg@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93059-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93059-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02213.txt.bz2
Content-length: 721

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93059

--- Comment #19 from fdlbxtqi <euloanty at live dot com> ---
Created attachment 47559
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47559&action=edit
An untested patch

From 1dfd714e1f29e229d69a0c7f6f84bf05dd4ee85d Mon Sep 17 00:00:00 2001
From: expnkx <unlvsur@live.com>
Date: Sun, 29 Dec 2019 09:49:19 -0500
Subject: [PATCH] Untested patch fix volatile bug of std::copyXXX and
 std::uninitialized_copyXXX Support custom contiguous_iterator Fix undefined
 behavior of &*end constexpr std::fill Greatly improve performance of
 std::copyXXX and std::uninitialized_copyXX for different types and apply
 pipeline optimization to reduce branch misprediction
>From gcc-bugs-return-664146-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 29 15:06:56 2019
Return-Path: <gcc-bugs-return-664146-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 86350 invoked by alias); 29 Dec 2019 15:06:55 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 85675 invoked by uid 48); 29 Dec 2019 15:06:49 -0000
From: "euloanty at live dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/93059] char and char8_t does not talk with each other with memcpy. std::copy std::copy_n, std::fill, std::fill_n, std::uninitialized_copy std::uninitialized_copy_n, std::fill, std::uninitialized_fill_n fails to convert to memxxx functions
Date: Sun, 29 Dec 2019 15:06:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: euloanty at live dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-93059-4-c2iqaXU99g@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93059-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93059-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02215.txt.bz2
Content-length: 12603

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93059

--- Comment #22 from fdlbxtqi <euloanty at live dot com> ---
Comment on attachment 47559
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47559
An untested patch

>From 1dfd714e1f29e229d69a0c7f6f84bf05dd4ee85d Mon Sep 17 00:00:00 2001
>From: expnkx <unlvsur@live.com>
>Date: Sun, 29 Dec 2019 09:49:19 -0500
>Subject: [PATCH] Untested patch fix volatile bug of std::copyXXX and
> std::uninitialized_copyXXX Support custom contiguous_iterator Fix undefined
> behavior of &*end constexpr std::fill Greatly improve performance of
> std::copyXXX and std::uninitialized_copyXX for different types and apply
> pipeline optimization to reduce branch misprediction
>
>---
> libstdc++-v3/include/bits/stl_algobase.h | 170 ++++++++++++++++++++---
> 1 file changed, 148 insertions(+), 22 deletions(-)
>
>diff --git a/libstdc++-v3/include/bits/stl_algobase.h b/libstdc++-v3/include/bits/stl_algobase.h
>index 40d056ae8d5..01672a8f232 100644
>--- a/libstdc++-v3/include/bits/stl_algobase.h
>+++ b/libstdc++-v3/include/bits/stl_algobase.h
>@@ -1,6 +1,6 @@
> // Core algorithmic facilities -*- C++ -*-
> 
>-// Copyright (C) 2001-2019 Free Software Foundation, Inc.
>+// Copyright (C) 2001-2020 Free Software Foundation, Inc.
> //
> // This file is part of the GNU ISO C++ Library.  This library is free
> // software; you can redistribute it and/or modify it under the
>@@ -84,10 +84,37 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>    * A constexpr wrapper for __builtin_memmove.
>    * @param __num The number of elements of type _Tp (not bytes).
>    */
>+#ifndef __cpp_lib_concepts
>   template<bool _IsMove, typename _Tp>
>+  _GLIBCXX14_CONSTEXPR
>+    inline void volatile*
>+    __memmove(_Tp volatile* __dst, _Tp volatile const* __src, size_t __num)
>+    {
>+	  for(; __num > 0; --__num)
>+	    {
>+#if __cplusplus >= 201103L
>+	      if constexpr (_IsMove)
>+		*__dst = std::move(*__src);
>+	      else
>+#endif
>+		*__dst = *__src;
>+	      ++__src;
>+	      ++__dst;
>+	    }
>+	  return __dst;
>+    }
>+#endif
>+  template<bool _IsMove, typename _Tp,typename _Tp_src>
>+/*
>+#ifdef __cpp_lib_concepts
>+    requires (is_trivially_copyable_v<_Tp>&&!is_volatile_v<_Tp>
>+      &&is_trivially_copyable_v<_Tp_src>&&!is_volatile_v<_Tp_src>
>+      &&(same_as<_Tp,_Tp_src>||(sizeof(_Tp)==sizeof(_Tp_src)&&integral<_Tp>&&integral<_Tp_src>)))
>+#endif
>+*/
>     _GLIBCXX14_CONSTEXPR
>     inline void*
>-    __memmove(_Tp* __dst, const _Tp* __src, size_t __num)
>+    __memmove(_Tp* __dst, _Tp_src const* __src, size_t __num)
>     {
> #ifdef __cpp_lib_is_constant_evaluated
>       if (std::is_constant_evaluated())
>@@ -106,9 +133,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>       else
> #endif
> 	return __builtin_memmove(__dst, __src, sizeof(_Tp) * __num);
>-      return __dst;
>     }
>-
>   /*
>    * A constexpr wrapper for __builtin_memcmp.
>    * @param __num The number of elements of type _Tp (not bytes).
>@@ -431,7 +456,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> 	}
>     };
> #endif
>-
>+#ifndef __cpp_lib_concepts
>   template<bool _IsMove>
>     struct __copy_move<_IsMove, true, random_access_iterator_tag>
>     {
>@@ -448,12 +473,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> 	  static_assert( __assignable::type::value, "type is not assignable" );
> #endif
> 	  const ptrdiff_t _Num = __last - __first;
>-	  if (_Num)
>-	    std::__memmove<_IsMove>(__result, __first, _Num);
>+	  if (!_Num)
>+  	  return __result + _Num;
>+//since before C++20, we do not have [[likely]] attribute. We need to do it manually
>+    std::__memmove<_IsMove>(__result, __first, _Num);
> 	  return __result + _Num;
> 	}
>     };
>-
>+#endif
>   // Helpers for streambuf iterators (either istream or ostream).
>   // NB: avoid including <iosfwd>, relatively large.
>   template<typename _CharT>
>@@ -491,11 +518,41 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>       typedef typename iterator_traits<_II>::value_type _ValueTypeI;
>       typedef typename iterator_traits<_OI>::value_type _ValueTypeO;
>       typedef typename iterator_traits<_II>::iterator_category _Category;
>+#ifdef __cpp_lib_concepts
>+      if constexpr(
>+          ((!is_volatile_v<std::remove_reference_t<decltype(*__first)>>)&&
>+          is_trivially_copyable_v<_ValueTypeI>)&&
>+          ((!is_volatile_v<std::remove_reference_t<decltype(*__result)>>)&&
>+          is_trivially_copyable_v<_ValueTypeO>)&&
>+          contiguous_iterator<_II>&&
>+          contiguous_iterator<_OI>&&
>+          (same_as<_ValueTypeI,_ValueTypeO>
>+          ||(integral<_ValueTypeI>&&integral<_ValueTypeO>&&
>+              sizeof(_ValueTypeI)==sizeof(_ValueTypeO))))
>+      {
>+        using __assignable = conditional<_IsMove,
>+                 is_move_assignable<_OI>,
>+                is_copy_assignable<_OI>>;
>+        static_assert( __assignable::type::value, "result type is not assignable" );
>+        ptrdiff_t const _Num = __last - __first;
>+        if (_Num)
>+#ifdef __has_cpp_attribute(likely)
>+//This if statement is by default bad since it affects CPU pipeline.
>+//needs likely attribute or the branch misprediction penalty (100% misprediction rate probably) is HUGE
>+        [[likely]]
>+#endif
>+          std::__memmove<_IsMove>(to_address(__result), to_address(__first), _Num);
>+        return __result + _Num;
>+      }
>+      else
>+      return std::__copy_move<_IsMove, false,
>+#else
>       const bool __simple = (__is_trivially_copyable(_ValueTypeI)
> 			     && __is_pointer<_II>::__value
> 			     && __is_pointer<_OI>::__value
> 			     && __are_same<_ValueTypeI, _ValueTypeO>::__value);
>       return std::__copy_move<_IsMove, __simple,
>+#endif
> 			      _Category>::__copy_m(__first, __last, __result);
>     }
> 
>@@ -581,6 +638,7 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
>    *  Note that the end of the output range is permitted to be contained
>    *  within [first,last).
>   */
>+
>   template<typename _II, typename _OI>
>     _GLIBCXX20_CONSTEXPR
>     inline _OI
>@@ -595,7 +653,6 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
>       return std::__copy_move_a<__is_move_iterator<_II>::__value>
> 	     (std::__miter_base(__first), std::__miter_base(__last), __result);
>     }
>-
> #if __cplusplus >= 201103L
>   /**
>    *  @brief Moves the range [first,last) into result.
>@@ -698,6 +755,7 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
>     };
> #endif
> 
>+#ifndef __cpp_lib_concepts
>   template<bool _IsMove>
>     struct __copy_move_backward<_IsMove, true, random_access_iterator_tag>
>     {
>@@ -714,11 +772,13 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
> 	  static_assert( __assignable::type::value, "type is not assignable" );
> #endif
> 	  const ptrdiff_t _Num = __last - __first;
>-	  if (_Num)
>-	    std::__memmove<_IsMove>(__result - _Num, __first, _Num);
>+	  if (!_Num)
>+      return __result - _Num;
>+    std::__memmove<_IsMove>(__result - _Num, __first, _Num);
> 	  return __result - _Num;
> 	}
>     };
>+#endif
> 
>   template<bool _IsMove, typename _BI1, typename _BI2>
>     _GLIBCXX20_CONSTEXPR
>@@ -728,21 +788,56 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
>       typedef typename iterator_traits<_BI1>::value_type _ValueType1;
>       typedef typename iterator_traits<_BI2>::value_type _ValueType2;
>       typedef typename iterator_traits<_BI1>::iterator_category _Category;
>-      const bool __simple = (__is_trivially_copyable(_ValueType1)
>-			     && __is_pointer<_BI1>::__value
>-			     && __is_pointer<_BI2>::__value
>-			     && __are_same<_ValueType1, _ValueType2>::__value);
>-
> #ifdef __cpp_lib_is_constant_evaluated
>       if (std::is_constant_evaluated())
>-	return std::__copy_move_backward<true, false,
>+      	return std::__copy_move_backward<true, false,
> 			      _Category>::__copy_move_b(__first, __last,
> 							__result);
>+      else
>+      {
> #endif
>+#if __cpp_lib_concepts 
>+      if constexpr(
>+          ((!is_volatile_v<std::remove_reference_t<decltype(*__first)>>)&&
>+          is_trivially_copyable_v<_ValueType1>)&&
>+          ((!is_volatile_v<std::remove_reference_t<decltype(*__result)>>)&&
>+          is_trivially_copyable_v<_ValueType2>)&&
>+          contiguous_iterator<_BI1>&&
>+          contiguous_iterator<_BI2>&&
>+          (same_as<_ValueType1,_ValueType2>
>+          ||(integral<_ValueType1>&&integral<_ValueType2>&&
>+              sizeof(_ValueType1)==sizeof(_ValueType2))))
>+      {
>+        using __assignable = conditional<_IsMove,
>+                is_move_assignable<_ValueType2>,
>+                is_copy_assignable<_ValueType2>>;
>+        // trivial types can have deleted assignment
>+        static_assert( __assignable::type::value, "type is not assignable" );
>+        ptrdiff_t const _Num = __last - __first;
>+        if (_Num)
>+          #ifdef __has_cpp_attribute(likely)
>+            [[likely]]
>+          #endif
>+          std::__memmove<_IsMove>(to_address(__result) - _Num, to_address(__first), _Num);
>+        return __result - _Num; 
>+      }
>+#else
>+      const bool __simple = (
>+#if __cplusplus >= 201103L
>+        (!is_volatile<typename std::remove_reference<decltype(*__first)>::type>::value)&&
>+#endif
>+        __is_trivially_copyable(_ValueType1)
>+			     && __is_pointer<_BI1>::__value
>+			     && __is_pointer<_BI2>::__value
>+			     && __are_same<_ValueType1, _ValueType2>::__value);
>       return std::__copy_move_backward<_IsMove, __simple,
> 				       _Category>::__copy_move_b(__first,
> 								 __last,
> 								 __result);
>+#endif
>+#ifdef __cpp_lib_is_constant_evaluated
>+      }
>+#endif
>     }
> 
>   template<bool _IsMove, typename _BI1, typename _BI2>
>@@ -908,16 +1003,33 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
>     }
> 
>   // Specialization: for char types we can use memset.
>+
>   template<typename _Tp>
>+    _GLIBCXX20_CONSTEXPR
>     inline typename
>     __gnu_cxx::__enable_if<__is_byte<_Tp>::__value, void>::__type
>     __fill_a1(_Tp* __first, _Tp* __last, const _Tp& __c)
>     {
>-      const _Tp __tmp = __c;
>+      _Tp const __tmp = __c;
>+#ifdef __cpp_lib_is_constant_evaluated
>+    if (std::is_constant_evaluated())
>+    {
>+      for (; __first != __last; ++__first)
>+	*__first = __tmp;
>+    }
>+    else
>+    {
>+#endif
>       if (const size_t __len = __last - __first)
>+#ifdef __has_cpp_attribute(likely)
>+        [[likely]]
>+#endif
> 	__builtin_memset(__first, static_cast<unsigned char>(__tmp), __len);
>+#ifdef __cpp_lib_is_constant_evaluated
>     }
>-
>+#endif
>+    }
>+#ifndef __cpp_lib_concepts
>   template<typename _Ite, typename _Cont, typename _Tp>
>     _GLIBCXX20_CONSTEXPR
>     inline void
>@@ -925,7 +1037,7 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
> 	      ::__gnu_cxx::__normal_iterator<_Ite, _Cont> __last,
> 	      const _Tp& __value)
>     { std::__fill_a1(__first.base(), __last.base(), __value); }
>-
>+#endif
>   template<typename _Tp, typename _VTp>
>     void
>     __fill_a1(const _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Tp&, _Tp*>&,
>@@ -936,7 +1048,14 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
>     _GLIBCXX20_CONSTEXPR
>     inline void
>     __fill_a(_FIte __first, _FIte __last, const _Tp& __value)
>-    { std::__fill_a1(__first, __last, __value); }
>+    {
>+#ifdef __cpp_lib_concepts
>+      if constexpr(contiguous_iterator<_FIte>)
>+        std::__fill_a1(to_address(__first), to_address(__last), __value);
>+      else
>+#endif
>+        std::__fill_a1(__first, __last, __value);
>+    }
> 
>   template<typename _Ite, typename _Seq, typename _Cat, typename _Tp>
>     void
>@@ -1306,6 +1425,9 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
> 	  const size_t __len1 = __last1 - __first1;
> 	  const size_t __len2 = __last2 - __first2;
> 	  if (const size_t __len = std::min(__len1, __len2))
>+#ifdef __has_cpp_attribute(likely)
>+        [[likely]]
>+#endif
> 	    if (int __result = std::__memcmp(__first1, __first2, __len))
> 	      return __result < 0;
> 	  return __len1 < __len2;
>@@ -1733,7 +1855,11 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO
> 		if (__len)
> 		  {
> 		    const auto __c
>-		      = __builtin_memcmp(&*__first1, &*__first2, __len) <=> 0;
>+		      = __builtin_memcmp(to_address(__first1), to_address(__first2), __len) <=> 0;
>+//&*__first1 is not correct and would crash program. Must use to_address()
>+//since a lot of debugging iterator would not be allowed to dereference __first2.
>+//It is undefined behavior to derefernce sentinal iterators
>+//For example, VC's implementation
> 		    if (__c != 0)
> 		      return __c;
> 		  }
>-- 
>2.24.0.windows.2
>
>From gcc-bugs-return-664144-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 29 15:06:49 2019
Return-Path: <gcc-bugs-return-664144-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 85673 invoked by alias); 29 Dec 2019 15:06:49 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 85582 invoked by uid 48); 29 Dec 2019 15:06:42 -0000
From: "euloanty at live dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/93059] char and char8_t does not talk with each other with memcpy. std::copy std::copy_n, std::fill, std::fill_n, std::uninitialized_copy std::uninitialized_copy_n, std::fill, std::uninitialized_fill_n fails to convert to memxxx functions
Date: Sun, 29 Dec 2019 15:06:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: euloanty at live dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-93059-4-oQ39zNTPoE@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93059-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93059-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02214.txt.bz2
Content-length: 12603

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93059

--- Comment #20 from fdlbxtqi <euloanty at live dot com> ---
Comment on attachment 47559
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47559
An untested patch

>From 1dfd714e1f29e229d69a0c7f6f84bf05dd4ee85d Mon Sep 17 00:00:00 2001
>From: expnkx <unlvsur@live.com>
>Date: Sun, 29 Dec 2019 09:49:19 -0500
>Subject: [PATCH] Untested patch fix volatile bug of std::copyXXX and
> std::uninitialized_copyXXX Support custom contiguous_iterator Fix undefined
> behavior of &*end constexpr std::fill Greatly improve performance of
> std::copyXXX and std::uninitialized_copyXX for different types and apply
> pipeline optimization to reduce branch misprediction
>
>---
> libstdc++-v3/include/bits/stl_algobase.h | 170 ++++++++++++++++++++---
> 1 file changed, 148 insertions(+), 22 deletions(-)
>
>diff --git a/libstdc++-v3/include/bits/stl_algobase.h b/libstdc++-v3/include/bits/stl_algobase.h
>index 40d056ae8d5..01672a8f232 100644
>--- a/libstdc++-v3/include/bits/stl_algobase.h
>+++ b/libstdc++-v3/include/bits/stl_algobase.h
>@@ -1,6 +1,6 @@
> // Core algorithmic facilities -*- C++ -*-
> 
>-// Copyright (C) 2001-2019 Free Software Foundation, Inc.
>+// Copyright (C) 2001-2020 Free Software Foundation, Inc.
> //
> // This file is part of the GNU ISO C++ Library.  This library is free
> // software; you can redistribute it and/or modify it under the
>@@ -84,10 +84,37 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>    * A constexpr wrapper for __builtin_memmove.
>    * @param __num The number of elements of type _Tp (not bytes).
>    */
>+#ifndef __cpp_lib_concepts
>   template<bool _IsMove, typename _Tp>
>+  _GLIBCXX14_CONSTEXPR
>+    inline void volatile*
>+    __memmove(_Tp volatile* __dst, _Tp volatile const* __src, size_t __num)
>+    {
>+	  for(; __num > 0; --__num)
>+	    {
>+#if __cplusplus >= 201103L
>+	      if constexpr (_IsMove)
>+		*__dst = std::move(*__src);
>+	      else
>+#endif
>+		*__dst = *__src;
>+	      ++__src;
>+	      ++__dst;
>+	    }
>+	  return __dst;
>+    }
>+#endif
>+  template<bool _IsMove, typename _Tp,typename _Tp_src>
>+/*
>+#ifdef __cpp_lib_concepts
>+    requires (is_trivially_copyable_v<_Tp>&&!is_volatile_v<_Tp>
>+      &&is_trivially_copyable_v<_Tp_src>&&!is_volatile_v<_Tp_src>
>+      &&(same_as<_Tp,_Tp_src>||(sizeof(_Tp)==sizeof(_Tp_src)&&integral<_Tp>&&integral<_Tp_src>)))
>+#endif
>+*/
>     _GLIBCXX14_CONSTEXPR
>     inline void*
>-    __memmove(_Tp* __dst, const _Tp* __src, size_t __num)
>+    __memmove(_Tp* __dst, _Tp_src const* __src, size_t __num)
>     {
> #ifdef __cpp_lib_is_constant_evaluated
>       if (std::is_constant_evaluated())
>@@ -106,9 +133,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>       else
> #endif
> 	return __builtin_memmove(__dst, __src, sizeof(_Tp) * __num);
>-      return __dst;
>     }
>-
>   /*
>    * A constexpr wrapper for __builtin_memcmp.
>    * @param __num The number of elements of type _Tp (not bytes).
>@@ -431,7 +456,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> 	}
>     };
> #endif
>-
>+#ifndef __cpp_lib_concepts
>   template<bool _IsMove>
>     struct __copy_move<_IsMove, true, random_access_iterator_tag>
>     {
>@@ -448,12 +473,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> 	  static_assert( __assignable::type::value, "type is not assignable" );
> #endif
> 	  const ptrdiff_t _Num = __last - __first;
>-	  if (_Num)
>-	    std::__memmove<_IsMove>(__result, __first, _Num);
>+	  if (!_Num)
>+  	  return __result + _Num;
>+//since before C++20, we do not have [[likely]] attribute. We need to do it manually
>+    std::__memmove<_IsMove>(__result, __first, _Num);
> 	  return __result + _Num;
> 	}
>     };
>-
>+#endif
>   // Helpers for streambuf iterators (either istream or ostream).
>   // NB: avoid including <iosfwd>, relatively large.
>   template<typename _CharT>
>@@ -491,11 +518,41 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>       typedef typename iterator_traits<_II>::value_type _ValueTypeI;
>       typedef typename iterator_traits<_OI>::value_type _ValueTypeO;
>       typedef typename iterator_traits<_II>::iterator_category _Category;
>+#ifdef __cpp_lib_concepts
>+      if constexpr(
>+          ((!is_volatile_v<std::remove_reference_t<decltype(*__first)>>)&&
>+          is_trivially_copyable_v<_ValueTypeI>)&&
>+          ((!is_volatile_v<std::remove_reference_t<decltype(*__result)>>)&&
>+          is_trivially_copyable_v<_ValueTypeO>)&&
>+          contiguous_iterator<_II>&&
>+          contiguous_iterator<_OI>&&
>+          (same_as<_ValueTypeI,_ValueTypeO>
>+          ||(integral<_ValueTypeI>&&integral<_ValueTypeO>&&
>+              sizeof(_ValueTypeI)==sizeof(_ValueTypeO))))
>+      {
>+        using __assignable = conditional<_IsMove,
>+                 is_move_assignable<_OI>,
>+                is_copy_assignable<_OI>>;
>+        static_assert( __assignable::type::value, "result type is not assignable" );
>+        ptrdiff_t const _Num = __last - __first;
>+        if (_Num)
>+#ifdef __has_cpp_attribute(likely)
>+//This if statement is by default bad since it affects CPU pipeline.
>+//needs likely attribute or the branch misprediction penalty (100% misprediction rate probably) is HUGE
>+        [[likely]]
>+#endif
>+          std::__memmove<_IsMove>(to_address(__result), to_address(__first), _Num);
>+        return __result + _Num;
>+      }
>+      else
>+      return std::__copy_move<_IsMove, false,
>+#else
>       const bool __simple = (__is_trivially_copyable(_ValueTypeI)
> 			     && __is_pointer<_II>::__value
> 			     && __is_pointer<_OI>::__value
> 			     && __are_same<_ValueTypeI, _ValueTypeO>::__value);
>       return std::__copy_move<_IsMove, __simple,
>+#endif
> 			      _Category>::__copy_m(__first, __last, __result);
>     }
> 
>@@ -581,6 +638,7 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
>    *  Note that the end of the output range is permitted to be contained
>    *  within [first,last).
>   */
>+
>   template<typename _II, typename _OI>
>     _GLIBCXX20_CONSTEXPR
>     inline _OI
>@@ -595,7 +653,6 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
>       return std::__copy_move_a<__is_move_iterator<_II>::__value>
> 	     (std::__miter_base(__first), std::__miter_base(__last), __result);
>     }
>-
> #if __cplusplus >= 201103L
>   /**
>    *  @brief Moves the range [first,last) into result.
>@@ -698,6 +755,7 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
>     };
> #endif
> 
>+#ifndef __cpp_lib_concepts
>   template<bool _IsMove>
>     struct __copy_move_backward<_IsMove, true, random_access_iterator_tag>
>     {
>@@ -714,11 +772,13 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
> 	  static_assert( __assignable::type::value, "type is not assignable" );
> #endif
> 	  const ptrdiff_t _Num = __last - __first;
>-	  if (_Num)
>-	    std::__memmove<_IsMove>(__result - _Num, __first, _Num);
>+	  if (!_Num)
>+      return __result - _Num;
>+    std::__memmove<_IsMove>(__result - _Num, __first, _Num);
> 	  return __result - _Num;
> 	}
>     };
>+#endif
> 
>   template<bool _IsMove, typename _BI1, typename _BI2>
>     _GLIBCXX20_CONSTEXPR
>@@ -728,21 +788,56 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
>       typedef typename iterator_traits<_BI1>::value_type _ValueType1;
>       typedef typename iterator_traits<_BI2>::value_type _ValueType2;
>       typedef typename iterator_traits<_BI1>::iterator_category _Category;
>-      const bool __simple = (__is_trivially_copyable(_ValueType1)
>-			     && __is_pointer<_BI1>::__value
>-			     && __is_pointer<_BI2>::__value
>-			     && __are_same<_ValueType1, _ValueType2>::__value);
>-
> #ifdef __cpp_lib_is_constant_evaluated
>       if (std::is_constant_evaluated())
>-	return std::__copy_move_backward<true, false,
>+      	return std::__copy_move_backward<true, false,
> 			      _Category>::__copy_move_b(__first, __last,
> 							__result);
>+      else
>+      {
> #endif
>+#if __cpp_lib_concepts 
>+      if constexpr(
>+          ((!is_volatile_v<std::remove_reference_t<decltype(*__first)>>)&&
>+          is_trivially_copyable_v<_ValueType1>)&&
>+          ((!is_volatile_v<std::remove_reference_t<decltype(*__result)>>)&&
>+          is_trivially_copyable_v<_ValueType2>)&&
>+          contiguous_iterator<_BI1>&&
>+          contiguous_iterator<_BI2>&&
>+          (same_as<_ValueType1,_ValueType2>
>+          ||(integral<_ValueType1>&&integral<_ValueType2>&&
>+              sizeof(_ValueType1)==sizeof(_ValueType2))))
>+      {
>+        using __assignable = conditional<_IsMove,
>+                is_move_assignable<_ValueType2>,
>+                is_copy_assignable<_ValueType2>>;
>+        // trivial types can have deleted assignment
>+        static_assert( __assignable::type::value, "type is not assignable" );
>+        ptrdiff_t const _Num = __last - __first;
>+        if (_Num)
>+          #ifdef __has_cpp_attribute(likely)
>+            [[likely]]
>+          #endif
>+          std::__memmove<_IsMove>(to_address(__result) - _Num, to_address(__first), _Num);
>+        return __result - _Num; 
>+      }
>+#else
>+      const bool __simple = (
>+#if __cplusplus >= 201103L
>+        (!is_volatile<typename std::remove_reference<decltype(*__first)>::type>::value)&&
>+#endif
>+        __is_trivially_copyable(_ValueType1)
>+			     && __is_pointer<_BI1>::__value
>+			     && __is_pointer<_BI2>::__value
>+			     && __are_same<_ValueType1, _ValueType2>::__value);
>       return std::__copy_move_backward<_IsMove, __simple,
> 				       _Category>::__copy_move_b(__first,
> 								 __last,
> 								 __result);
>+#endif
>+#ifdef __cpp_lib_is_constant_evaluated
>+      }
>+#endif
>     }
> 
>   template<bool _IsMove, typename _BI1, typename _BI2>
>@@ -908,16 +1003,33 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
>     }
> 
>   // Specialization: for char types we can use memset.
>+
>   template<typename _Tp>
>+    _GLIBCXX20_CONSTEXPR
>     inline typename
>     __gnu_cxx::__enable_if<__is_byte<_Tp>::__value, void>::__type
>     __fill_a1(_Tp* __first, _Tp* __last, const _Tp& __c)
>     {
>-      const _Tp __tmp = __c;
>+      _Tp const __tmp = __c;
>+#ifdef __cpp_lib_is_constant_evaluated
>+    if (std::is_constant_evaluated())
>+    {
>+      for (; __first != __last; ++__first)
>+	*__first = __tmp;
>+    }
>+    else
>+    {
>+#endif
>       if (const size_t __len = __last - __first)
>+#ifdef __has_cpp_attribute(likely)
>+        [[likely]]
>+#endif
> 	__builtin_memset(__first, static_cast<unsigned char>(__tmp), __len);
>+#ifdef __cpp_lib_is_constant_evaluated
>     }
>-
>+#endif
>+    }
>+#ifndef __cpp_lib_concepts
>   template<typename _Ite, typename _Cont, typename _Tp>
>     _GLIBCXX20_CONSTEXPR
>     inline void
>@@ -925,7 +1037,7 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
> 	      ::__gnu_cxx::__normal_iterator<_Ite, _Cont> __last,
> 	      const _Tp& __value)
>     { std::__fill_a1(__first.base(), __last.base(), __value); }
>-
>+#endif
>   template<typename _Tp, typename _VTp>
>     void
>     __fill_a1(const _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Tp&, _Tp*>&,
>@@ -936,7 +1048,14 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
>     _GLIBCXX20_CONSTEXPR
>     inline void
>     __fill_a(_FIte __first, _FIte __last, const _Tp& __value)
>-    { std::__fill_a1(__first, __last, __value); }
>+    {
>+#ifdef __cpp_lib_concepts
>+      if constexpr(contiguous_iterator<_FIte>)
>+        std::__fill_a1(to_address(__first), to_address(__last), __value);
>+      else
>+#endif
>+        std::__fill_a1(__first, __last, __value);
>+    }
> 
>   template<typename _Ite, typename _Seq, typename _Cat, typename _Tp>
>     void
>@@ -1306,6 +1425,9 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
> 	  const size_t __len1 = __last1 - __first1;
> 	  const size_t __len2 = __last2 - __first2;
> 	  if (const size_t __len = std::min(__len1, __len2))
>+#ifdef __has_cpp_attribute(likely)
>+        [[likely]]
>+#endif
> 	    if (int __result = std::__memcmp(__first1, __first2, __len))
> 	      return __result < 0;
> 	  return __len1 < __len2;
>@@ -1733,7 +1855,11 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO
> 		if (__len)
> 		  {
> 		    const auto __c
>-		      = __builtin_memcmp(&*__first1, &*__first2, __len) <=> 0;
>+		      = __builtin_memcmp(to_address(__first1), to_address(__first2), __len) <=> 0;
>+//&*__first1 is not correct and would crash program. Must use to_address()
>+//since a lot of debugging iterator would not be allowed to dereference __first2.
>+//It is undefined behavior to derefernce sentinal iterators
>+//For example, VC's implementation
> 		    if (__c != 0)
> 		      return __c;
> 		  }
>-- 
>2.24.0.windows.2
>
>From gcc-bugs-return-664145-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 29 15:06:52 2019
Return-Path: <gcc-bugs-return-664145-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 85953 invoked by alias); 29 Dec 2019 15:06:52 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 85640 invoked by uid 48); 29 Dec 2019 15:06:45 -0000
From: "euloanty at live dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/93059] char and char8_t does not talk with each other with memcpy. std::copy std::copy_n, std::fill, std::fill_n, std::uninitialized_copy std::uninitialized_copy_n, std::fill, std::uninitialized_fill_n fails to convert to memxxx functions
Date: Sun, 29 Dec 2019 15:07:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: euloanty at live dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-93059-4-rvHnuP3j5B@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93059-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93059-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02218.txt.bz2
Content-length: 12603

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93059

--- Comment #21 from fdlbxtqi <euloanty at live dot com> ---
Comment on attachment 47559
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47559
An untested patch

>From 1dfd714e1f29e229d69a0c7f6f84bf05dd4ee85d Mon Sep 17 00:00:00 2001
>From: expnkx <unlvsur@live.com>
>Date: Sun, 29 Dec 2019 09:49:19 -0500
>Subject: [PATCH] Untested patch fix volatile bug of std::copyXXX and
> std::uninitialized_copyXXX Support custom contiguous_iterator Fix undefined
> behavior of &*end constexpr std::fill Greatly improve performance of
> std::copyXXX and std::uninitialized_copyXX for different types and apply
> pipeline optimization to reduce branch misprediction
>
>---
> libstdc++-v3/include/bits/stl_algobase.h | 170 ++++++++++++++++++++---
> 1 file changed, 148 insertions(+), 22 deletions(-)
>
>diff --git a/libstdc++-v3/include/bits/stl_algobase.h b/libstdc++-v3/include/bits/stl_algobase.h
>index 40d056ae8d5..01672a8f232 100644
>--- a/libstdc++-v3/include/bits/stl_algobase.h
>+++ b/libstdc++-v3/include/bits/stl_algobase.h
>@@ -1,6 +1,6 @@
> // Core algorithmic facilities -*- C++ -*-
> 
>-// Copyright (C) 2001-2019 Free Software Foundation, Inc.
>+// Copyright (C) 2001-2020 Free Software Foundation, Inc.
> //
> // This file is part of the GNU ISO C++ Library.  This library is free
> // software; you can redistribute it and/or modify it under the
>@@ -84,10 +84,37 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>    * A constexpr wrapper for __builtin_memmove.
>    * @param __num The number of elements of type _Tp (not bytes).
>    */
>+#ifndef __cpp_lib_concepts
>   template<bool _IsMove, typename _Tp>
>+  _GLIBCXX14_CONSTEXPR
>+    inline void volatile*
>+    __memmove(_Tp volatile* __dst, _Tp volatile const* __src, size_t __num)
>+    {
>+	  for(; __num > 0; --__num)
>+	    {
>+#if __cplusplus >= 201103L
>+	      if constexpr (_IsMove)
>+		*__dst = std::move(*__src);
>+	      else
>+#endif
>+		*__dst = *__src;
>+	      ++__src;
>+	      ++__dst;
>+	    }
>+	  return __dst;
>+    }
>+#endif
>+  template<bool _IsMove, typename _Tp,typename _Tp_src>
>+/*
>+#ifdef __cpp_lib_concepts
>+    requires (is_trivially_copyable_v<_Tp>&&!is_volatile_v<_Tp>
>+      &&is_trivially_copyable_v<_Tp_src>&&!is_volatile_v<_Tp_src>
>+      &&(same_as<_Tp,_Tp_src>||(sizeof(_Tp)==sizeof(_Tp_src)&&integral<_Tp>&&integral<_Tp_src>)))
>+#endif
>+*/
>     _GLIBCXX14_CONSTEXPR
>     inline void*
>-    __memmove(_Tp* __dst, const _Tp* __src, size_t __num)
>+    __memmove(_Tp* __dst, _Tp_src const* __src, size_t __num)
>     {
> #ifdef __cpp_lib_is_constant_evaluated
>       if (std::is_constant_evaluated())
>@@ -106,9 +133,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>       else
> #endif
> 	return __builtin_memmove(__dst, __src, sizeof(_Tp) * __num);
>-      return __dst;
>     }
>-
>   /*
>    * A constexpr wrapper for __builtin_memcmp.
>    * @param __num The number of elements of type _Tp (not bytes).
>@@ -431,7 +456,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> 	}
>     };
> #endif
>-
>+#ifndef __cpp_lib_concepts
>   template<bool _IsMove>
>     struct __copy_move<_IsMove, true, random_access_iterator_tag>
>     {
>@@ -448,12 +473,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> 	  static_assert( __assignable::type::value, "type is not assignable" );
> #endif
> 	  const ptrdiff_t _Num = __last - __first;
>-	  if (_Num)
>-	    std::__memmove<_IsMove>(__result, __first, _Num);
>+	  if (!_Num)
>+  	  return __result + _Num;
>+//since before C++20, we do not have [[likely]] attribute. We need to do it manually
>+    std::__memmove<_IsMove>(__result, __first, _Num);
> 	  return __result + _Num;
> 	}
>     };
>-
>+#endif
>   // Helpers for streambuf iterators (either istream or ostream).
>   // NB: avoid including <iosfwd>, relatively large.
>   template<typename _CharT>
>@@ -491,11 +518,41 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>       typedef typename iterator_traits<_II>::value_type _ValueTypeI;
>       typedef typename iterator_traits<_OI>::value_type _ValueTypeO;
>       typedef typename iterator_traits<_II>::iterator_category _Category;
>+#ifdef __cpp_lib_concepts
>+      if constexpr(
>+          ((!is_volatile_v<std::remove_reference_t<decltype(*__first)>>)&&
>+          is_trivially_copyable_v<_ValueTypeI>)&&
>+          ((!is_volatile_v<std::remove_reference_t<decltype(*__result)>>)&&
>+          is_trivially_copyable_v<_ValueTypeO>)&&
>+          contiguous_iterator<_II>&&
>+          contiguous_iterator<_OI>&&
>+          (same_as<_ValueTypeI,_ValueTypeO>
>+          ||(integral<_ValueTypeI>&&integral<_ValueTypeO>&&
>+              sizeof(_ValueTypeI)==sizeof(_ValueTypeO))))
>+      {
>+        using __assignable = conditional<_IsMove,
>+                 is_move_assignable<_OI>,
>+                is_copy_assignable<_OI>>;
>+        static_assert( __assignable::type::value, "result type is not assignable" );
>+        ptrdiff_t const _Num = __last - __first;
>+        if (_Num)
>+#ifdef __has_cpp_attribute(likely)
>+//This if statement is by default bad since it affects CPU pipeline.
>+//needs likely attribute or the branch misprediction penalty (100% misprediction rate probably) is HUGE
>+        [[likely]]
>+#endif
>+          std::__memmove<_IsMove>(to_address(__result), to_address(__first), _Num);
>+        return __result + _Num;
>+      }
>+      else
>+      return std::__copy_move<_IsMove, false,
>+#else
>       const bool __simple = (__is_trivially_copyable(_ValueTypeI)
> 			     && __is_pointer<_II>::__value
> 			     && __is_pointer<_OI>::__value
> 			     && __are_same<_ValueTypeI, _ValueTypeO>::__value);
>       return std::__copy_move<_IsMove, __simple,
>+#endif
> 			      _Category>::__copy_m(__first, __last, __result);
>     }
> 
>@@ -581,6 +638,7 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
>    *  Note that the end of the output range is permitted to be contained
>    *  within [first,last).
>   */
>+
>   template<typename _II, typename _OI>
>     _GLIBCXX20_CONSTEXPR
>     inline _OI
>@@ -595,7 +653,6 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
>       return std::__copy_move_a<__is_move_iterator<_II>::__value>
> 	     (std::__miter_base(__first), std::__miter_base(__last), __result);
>     }
>-
> #if __cplusplus >= 201103L
>   /**
>    *  @brief Moves the range [first,last) into result.
>@@ -698,6 +755,7 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
>     };
> #endif
> 
>+#ifndef __cpp_lib_concepts
>   template<bool _IsMove>
>     struct __copy_move_backward<_IsMove, true, random_access_iterator_tag>
>     {
>@@ -714,11 +772,13 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
> 	  static_assert( __assignable::type::value, "type is not assignable" );
> #endif
> 	  const ptrdiff_t _Num = __last - __first;
>-	  if (_Num)
>-	    std::__memmove<_IsMove>(__result - _Num, __first, _Num);
>+	  if (!_Num)
>+      return __result - _Num;
>+    std::__memmove<_IsMove>(__result - _Num, __first, _Num);
> 	  return __result - _Num;
> 	}
>     };
>+#endif
> 
>   template<bool _IsMove, typename _BI1, typename _BI2>
>     _GLIBCXX20_CONSTEXPR
>@@ -728,21 +788,56 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
>       typedef typename iterator_traits<_BI1>::value_type _ValueType1;
>       typedef typename iterator_traits<_BI2>::value_type _ValueType2;
>       typedef typename iterator_traits<_BI1>::iterator_category _Category;
>-      const bool __simple = (__is_trivially_copyable(_ValueType1)
>-			     && __is_pointer<_BI1>::__value
>-			     && __is_pointer<_BI2>::__value
>-			     && __are_same<_ValueType1, _ValueType2>::__value);
>-
> #ifdef __cpp_lib_is_constant_evaluated
>       if (std::is_constant_evaluated())
>-	return std::__copy_move_backward<true, false,
>+      	return std::__copy_move_backward<true, false,
> 			      _Category>::__copy_move_b(__first, __last,
> 							__result);
>+      else
>+      {
> #endif
>+#if __cpp_lib_concepts 
>+      if constexpr(
>+          ((!is_volatile_v<std::remove_reference_t<decltype(*__first)>>)&&
>+          is_trivially_copyable_v<_ValueType1>)&&
>+          ((!is_volatile_v<std::remove_reference_t<decltype(*__result)>>)&&
>+          is_trivially_copyable_v<_ValueType2>)&&
>+          contiguous_iterator<_BI1>&&
>+          contiguous_iterator<_BI2>&&
>+          (same_as<_ValueType1,_ValueType2>
>+          ||(integral<_ValueType1>&&integral<_ValueType2>&&
>+              sizeof(_ValueType1)==sizeof(_ValueType2))))
>+      {
>+        using __assignable = conditional<_IsMove,
>+                is_move_assignable<_ValueType2>,
>+                is_copy_assignable<_ValueType2>>;
>+        // trivial types can have deleted assignment
>+        static_assert( __assignable::type::value, "type is not assignable" );
>+        ptrdiff_t const _Num = __last - __first;
>+        if (_Num)
>+          #ifdef __has_cpp_attribute(likely)
>+            [[likely]]
>+          #endif
>+          std::__memmove<_IsMove>(to_address(__result) - _Num, to_address(__first), _Num);
>+        return __result - _Num; 
>+      }
>+#else
>+      const bool __simple = (
>+#if __cplusplus >= 201103L
>+        (!is_volatile<typename std::remove_reference<decltype(*__first)>::type>::value)&&
>+#endif
>+        __is_trivially_copyable(_ValueType1)
>+			     && __is_pointer<_BI1>::__value
>+			     && __is_pointer<_BI2>::__value
>+			     && __are_same<_ValueType1, _ValueType2>::__value);
>       return std::__copy_move_backward<_IsMove, __simple,
> 				       _Category>::__copy_move_b(__first,
> 								 __last,
> 								 __result);
>+#endif
>+#ifdef __cpp_lib_is_constant_evaluated
>+      }
>+#endif
>     }
> 
>   template<bool _IsMove, typename _BI1, typename _BI2>
>@@ -908,16 +1003,33 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
>     }
> 
>   // Specialization: for char types we can use memset.
>+
>   template<typename _Tp>
>+    _GLIBCXX20_CONSTEXPR
>     inline typename
>     __gnu_cxx::__enable_if<__is_byte<_Tp>::__value, void>::__type
>     __fill_a1(_Tp* __first, _Tp* __last, const _Tp& __c)
>     {
>-      const _Tp __tmp = __c;
>+      _Tp const __tmp = __c;
>+#ifdef __cpp_lib_is_constant_evaluated
>+    if (std::is_constant_evaluated())
>+    {
>+      for (; __first != __last; ++__first)
>+	*__first = __tmp;
>+    }
>+    else
>+    {
>+#endif
>       if (const size_t __len = __last - __first)
>+#ifdef __has_cpp_attribute(likely)
>+        [[likely]]
>+#endif
> 	__builtin_memset(__first, static_cast<unsigned char>(__tmp), __len);
>+#ifdef __cpp_lib_is_constant_evaluated
>     }
>-
>+#endif
>+    }
>+#ifndef __cpp_lib_concepts
>   template<typename _Ite, typename _Cont, typename _Tp>
>     _GLIBCXX20_CONSTEXPR
>     inline void
>@@ -925,7 +1037,7 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
> 	      ::__gnu_cxx::__normal_iterator<_Ite, _Cont> __last,
> 	      const _Tp& __value)
>     { std::__fill_a1(__first.base(), __last.base(), __value); }
>-
>+#endif
>   template<typename _Tp, typename _VTp>
>     void
>     __fill_a1(const _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Tp&, _Tp*>&,
>@@ -936,7 +1048,14 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
>     _GLIBCXX20_CONSTEXPR
>     inline void
>     __fill_a(_FIte __first, _FIte __last, const _Tp& __value)
>-    { std::__fill_a1(__first, __last, __value); }
>+    {
>+#ifdef __cpp_lib_concepts
>+      if constexpr(contiguous_iterator<_FIte>)
>+        std::__fill_a1(to_address(__first), to_address(__last), __value);
>+      else
>+#endif
>+        std::__fill_a1(__first, __last, __value);
>+    }
> 
>   template<typename _Ite, typename _Seq, typename _Cat, typename _Tp>
>     void
>@@ -1306,6 +1425,9 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
> 	  const size_t __len1 = __last1 - __first1;
> 	  const size_t __len2 = __last2 - __first2;
> 	  if (const size_t __len = std::min(__len1, __len2))
>+#ifdef __has_cpp_attribute(likely)
>+        [[likely]]
>+#endif
> 	    if (int __result = std::__memcmp(__first1, __first2, __len))
> 	      return __result < 0;
> 	  return __len1 < __len2;
>@@ -1733,7 +1855,11 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO
> 		if (__len)
> 		  {
> 		    const auto __c
>-		      = __builtin_memcmp(&*__first1, &*__first2, __len) <=> 0;
>+		      = __builtin_memcmp(to_address(__first1), to_address(__first2), __len) <=> 0;
>+//&*__first1 is not correct and would crash program. Must use to_address()
>+//since a lot of debugging iterator would not be allowed to dereference __first2.
>+//It is undefined behavior to derefernce sentinal iterators
>+//For example, VC's implementation
> 		    if (__c != 0)
> 		      return __c;
> 		  }
>-- 
>2.24.0.windows.2
>
>From gcc-bugs-return-664147-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 29 15:07:08 2019
Return-Path: <gcc-bugs-return-664147-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 87534 invoked by alias); 29 Dec 2019 15:07:07 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 86781 invoked by uid 48); 29 Dec 2019 15:06:59 -0000
From: "euloanty at live dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/93059] char and char8_t does not talk with each other with memcpy. std::copy std::copy_n, std::fill, std::fill_n, std::uninitialized_copy std::uninitialized_copy_n, std::fill, std::uninitialized_fill_n fails to convert to memxxx functions
Date: Sun, 29 Dec 2019 15:07:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: euloanty at live dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-93059-4-fBK9L3xSvA@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93059-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93059-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02216.txt.bz2
Content-length: 12603

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93059

--- Comment #23 from fdlbxtqi <euloanty at live dot com> ---
Comment on attachment 47559
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47559
An untested patch

>From 1dfd714e1f29e229d69a0c7f6f84bf05dd4ee85d Mon Sep 17 00:00:00 2001
>From: expnkx <unlvsur@live.com>
>Date: Sun, 29 Dec 2019 09:49:19 -0500
>Subject: [PATCH] Untested patch fix volatile bug of std::copyXXX and
> std::uninitialized_copyXXX Support custom contiguous_iterator Fix undefined
> behavior of &*end constexpr std::fill Greatly improve performance of
> std::copyXXX and std::uninitialized_copyXX for different types and apply
> pipeline optimization to reduce branch misprediction
>
>---
> libstdc++-v3/include/bits/stl_algobase.h | 170 ++++++++++++++++++++---
> 1 file changed, 148 insertions(+), 22 deletions(-)
>
>diff --git a/libstdc++-v3/include/bits/stl_algobase.h b/libstdc++-v3/include/bits/stl_algobase.h
>index 40d056ae8d5..01672a8f232 100644
>--- a/libstdc++-v3/include/bits/stl_algobase.h
>+++ b/libstdc++-v3/include/bits/stl_algobase.h
>@@ -1,6 +1,6 @@
> // Core algorithmic facilities -*- C++ -*-
> 
>-// Copyright (C) 2001-2019 Free Software Foundation, Inc.
>+// Copyright (C) 2001-2020 Free Software Foundation, Inc.
> //
> // This file is part of the GNU ISO C++ Library.  This library is free
> // software; you can redistribute it and/or modify it under the
>@@ -84,10 +84,37 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>    * A constexpr wrapper for __builtin_memmove.
>    * @param __num The number of elements of type _Tp (not bytes).
>    */
>+#ifndef __cpp_lib_concepts
>   template<bool _IsMove, typename _Tp>
>+  _GLIBCXX14_CONSTEXPR
>+    inline void volatile*
>+    __memmove(_Tp volatile* __dst, _Tp volatile const* __src, size_t __num)
>+    {
>+	  for(; __num > 0; --__num)
>+	    {
>+#if __cplusplus >= 201103L
>+	      if constexpr (_IsMove)
>+		*__dst = std::move(*__src);
>+	      else
>+#endif
>+		*__dst = *__src;
>+	      ++__src;
>+	      ++__dst;
>+	    }
>+	  return __dst;
>+    }
>+#endif
>+  template<bool _IsMove, typename _Tp,typename _Tp_src>
>+/*
>+#ifdef __cpp_lib_concepts
>+    requires (is_trivially_copyable_v<_Tp>&&!is_volatile_v<_Tp>
>+      &&is_trivially_copyable_v<_Tp_src>&&!is_volatile_v<_Tp_src>
>+      &&(same_as<_Tp,_Tp_src>||(sizeof(_Tp)==sizeof(_Tp_src)&&integral<_Tp>&&integral<_Tp_src>)))
>+#endif
>+*/
>     _GLIBCXX14_CONSTEXPR
>     inline void*
>-    __memmove(_Tp* __dst, const _Tp* __src, size_t __num)
>+    __memmove(_Tp* __dst, _Tp_src const* __src, size_t __num)
>     {
> #ifdef __cpp_lib_is_constant_evaluated
>       if (std::is_constant_evaluated())
>@@ -106,9 +133,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>       else
> #endif
> 	return __builtin_memmove(__dst, __src, sizeof(_Tp) * __num);
>-      return __dst;
>     }
>-
>   /*
>    * A constexpr wrapper for __builtin_memcmp.
>    * @param __num The number of elements of type _Tp (not bytes).
>@@ -431,7 +456,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> 	}
>     };
> #endif
>-
>+#ifndef __cpp_lib_concepts
>   template<bool _IsMove>
>     struct __copy_move<_IsMove, true, random_access_iterator_tag>
>     {
>@@ -448,12 +473,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> 	  static_assert( __assignable::type::value, "type is not assignable" );
> #endif
> 	  const ptrdiff_t _Num = __last - __first;
>-	  if (_Num)
>-	    std::__memmove<_IsMove>(__result, __first, _Num);
>+	  if (!_Num)
>+  	  return __result + _Num;
>+//since before C++20, we do not have [[likely]] attribute. We need to do it manually
>+    std::__memmove<_IsMove>(__result, __first, _Num);
> 	  return __result + _Num;
> 	}
>     };
>-
>+#endif
>   // Helpers for streambuf iterators (either istream or ostream).
>   // NB: avoid including <iosfwd>, relatively large.
>   template<typename _CharT>
>@@ -491,11 +518,41 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>       typedef typename iterator_traits<_II>::value_type _ValueTypeI;
>       typedef typename iterator_traits<_OI>::value_type _ValueTypeO;
>       typedef typename iterator_traits<_II>::iterator_category _Category;
>+#ifdef __cpp_lib_concepts
>+      if constexpr(
>+          ((!is_volatile_v<std::remove_reference_t<decltype(*__first)>>)&&
>+          is_trivially_copyable_v<_ValueTypeI>)&&
>+          ((!is_volatile_v<std::remove_reference_t<decltype(*__result)>>)&&
>+          is_trivially_copyable_v<_ValueTypeO>)&&
>+          contiguous_iterator<_II>&&
>+          contiguous_iterator<_OI>&&
>+          (same_as<_ValueTypeI,_ValueTypeO>
>+          ||(integral<_ValueTypeI>&&integral<_ValueTypeO>&&
>+              sizeof(_ValueTypeI)==sizeof(_ValueTypeO))))
>+      {
>+        using __assignable = conditional<_IsMove,
>+                 is_move_assignable<_OI>,
>+                is_copy_assignable<_OI>>;
>+        static_assert( __assignable::type::value, "result type is not assignable" );
>+        ptrdiff_t const _Num = __last - __first;
>+        if (_Num)
>+#ifdef __has_cpp_attribute(likely)
>+//This if statement is by default bad since it affects CPU pipeline.
>+//needs likely attribute or the branch misprediction penalty (100% misprediction rate probably) is HUGE
>+        [[likely]]
>+#endif
>+          std::__memmove<_IsMove>(to_address(__result), to_address(__first), _Num);
>+        return __result + _Num;
>+      }
>+      else
>+      return std::__copy_move<_IsMove, false,
>+#else
>       const bool __simple = (__is_trivially_copyable(_ValueTypeI)
> 			     && __is_pointer<_II>::__value
> 			     && __is_pointer<_OI>::__value
> 			     && __are_same<_ValueTypeI, _ValueTypeO>::__value);
>       return std::__copy_move<_IsMove, __simple,
>+#endif
> 			      _Category>::__copy_m(__first, __last, __result);
>     }
> 
>@@ -581,6 +638,7 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
>    *  Note that the end of the output range is permitted to be contained
>    *  within [first,last).
>   */
>+
>   template<typename _II, typename _OI>
>     _GLIBCXX20_CONSTEXPR
>     inline _OI
>@@ -595,7 +653,6 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
>       return std::__copy_move_a<__is_move_iterator<_II>::__value>
> 	     (std::__miter_base(__first), std::__miter_base(__last), __result);
>     }
>-
> #if __cplusplus >= 201103L
>   /**
>    *  @brief Moves the range [first,last) into result.
>@@ -698,6 +755,7 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
>     };
> #endif
> 
>+#ifndef __cpp_lib_concepts
>   template<bool _IsMove>
>     struct __copy_move_backward<_IsMove, true, random_access_iterator_tag>
>     {
>@@ -714,11 +772,13 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
> 	  static_assert( __assignable::type::value, "type is not assignable" );
> #endif
> 	  const ptrdiff_t _Num = __last - __first;
>-	  if (_Num)
>-	    std::__memmove<_IsMove>(__result - _Num, __first, _Num);
>+	  if (!_Num)
>+      return __result - _Num;
>+    std::__memmove<_IsMove>(__result - _Num, __first, _Num);
> 	  return __result - _Num;
> 	}
>     };
>+#endif
> 
>   template<bool _IsMove, typename _BI1, typename _BI2>
>     _GLIBCXX20_CONSTEXPR
>@@ -728,21 +788,56 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
>       typedef typename iterator_traits<_BI1>::value_type _ValueType1;
>       typedef typename iterator_traits<_BI2>::value_type _ValueType2;
>       typedef typename iterator_traits<_BI1>::iterator_category _Category;
>-      const bool __simple = (__is_trivially_copyable(_ValueType1)
>-			     && __is_pointer<_BI1>::__value
>-			     && __is_pointer<_BI2>::__value
>-			     && __are_same<_ValueType1, _ValueType2>::__value);
>-
> #ifdef __cpp_lib_is_constant_evaluated
>       if (std::is_constant_evaluated())
>-	return std::__copy_move_backward<true, false,
>+      	return std::__copy_move_backward<true, false,
> 			      _Category>::__copy_move_b(__first, __last,
> 							__result);
>+      else
>+      {
> #endif
>+#if __cpp_lib_concepts 
>+      if constexpr(
>+          ((!is_volatile_v<std::remove_reference_t<decltype(*__first)>>)&&
>+          is_trivially_copyable_v<_ValueType1>)&&
>+          ((!is_volatile_v<std::remove_reference_t<decltype(*__result)>>)&&
>+          is_trivially_copyable_v<_ValueType2>)&&
>+          contiguous_iterator<_BI1>&&
>+          contiguous_iterator<_BI2>&&
>+          (same_as<_ValueType1,_ValueType2>
>+          ||(integral<_ValueType1>&&integral<_ValueType2>&&
>+              sizeof(_ValueType1)==sizeof(_ValueType2))))
>+      {
>+        using __assignable = conditional<_IsMove,
>+                is_move_assignable<_ValueType2>,
>+                is_copy_assignable<_ValueType2>>;
>+        // trivial types can have deleted assignment
>+        static_assert( __assignable::type::value, "type is not assignable" );
>+        ptrdiff_t const _Num = __last - __first;
>+        if (_Num)
>+          #ifdef __has_cpp_attribute(likely)
>+            [[likely]]
>+          #endif
>+          std::__memmove<_IsMove>(to_address(__result) - _Num, to_address(__first), _Num);
>+        return __result - _Num; 
>+      }
>+#else
>+      const bool __simple = (
>+#if __cplusplus >= 201103L
>+        (!is_volatile<typename std::remove_reference<decltype(*__first)>::type>::value)&&
>+#endif
>+        __is_trivially_copyable(_ValueType1)
>+			     && __is_pointer<_BI1>::__value
>+			     && __is_pointer<_BI2>::__value
>+			     && __are_same<_ValueType1, _ValueType2>::__value);
>       return std::__copy_move_backward<_IsMove, __simple,
> 				       _Category>::__copy_move_b(__first,
> 								 __last,
> 								 __result);
>+#endif
>+#ifdef __cpp_lib_is_constant_evaluated
>+      }
>+#endif
>     }
> 
>   template<bool _IsMove, typename _BI1, typename _BI2>
>@@ -908,16 +1003,33 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
>     }
> 
>   // Specialization: for char types we can use memset.
>+
>   template<typename _Tp>
>+    _GLIBCXX20_CONSTEXPR
>     inline typename
>     __gnu_cxx::__enable_if<__is_byte<_Tp>::__value, void>::__type
>     __fill_a1(_Tp* __first, _Tp* __last, const _Tp& __c)
>     {
>-      const _Tp __tmp = __c;
>+      _Tp const __tmp = __c;
>+#ifdef __cpp_lib_is_constant_evaluated
>+    if (std::is_constant_evaluated())
>+    {
>+      for (; __first != __last; ++__first)
>+	*__first = __tmp;
>+    }
>+    else
>+    {
>+#endif
>       if (const size_t __len = __last - __first)
>+#ifdef __has_cpp_attribute(likely)
>+        [[likely]]
>+#endif
> 	__builtin_memset(__first, static_cast<unsigned char>(__tmp), __len);
>+#ifdef __cpp_lib_is_constant_evaluated
>     }
>-
>+#endif
>+    }
>+#ifndef __cpp_lib_concepts
>   template<typename _Ite, typename _Cont, typename _Tp>
>     _GLIBCXX20_CONSTEXPR
>     inline void
>@@ -925,7 +1037,7 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
> 	      ::__gnu_cxx::__normal_iterator<_Ite, _Cont> __last,
> 	      const _Tp& __value)
>     { std::__fill_a1(__first.base(), __last.base(), __value); }
>-
>+#endif
>   template<typename _Tp, typename _VTp>
>     void
>     __fill_a1(const _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Tp&, _Tp*>&,
>@@ -936,7 +1048,14 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
>     _GLIBCXX20_CONSTEXPR
>     inline void
>     __fill_a(_FIte __first, _FIte __last, const _Tp& __value)
>-    { std::__fill_a1(__first, __last, __value); }
>+    {
>+#ifdef __cpp_lib_concepts
>+      if constexpr(contiguous_iterator<_FIte>)
>+        std::__fill_a1(to_address(__first), to_address(__last), __value);
>+      else
>+#endif
>+        std::__fill_a1(__first, __last, __value);
>+    }
> 
>   template<typename _Ite, typename _Seq, typename _Cat, typename _Tp>
>     void
>@@ -1306,6 +1425,9 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
> 	  const size_t __len1 = __last1 - __first1;
> 	  const size_t __len2 = __last2 - __first2;
> 	  if (const size_t __len = std::min(__len1, __len2))
>+#ifdef __has_cpp_attribute(likely)
>+        [[likely]]
>+#endif
> 	    if (int __result = std::__memcmp(__first1, __first2, __len))
> 	      return __result < 0;
> 	  return __len1 < __len2;
>@@ -1733,7 +1855,11 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO
> 		if (__len)
> 		  {
> 		    const auto __c
>-		      = __builtin_memcmp(&*__first1, &*__first2, __len) <=> 0;
>+		      = __builtin_memcmp(to_address(__first1), to_address(__first2), __len) <=> 0;
>+//&*__first1 is not correct and would crash program. Must use to_address()
>+//since a lot of debugging iterator would not be allowed to dereference __first2.
>+//It is undefined behavior to derefernce sentinal iterators
>+//For example, VC's implementation
> 		    if (__c != 0)
> 		      return __c;
> 		  }
>-- 
>2.24.0.windows.2
>
>From gcc-bugs-return-664148-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 29 15:07:24 2019
Return-Path: <gcc-bugs-return-664148-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 88296 invoked by alias); 29 Dec 2019 15:07:23 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 88199 invoked by uid 48); 29 Dec 2019 15:07:16 -0000
From: "euloanty at live dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/93059] char and char8_t does not talk with each other with memcpy. std::copy std::copy_n, std::fill, std::fill_n, std::uninitialized_copy std::uninitialized_copy_n, std::fill, std::uninitialized_fill_n fails to convert to memxxx functions
Date: Sun, 29 Dec 2019 15:07:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: euloanty at live dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-93059-4-bna5Efaaau@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93059-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93059-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02217.txt.bz2
Content-length: 12603

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93059

--- Comment #24 from fdlbxtqi <euloanty at live dot com> ---
Comment on attachment 47559
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47559
An untested patch

>From 1dfd714e1f29e229d69a0c7f6f84bf05dd4ee85d Mon Sep 17 00:00:00 2001
>From: expnkx <unlvsur@live.com>
>Date: Sun, 29 Dec 2019 09:49:19 -0500
>Subject: [PATCH] Untested patch fix volatile bug of std::copyXXX and
> std::uninitialized_copyXXX Support custom contiguous_iterator Fix undefined
> behavior of &*end constexpr std::fill Greatly improve performance of
> std::copyXXX and std::uninitialized_copyXX for different types and apply
> pipeline optimization to reduce branch misprediction
>
>---
> libstdc++-v3/include/bits/stl_algobase.h | 170 ++++++++++++++++++++---
> 1 file changed, 148 insertions(+), 22 deletions(-)
>
>diff --git a/libstdc++-v3/include/bits/stl_algobase.h b/libstdc++-v3/include/bits/stl_algobase.h
>index 40d056ae8d5..01672a8f232 100644
>--- a/libstdc++-v3/include/bits/stl_algobase.h
>+++ b/libstdc++-v3/include/bits/stl_algobase.h
>@@ -1,6 +1,6 @@
> // Core algorithmic facilities -*- C++ -*-
> 
>-// Copyright (C) 2001-2019 Free Software Foundation, Inc.
>+// Copyright (C) 2001-2020 Free Software Foundation, Inc.
> //
> // This file is part of the GNU ISO C++ Library.  This library is free
> // software; you can redistribute it and/or modify it under the
>@@ -84,10 +84,37 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>    * A constexpr wrapper for __builtin_memmove.
>    * @param __num The number of elements of type _Tp (not bytes).
>    */
>+#ifndef __cpp_lib_concepts
>   template<bool _IsMove, typename _Tp>
>+  _GLIBCXX14_CONSTEXPR
>+    inline void volatile*
>+    __memmove(_Tp volatile* __dst, _Tp volatile const* __src, size_t __num)
>+    {
>+	  for(; __num > 0; --__num)
>+	    {
>+#if __cplusplus >= 201103L
>+	      if constexpr (_IsMove)
>+		*__dst = std::move(*__src);
>+	      else
>+#endif
>+		*__dst = *__src;
>+	      ++__src;
>+	      ++__dst;
>+	    }
>+	  return __dst;
>+    }
>+#endif
>+  template<bool _IsMove, typename _Tp,typename _Tp_src>
>+/*
>+#ifdef __cpp_lib_concepts
>+    requires (is_trivially_copyable_v<_Tp>&&!is_volatile_v<_Tp>
>+      &&is_trivially_copyable_v<_Tp_src>&&!is_volatile_v<_Tp_src>
>+      &&(same_as<_Tp,_Tp_src>||(sizeof(_Tp)==sizeof(_Tp_src)&&integral<_Tp>&&integral<_Tp_src>)))
>+#endif
>+*/
>     _GLIBCXX14_CONSTEXPR
>     inline void*
>-    __memmove(_Tp* __dst, const _Tp* __src, size_t __num)
>+    __memmove(_Tp* __dst, _Tp_src const* __src, size_t __num)
>     {
> #ifdef __cpp_lib_is_constant_evaluated
>       if (std::is_constant_evaluated())
>@@ -106,9 +133,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>       else
> #endif
> 	return __builtin_memmove(__dst, __src, sizeof(_Tp) * __num);
>-      return __dst;
>     }
>-
>   /*
>    * A constexpr wrapper for __builtin_memcmp.
>    * @param __num The number of elements of type _Tp (not bytes).
>@@ -431,7 +456,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> 	}
>     };
> #endif
>-
>+#ifndef __cpp_lib_concepts
>   template<bool _IsMove>
>     struct __copy_move<_IsMove, true, random_access_iterator_tag>
>     {
>@@ -448,12 +473,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> 	  static_assert( __assignable::type::value, "type is not assignable" );
> #endif
> 	  const ptrdiff_t _Num = __last - __first;
>-	  if (_Num)
>-	    std::__memmove<_IsMove>(__result, __first, _Num);
>+	  if (!_Num)
>+  	  return __result + _Num;
>+//since before C++20, we do not have [[likely]] attribute. We need to do it manually
>+    std::__memmove<_IsMove>(__result, __first, _Num);
> 	  return __result + _Num;
> 	}
>     };
>-
>+#endif
>   // Helpers for streambuf iterators (either istream or ostream).
>   // NB: avoid including <iosfwd>, relatively large.
>   template<typename _CharT>
>@@ -491,11 +518,41 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>       typedef typename iterator_traits<_II>::value_type _ValueTypeI;
>       typedef typename iterator_traits<_OI>::value_type _ValueTypeO;
>       typedef typename iterator_traits<_II>::iterator_category _Category;
>+#ifdef __cpp_lib_concepts
>+      if constexpr(
>+          ((!is_volatile_v<std::remove_reference_t<decltype(*__first)>>)&&
>+          is_trivially_copyable_v<_ValueTypeI>)&&
>+          ((!is_volatile_v<std::remove_reference_t<decltype(*__result)>>)&&
>+          is_trivially_copyable_v<_ValueTypeO>)&&
>+          contiguous_iterator<_II>&&
>+          contiguous_iterator<_OI>&&
>+          (same_as<_ValueTypeI,_ValueTypeO>
>+          ||(integral<_ValueTypeI>&&integral<_ValueTypeO>&&
>+              sizeof(_ValueTypeI)==sizeof(_ValueTypeO))))
>+      {
>+        using __assignable = conditional<_IsMove,
>+                 is_move_assignable<_OI>,
>+                is_copy_assignable<_OI>>;
>+        static_assert( __assignable::type::value, "result type is not assignable" );
>+        ptrdiff_t const _Num = __last - __first;
>+        if (_Num)
>+#ifdef __has_cpp_attribute(likely)
>+//This if statement is by default bad since it affects CPU pipeline.
>+//needs likely attribute or the branch misprediction penalty (100% misprediction rate probably) is HUGE
>+        [[likely]]
>+#endif
>+          std::__memmove<_IsMove>(to_address(__result), to_address(__first), _Num);
>+        return __result + _Num;
>+      }
>+      else
>+      return std::__copy_move<_IsMove, false,
>+#else
>       const bool __simple = (__is_trivially_copyable(_ValueTypeI)
> 			     && __is_pointer<_II>::__value
> 			     && __is_pointer<_OI>::__value
> 			     && __are_same<_ValueTypeI, _ValueTypeO>::__value);
>       return std::__copy_move<_IsMove, __simple,
>+#endif
> 			      _Category>::__copy_m(__first, __last, __result);
>     }
> 
>@@ -581,6 +638,7 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
>    *  Note that the end of the output range is permitted to be contained
>    *  within [first,last).
>   */
>+
>   template<typename _II, typename _OI>
>     _GLIBCXX20_CONSTEXPR
>     inline _OI
>@@ -595,7 +653,6 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
>       return std::__copy_move_a<__is_move_iterator<_II>::__value>
> 	     (std::__miter_base(__first), std::__miter_base(__last), __result);
>     }
>-
> #if __cplusplus >= 201103L
>   /**
>    *  @brief Moves the range [first,last) into result.
>@@ -698,6 +755,7 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
>     };
> #endif
> 
>+#ifndef __cpp_lib_concepts
>   template<bool _IsMove>
>     struct __copy_move_backward<_IsMove, true, random_access_iterator_tag>
>     {
>@@ -714,11 +772,13 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
> 	  static_assert( __assignable::type::value, "type is not assignable" );
> #endif
> 	  const ptrdiff_t _Num = __last - __first;
>-	  if (_Num)
>-	    std::__memmove<_IsMove>(__result - _Num, __first, _Num);
>+	  if (!_Num)
>+      return __result - _Num;
>+    std::__memmove<_IsMove>(__result - _Num, __first, _Num);
> 	  return __result - _Num;
> 	}
>     };
>+#endif
> 
>   template<bool _IsMove, typename _BI1, typename _BI2>
>     _GLIBCXX20_CONSTEXPR
>@@ -728,21 +788,56 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
>       typedef typename iterator_traits<_BI1>::value_type _ValueType1;
>       typedef typename iterator_traits<_BI2>::value_type _ValueType2;
>       typedef typename iterator_traits<_BI1>::iterator_category _Category;
>-      const bool __simple = (__is_trivially_copyable(_ValueType1)
>-			     && __is_pointer<_BI1>::__value
>-			     && __is_pointer<_BI2>::__value
>-			     && __are_same<_ValueType1, _ValueType2>::__value);
>-
> #ifdef __cpp_lib_is_constant_evaluated
>       if (std::is_constant_evaluated())
>-	return std::__copy_move_backward<true, false,
>+      	return std::__copy_move_backward<true, false,
> 			      _Category>::__copy_move_b(__first, __last,
> 							__result);
>+      else
>+      {
> #endif
>+#if __cpp_lib_concepts 
>+      if constexpr(
>+          ((!is_volatile_v<std::remove_reference_t<decltype(*__first)>>)&&
>+          is_trivially_copyable_v<_ValueType1>)&&
>+          ((!is_volatile_v<std::remove_reference_t<decltype(*__result)>>)&&
>+          is_trivially_copyable_v<_ValueType2>)&&
>+          contiguous_iterator<_BI1>&&
>+          contiguous_iterator<_BI2>&&
>+          (same_as<_ValueType1,_ValueType2>
>+          ||(integral<_ValueType1>&&integral<_ValueType2>&&
>+              sizeof(_ValueType1)==sizeof(_ValueType2))))
>+      {
>+        using __assignable = conditional<_IsMove,
>+                is_move_assignable<_ValueType2>,
>+                is_copy_assignable<_ValueType2>>;
>+        // trivial types can have deleted assignment
>+        static_assert( __assignable::type::value, "type is not assignable" );
>+        ptrdiff_t const _Num = __last - __first;
>+        if (_Num)
>+          #ifdef __has_cpp_attribute(likely)
>+            [[likely]]
>+          #endif
>+          std::__memmove<_IsMove>(to_address(__result) - _Num, to_address(__first), _Num);
>+        return __result - _Num; 
>+      }
>+#else
>+      const bool __simple = (
>+#if __cplusplus >= 201103L
>+        (!is_volatile<typename std::remove_reference<decltype(*__first)>::type>::value)&&
>+#endif
>+        __is_trivially_copyable(_ValueType1)
>+			     && __is_pointer<_BI1>::__value
>+			     && __is_pointer<_BI2>::__value
>+			     && __are_same<_ValueType1, _ValueType2>::__value);
>       return std::__copy_move_backward<_IsMove, __simple,
> 				       _Category>::__copy_move_b(__first,
> 								 __last,
> 								 __result);
>+#endif
>+#ifdef __cpp_lib_is_constant_evaluated
>+      }
>+#endif
>     }
> 
>   template<bool _IsMove, typename _BI1, typename _BI2>
>@@ -908,16 +1003,33 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
>     }
> 
>   // Specialization: for char types we can use memset.
>+
>   template<typename _Tp>
>+    _GLIBCXX20_CONSTEXPR
>     inline typename
>     __gnu_cxx::__enable_if<__is_byte<_Tp>::__value, void>::__type
>     __fill_a1(_Tp* __first, _Tp* __last, const _Tp& __c)
>     {
>-      const _Tp __tmp = __c;
>+      _Tp const __tmp = __c;
>+#ifdef __cpp_lib_is_constant_evaluated
>+    if (std::is_constant_evaluated())
>+    {
>+      for (; __first != __last; ++__first)
>+	*__first = __tmp;
>+    }
>+    else
>+    {
>+#endif
>       if (const size_t __len = __last - __first)
>+#ifdef __has_cpp_attribute(likely)
>+        [[likely]]
>+#endif
> 	__builtin_memset(__first, static_cast<unsigned char>(__tmp), __len);
>+#ifdef __cpp_lib_is_constant_evaluated
>     }
>-
>+#endif
>+    }
>+#ifndef __cpp_lib_concepts
>   template<typename _Ite, typename _Cont, typename _Tp>
>     _GLIBCXX20_CONSTEXPR
>     inline void
>@@ -925,7 +1037,7 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
> 	      ::__gnu_cxx::__normal_iterator<_Ite, _Cont> __last,
> 	      const _Tp& __value)
>     { std::__fill_a1(__first.base(), __last.base(), __value); }
>-
>+#endif
>   template<typename _Tp, typename _VTp>
>     void
>     __fill_a1(const _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Tp&, _Tp*>&,
>@@ -936,7 +1048,14 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
>     _GLIBCXX20_CONSTEXPR
>     inline void
>     __fill_a(_FIte __first, _FIte __last, const _Tp& __value)
>-    { std::__fill_a1(__first, __last, __value); }
>+    {
>+#ifdef __cpp_lib_concepts
>+      if constexpr(contiguous_iterator<_FIte>)
>+        std::__fill_a1(to_address(__first), to_address(__last), __value);
>+      else
>+#endif
>+        std::__fill_a1(__first, __last, __value);
>+    }
> 
>   template<typename _Ite, typename _Seq, typename _Cat, typename _Tp>
>     void
>@@ -1306,6 +1425,9 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
> 	  const size_t __len1 = __last1 - __first1;
> 	  const size_t __len2 = __last2 - __first2;
> 	  if (const size_t __len = std::min(__len1, __len2))
>+#ifdef __has_cpp_attribute(likely)
>+        [[likely]]
>+#endif
> 	    if (int __result = std::__memcmp(__first1, __first2, __len))
> 	      return __result < 0;
> 	  return __len1 < __len2;
>@@ -1733,7 +1855,11 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO
> 		if (__len)
> 		  {
> 		    const auto __c
>-		      = __builtin_memcmp(&*__first1, &*__first2, __len) <=> 0;
>+		      = __builtin_memcmp(to_address(__first1), to_address(__first2), __len) <=> 0;
>+//&*__first1 is not correct and would crash program. Must use to_address()
>+//since a lot of debugging iterator would not be allowed to dereference __first2.
>+//It is undefined behavior to derefernce sentinal iterators
>+//For example, VC's implementation
> 		    if (__c != 0)
> 		      return __c;
> 		  }
>-- 
>2.24.0.windows.2
>
>From gcc-bugs-return-664149-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 29 15:08:40 2019
Return-Path: <gcc-bugs-return-664149-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 89638 invoked by alias); 29 Dec 2019 15:08:39 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 89596 invoked by uid 48); 29 Dec 2019 15:08:35 -0000
From: "euloanty at live dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/93059] char and char8_t does not talk with each other with memcpy. std::copy std::copy_n, std::fill, std::fill_n, std::uninitialized_copy std::uninitialized_copy_n, std::fill, std::uninitialized_fill_n fails to convert to memxxx functions
Date: Sun, 29 Dec 2019 15:08:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: euloanty at live dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: attachments.created
Message-ID: <bug-93059-4-VyxpssZoFR@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93059-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93059-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02219.txt.bz2
Content-length: 274

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93059

--- Comment #25 from fdlbxtqi <euloanty at live dot com> ---
Created attachment 47560
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47560&action=edit
forgot to_address

2nd patch

I am going to run testsuites
>From gcc-bugs-return-664150-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 29 15:43:59 2019
Return-Path: <gcc-bugs-return-664150-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 49369 invoked by alias); 29 Dec 2019 15:43:59 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 49341 invoked by uid 48); 29 Dec 2019 15:43:54 -0000
From: "euloanty at live dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: =?UTF-8?B?W0J1ZyBjKysvOTMwOTVdIE5ldzogQnVpbGQgTGF0ZXN0IEdDQyBmYWlsIC4u?= =?UTF-8?B?Ly4uL2djYy9nY2MvZ2ltcGxlLWZvbGQuYzo0MTQ2Ojg6IGVycm9yOiBleHBl?= =?UTF-8?B?Y3RlZCB1bnF1YWxpZmllZC1pZCBiZWZvcmUg4oCYdGhyb3dz4oCZ?Date: Sun, 29 Dec 2019 15:43:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: euloanty at live dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone
Message-ID: <bug-93095-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02220.txt.bz2
Content-length: 5419

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93095

            Bug ID: 93095
           Summary: Build Latest GCC fail
                    ../../gcc/gcc/gimple-fold.c:4146:8: error: expected
                    unqualified-id before ‘throws’
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: euloanty at live dot com
  Target Milestone: ---

g++ -fno-PIE -c   -g -O2 -DIN_GCC     -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wno-error=format-diag -Wmissing-format-attribute
-Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros
-Wno-overlength-strings -fno-common  -DHAVE_CONFIG_H -I. -I. -I../../gcc/gcc
-I../../gcc/gcc/. -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include
-I/home/cqwrteur/gcc-build/./gmp -I/home/cqwrteur/gcc/gmp
-I/home/cqwrteur/gcc-build/./mpfr/src -I/home/cqwrteur/gcc/mpfr/src
-I/home/cqwrteur/gcc/mpc/src  -I../../gcc/gcc/../libdecnumber
-I../../gcc/gcc/../libdecnumber/bid -I../libdecnumber
-I../../gcc/gcc/../libbacktrace -I/home/cqwrteur/gcc-build/./isl/include
-I/home/cqwrteur/gcc/isl/include  -o gimple-loop-versioning.o -MT
gimple-loop-versioning.o -MMD -MP -MF ./.deps/gimple-loop-versioning.TPo
../../gcc/gcc/gimple-loop-versioning.cc
g++ -fno-PIE -c   -g -O2 -DIN_GCC     -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wno-error=format-diag -Wmissing-format-attribute
-Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros
-Wno-overlength-strings -fno-common  -DHAVE_CONFIG_H -I. -I. -I../../gcc/gcc
-I../../gcc/gcc/. -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include
-I/home/cqwrteur/gcc-build/./gmp -I/home/cqwrteur/gcc/gmp
-I/home/cqwrteur/gcc-build/./mpfr/src -I/home/cqwrteur/gcc/mpfr/src
-I/home/cqwrteur/gcc/mpc/src  -I../../gcc/gcc/../libdecnumber
-I../../gcc/gcc/../libdecnumber/bid -I../libdecnumber
-I../../gcc/gcc/../libbacktrace -I/home/cqwrteur/gcc-build/./isl/include
-I/home/cqwrteur/gcc/isl/include  -o gimple-low.o -MT gimple-low.o -MMD -MP -MF
./.deps/gimple-low.TPo ../../gcc/gcc/gimple-low.c
../../gcc/gcc/gimple-fold.c: In function ‘void
fold_builtin_atomic_compare_exchange(gimple_stmt_iterator*)’:
../../gcc/gcc/gimple-fold.c:4146:8: error: expected unqualified-id before
‘throws’
 4146 |   bool throws = false;
      |        ^~~~~~
../../gcc/gcc/gimple-fold.c:4174:7: error: expected primary-expression before
‘throws’
 4174 |       throws = true;
      |       ^~~~~~
../../gcc/gcc/gimple-fold.c:4185:11: error: expected primary-expression before
‘throws’
 4185 |       if (throws)
      |           ^~~~~~
../../gcc/gcc/gimple-fold.c:4185:11: error: expected ‘)’ before ‘throws’
 4185 |       if (throws)
      |          ~^~~~~~
      |           )
../../gcc/gcc/gimple-fold.c:4197:7: error: expected primary-expression before
‘throws’
 4197 |   if (throws && oldlhs == NULL_TREE)
      |       ^~~~~~
../../gcc/gcc/gimple-fold.c:4197:7: error: expected ‘)’ before ‘throws’
 4197 |   if (throws && oldlhs == NULL_TREE)
      |      ~^~~~~~
      |       )
g++ -fno-PIE -c   -g -O2 -DIN_GCC     -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wno-error=format-diag -Wmissing-format-attribute
-Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros
-Wno-overlength-strings -fno-common  -DHAVE_CONFIG_H -I. -I. -I../../gcc/gcc
-I../../gcc/gcc/. -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include
-I/home/cqwrteur/gcc-build/./gmp -I/home/cqwrteur/gcc/gmp
-I/home/cqwrteur/gcc-build/./mpfr/src -I/home/cqwrteur/gcc/mpfr/src
-I/home/cqwrteur/gcc/mpc/src  -I../../gcc/gcc/../libdecnumber
-I../../gcc/gcc/../libdecnumber/bid -I../libdecnumber
-I../../gcc/gcc/../libbacktrace -I/home/cqwrteur/gcc-build/./isl/include
-I/home/cqwrteur/gcc/isl/include  -o gimple-pretty-print.o -MT
gimple-pretty-print.o -MMD -MP -MF ./.deps/gimple-pretty-print.TPo
../../gcc/gcc/gimple-pretty-print.c
Makefile:1117: recipe for target 'gimple-fold.o' failed
make[2]: *** [gimple-fold.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from ../../gcc/gcc/coretypes.h:444,
                 from ../../gcc/gcc/expmed.c:26:
../../gcc/gcc/machmode.h: In function ‘rtx_def* emit_store_flag_1(rtx,
rtx_code, rtx, rtx, machine_mode, int, int, machine_mode)’:
../../gcc/gcc/machmode.h:546:42: warning: ‘int_mode’ may be used uninitialized
in this function [-Wmaybe-uninitialized]
  546 |    ? mode_size_inline (mode) : mode_size[mode]);
      |                                          ^~~~
../../gcc/gcc/expmed.c:5623:19: note: ‘int_mode’ was declared here
 5623 |   scalar_int_mode int_mode;
      |                   ^~~~~~~~
1make[2]: Leaving directory '/home/cqwrteur/gcc-build/gcc'
Makefile:4373: recipe for target 'all-gcc' failed
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory '/home/cqwrteur/gcc-build'
Makefile:966: recipe for target 'all' failed
make: *** [all] Error 2
>From gcc-bugs-return-664151-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 29 16:40:09 2019
Return-Path: <gcc-bugs-return-664151-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 17913 invoked by alias); 29 Dec 2019 16:40:08 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 17841 invoked by uid 48); 29 Dec 2019 16:40:04 -0000
From: "danglin at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libgcc/92988] crtstuff.c:387:21: error: '__dso_handle' undeclared (first use in this function)
Date: Sun, 29 Dec 2019 16:40:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libgcc
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: danglin at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: attachments.created
Message-ID: <bug-92988-4-YdJbdzmrBM@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-92988-4@http.gcc.gnu.org/bugzilla/>
References: <bug-92988-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02221.txt.bz2
Content-length: 231

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92988

--- Comment #1 from John David Anglin <danglin at gcc dot gnu.org> ---
Created attachment 47561
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47561&action=edit
Patch
>From gcc-bugs-return-664152-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 29 16:46:15 2019
Return-Path: <gcc-bugs-return-664152-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 23010 invoked by alias); 29 Dec 2019 16:45:58 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 22771 invoked by uid 55); 29 Dec 2019 16:45:38 -0000
From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/88337] Implement P1002R1, P1327R1, P1330R0, C++20 relaxations of constexpr restrictions.
Date: Sun, 29 Dec 2019 16:45:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 9.0
X-Bugzilla-Keywords: patch
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: mpolacek at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: mpolacek at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-88337-4-ducX9ezq7u@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-88337-4@http.gcc.gnu.org/bugzilla/>
References: <bug-88337-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02222.txt.bz2
Content-length: 3288

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88337

--- Comment #11 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Author: mpolacek
Date: Sun Dec 29 16:44:41 2019
New Revision: 279755

URL: https://gcc.gnu.org/viewcvs?rev=279755&root=gcc&view=rev
Log:
        PR c++/88337 - Implement P1327R1: Allow dynamic_cast in constexpr.

This patch implements
<http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1327r1.html>.

When build_dynamic_cast realizes that a dynamic_cast needs a run-time check, it
generates a call to __dynamic_cast -- see dyncast.cc in libsupc++ for its
definition.  The gist of my approach is to evaluate such a call at compile
time.

        * constexpr.c (cxx_dynamic_cast_fn_p): New function.
        (extract_obj_from_addr_offset): New function.
        (get_component_with_type): New function.
        (cxx_eval_dynamic_cast_fn): New function.
        (cxx_eval_call_expression): Call cxx_eval_dynamic_cast_fn for a call
        to __dynamic_cast.
        (potential_constant_expression_1): Don't give up on
        cxx_dynamic_cast_fn_p.
        * rtti.c (build_dynamic_cast_1): When creating a call to
        __dynamic_cast, use the location of the original expression.

        * g++.dg/cpp2a/constexpr-dynamic1.C: New test.
        * g++.dg/cpp2a/constexpr-dynamic10.C: New test.
        * g++.dg/cpp2a/constexpr-dynamic11.C: New test.
        * g++.dg/cpp2a/constexpr-dynamic12.C: New test.
        * g++.dg/cpp2a/constexpr-dynamic13.C: New test.
        * g++.dg/cpp2a/constexpr-dynamic14.C: New test.
        * g++.dg/cpp2a/constexpr-dynamic15.C: New test.
        * g++.dg/cpp2a/constexpr-dynamic16.C: New test.
        * g++.dg/cpp2a/constexpr-dynamic17.C: New test.
        * g++.dg/cpp2a/constexpr-dynamic2.C: New test.
        * g++.dg/cpp2a/constexpr-dynamic3.C: New test.
        * g++.dg/cpp2a/constexpr-dynamic4.C: New test.
        * g++.dg/cpp2a/constexpr-dynamic5.C: New test.
        * g++.dg/cpp2a/constexpr-dynamic6.C: New test.
        * g++.dg/cpp2a/constexpr-dynamic7.C: New test.
        * g++.dg/cpp2a/constexpr-dynamic8.C: New test.
        * g++.dg/cpp2a/constexpr-dynamic9.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic1.C
    trunk/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic10.C
    trunk/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic11.C
    trunk/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic12.C
    trunk/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic13.C
    trunk/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic14.C
    trunk/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic15.C
    trunk/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic16.C
    trunk/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic17.C
    trunk/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic2.C
    trunk/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic3.C
    trunk/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic4.C
    trunk/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic5.C
    trunk/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic6.C
    trunk/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic7.C
    trunk/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic8.C
    trunk/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic9.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/constexpr.c
    trunk/gcc/cp/rtti.c
    trunk/gcc/testsuite/ChangeLog
>From gcc-bugs-return-664153-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 29 16:47:55 2019
Return-Path: <gcc-bugs-return-664153-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 28770 invoked by alias); 29 Dec 2019 16:47:54 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 27938 invoked by uid 48); 29 Dec 2019 16:47:47 -0000
From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/88337] Implement P1002R1, P1327R1, P1330R0, C++20 relaxations of constexpr restrictions.
Date: Sun, 29 Dec 2019 16:47:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 9.0
X-Bugzilla-Keywords: patch
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: mpolacek at gcc dot gnu.org
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Resolution: FIXED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: mpolacek at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status resolution
Message-ID: <bug-88337-4-r3BaXMScLY@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-88337-4@http.gcc.gnu.org/bugzilla/>
References: <bug-88337-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02223.txt.bz2
Content-length: 446

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88337

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #12 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Implemented in GCC 10.
>From gcc-bugs-return-664155-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 29 16:49:28 2019
Return-Path: <gcc-bugs-return-664155-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 31296 invoked by alias); 29 Dec 2019 16:48:20 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 29265 invoked by uid 48); 29 Dec 2019 16:47:58 -0000
From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/88323] implement C++20 language features.
Date: Sun, 29 Dec 2019 16:48:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: dep_changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 9.0
X-Bugzilla-Keywords: meta-bug
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: mpolacek at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status resolution
Message-ID: <bug-88323-4-qS5gNUX1QH@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-88323-4@http.gcc.gnu.org/bugzilla/>
References: <bug-88323-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02225.txt.bz2
Content-length: 509

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88323
Bug 88323 depends on bug 88337, which changed state.

Bug 88337 Summary: Implement P1002R1, P1327R1, P1330R0, C++20 relaxations of constexpr restrictions.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88337

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
>From gcc-bugs-return-664154-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 29 16:48:34 2019
Return-Path: <gcc-bugs-return-664154-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 29768 invoked by alias); 29 Dec 2019 16:48:02 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 29096 invoked by uid 48); 29 Dec 2019 16:47:56 -0000
From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/55004] [meta-bug] constexpr issues
Date: Sun, 29 Dec 2019 16:48:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: dep_changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.8.0
X-Bugzilla-Keywords: meta-bug
X-Bugzilla-Severity: normal
X-Bugzilla-Who: mpolacek at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status resolution
Message-ID: <bug-55004-4-EFr7hgfU2T@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-55004-4@http.gcc.gnu.org/bugzilla/>
References: <bug-55004-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02224.txt.bz2
Content-length: 509

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55004
Bug 55004 depends on bug 88337, which changed state.

Bug 88337 Summary: Implement P1002R1, P1327R1, P1330R0, C++20 relaxations of constexpr restrictions.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88337

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
>From gcc-bugs-return-664156-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 29 16:49:49 2019
Return-Path: <gcc-bugs-return-664156-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 34165 invoked by alias); 29 Dec 2019 16:49:48 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 32720 invoked by uid 48); 29 Dec 2019 16:49:24 -0000
From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/93096] New: detect [class.cdtor]/6 UB in constexpr dynamic_cast
Date: Sun, 29 Dec 2019 16:49:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: mpolacek at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone
Message-ID: <bug-93096-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02226.txt.bz2
Content-length: 969

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93096

            Bug ID: 93096
           Summary: detect [class.cdtor]/6 UB in constexpr dynamic_cast
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mpolacek at gcc dot gnu.org
  Target Milestone: ---

We should detect the UB here:

struct V {
  virtual void f();
};

struct A : V { };

struct B : V {
  constexpr B(V*, A*);
};

struct D : A, B {
  constexpr D() : B((A*)this, this) { } 
};

constexpr B::B(V* v, A* a)
{
  // undefined behavior, a has type A*, A not a base of B
  dynamic_cast<B*>(a);
}

constexpr D d;

but currently we don't.  This is
<http://eel.is/c++draft/class.cdtor#6.sentence-3>.  See
<https://gcc.gnu.org/ml/gcc-patches/2019-12/msg01521.html> for another testcase
and possible approaches how to handle this.
>From gcc-bugs-return-664157-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 29 16:49:50 2019
Return-Path: <gcc-bugs-return-664157-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 34176 invoked by alias); 29 Dec 2019 16:49:49 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 34042 invoked by uid 48); 29 Dec 2019 16:49:39 -0000
From: "danglin at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libgomp/93066] libgomp/target.c:525:46: error: expected expression before ')' token
Date: Sun, 29 Dec 2019 16:49:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libgomp
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords: openacc
X-Bugzilla-Severity: normal
X-Bugzilla-Who: danglin at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: attachments.created
Message-ID: <bug-93066-4-ecFwFWBLgV@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93066-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93066-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02227.txt.bz2
Content-length: 440

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93066

--- Comment #4 from John David Anglin <danglin at gcc dot gnu.org> ---
Created attachment 47562
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47562&action=edit
Patch

I'm fine with the proposed changes to target.c but I think we need the include
fix as it's needed for other packages:
https://community.hpe.com/t5/Languages-and-Scripting/SIZE-MAX-undefined/td-p/4798688#
>From gcc-bugs-return-664158-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 29 17:43:06 2019
Return-Path: <gcc-bugs-return-664158-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 70764 invoked by alias); 29 Dec 2019 17:43:06 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 70620 invoked by uid 48); 29 Dec 2019 17:43:02 -0000
From: "ch3root at openwall dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/61502] == comparison on "one-past" pointer gives wrong result
Date: Sun, 29 Dec 2019 17:43:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 4.8.1
X-Bugzilla-Keywords: wrong-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ch3root at openwall dot com
X-Bugzilla-Status: SUSPENDED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-61502-4-2TkG2diD26@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-61502-4@http.gcc.gnu.org/bugzilla/>
References: <bug-61502-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02228.txt.bz2
Content-length: 2736

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61502

--- Comment #35 from Alexander Cherepanov <ch3root at openwall dot com> ---
What remains in this pr is the original problem.

1. The best way to demonstrate that there is indeed a bug here is probably to
compare representation of pointers directly:

----------------------------------------------------------------------
#include <string.h>
#include <stdio.h>

__attribute__((noipa)) // imagine it in a separate TU
static void *opaque(void *p) { return p; }

int main()
{
    int x[5];
    int y[2];

    void *p = &x;
    void *q = &y + 1;

    printf("val1: %d\n", p == q);
    printf("repr: %d\n", memcmp(&p, &q, sizeof(void *)) == 0);

    opaque(&p); // move the next comparison to runtime
    printf("val2: %d\n", p == q);

    opaque(q);
}
----------------------------------------------------------------------
$ gcc -std=c11 -pedantic -Wall -Wextra -O3 test.c && ./a.out
val1: 0
repr: 1
val2: 1
----------------------------------------------------------------------
gcc x86-64 version: gcc (GCC) 10.0.0 20191229 (experimental)
----------------------------------------------------------------------

C11, 6.2.6.1p4: "Two values (other than NaNs) with the same object
representation compare equal". Our pointers are not NaNs and have the same
representation so should compare equal.

DR 260 allows one to argue that representation of these pointers could change
right between the checks but IMHO this part of DR 260 is just wrong as it makes
copying objects byte-by-byte impossible. See
https://bugs.llvm.org/show_bug.cgi?id=44188 for a nice illustration.

While at it, the testcase also demonstrates that the comparison `p == q` is
unstable.

I'm not taking sides here, just stating that the standard and the compiler
disagree.

2. C++ at some point made results of the discussed comparison unspecified --
https://eel.is/c++draft/expr.eq#3.1 . According to the DR linked to in comment
27, it's done to make the definition usable at compile time. Perhaps
harmonization of the standards should move in this direction, not vice versa.

3. OTOH clang was fixed to be complying with C11.

4. What seems missing in the discussion is a clear description of benefits of
the current gcc's approach. Does it make some optimizations easier to
implement? Does it enable other optimizations?
Obviously, it could be used to fold `a + i == b` to `0` if `a` and `b` are two
different known arrays and `i` is unknown (or known to be exactly the length of
`a`). But this is probably not helpful for aliasing analysis as AA doesn't deal
with past-the-end pointers. And optimization of loops like in comment 19 is
probably not superhelpful too:-)
>From gcc-bugs-return-664159-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 29 17:47:36 2019
Return-Path: <gcc-bugs-return-664159-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 77242 invoked by alias); 29 Dec 2019 17:47:36 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 77202 invoked by uid 48); 29 Dec 2019 17:47:31 -0000
From: "build+gcc@de-korte.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libgomp/93097] New: Wrong OpenMP version reported
Date: Sun, 29 Dec 2019 17:47:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libgomp
X-Bugzilla-Version: 9.2.1
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: build+gcc@de-korte.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone
Message-ID: <bug-93097-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02229.txt.bz2
Content-length: 742

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93097

            Bug ID: 93097
           Summary: Wrong OpenMP version reported
           Product: gcc
           Version: 9.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgomp
          Assignee: unassigned at gcc dot gnu.org
          Reporter: build+gcc@de-korte.org
                CC: jakub at gcc dot gnu.org
  Target Milestone: ---

Currently, version 201511 is reported in _OPENMP, which is OpenMP 4.5. The
actual version of OpenMP is 5, so version 201811 should be reported instead.

Offending line in libgomp/env.c is 1170:

-  fputs ("  _OPENMP = '201511'\n", stderr);
+  fputs ("  _OPENMP = '201811'\n", stderr);
>From gcc-bugs-return-664161-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 29 17:51:34 2019
Return-Path: <gcc-bugs-return-664161-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 80171 invoked by alias); 29 Dec 2019 17:51:33 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 80139 invoked by uid 48); 29 Dec 2019 17:51:29 -0000
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: =?UTF-8?B?W0J1ZyBjKysvOTMwOTVdIEJ1aWxkIExhdGVzdCBHQ0MgZmFpbCAuLi8uLi9n?= =?UTF-8?B?Y2MvZ2NjL2dpbXBsZS1mb2xkLmM6NDE0Njo4OiBlcnJvcjogZXhwZWN0ZWQg?= =?UTF-8?B?dW5xdWFsaWZpZWQtaWQgYmVmb3JlIOKAmHRocm93c+KAmQ==?Date: Sun, 29 Dec 2019 17:51:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: jakub at gcc dot gnu.org
X-Bugzilla-Status: WAITING
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on cc everconfirmed
Message-ID: <bug-93095-4-JiGqHFOirM@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93095-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93095-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02231.txt.bz2
Content-length: 818

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93095

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2019-12-29
                 CC|                            |jakub at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Can't reproduce and don't see anything problematic on that code.
Unless e.g. the system headers are defining throws as a macro, can you e.g.
attach preprocessed gimple-fold.ii?  (E.g. do cd gcc; make gimple-fold.o
and cut'n'paste the command line, replace -c with -E -dD)?
>From gcc-bugs-return-664160-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 29 17:51:01 2019
Return-Path: <gcc-bugs-return-664160-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 79337 invoked by alias); 29 Dec 2019 17:51:01 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 79272 invoked by uid 48); 29 Dec 2019 17:50:56 -0000
From: "arthur.j.odwyer at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/68350] std::uninitialized_copy overly restrictive for trivially_copyable types
Date: Sun, 29 Dec 2019 17:51:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Version: 5.2.0
X-Bugzilla-Keywords: missed-optimization
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: arthur.j.odwyer at gmail dot com
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: ville.voutilainen at gmail dot com
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc
Message-ID: <bug-68350-4-VmZotJMbRJ@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-68350-4@http.gcc.gnu.org/bugzilla/>
References: <bug-68350-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02230.txt.bz2
Content-length: 1785

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68350

Arthur O'Dwyer <arthur.j.odwyer at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |arthur.j.odwyer at gmail dot com

--- Comment #6 from Arthur O'Dwyer <arthur.j.odwyer at gmail dot com> ---
(I got here from
https://stackoverflow.com/questions/47464819/uninitialized-copy-memcpy-memmove-optimization)

Jonathan, you wrote:
> The point of the condition is to decide whether to use std::copy, because for trivially-copyable types that is optimized to memmove. But unlike std::uninitialized_copy, std::copy calls no constructors, so the type must be trivially default constructible, and if an exception is thrown, it calls no destructors, so the type must be trivially destructible as well. So we can only use the memmove optimization for types which [...]

What do you mean "if an exception is thrown"? If we call std::copy from here,
then it's because we are taking the memmove path. memmove never throws
exceptions, so how can we be worried about what happens "if an exception is
thrown"?

That is, the following code 100% definitely never attempts to destroy a `B`
object, so why does it matter that `B`'s destructor is non-trivial?

// https://godbolt.org/z/w7nTe5
struct A {
    int i;
    A() = default;
    A(const A&) = default;
    ~A() = default;
};
struct B {
    int i;
    B() = default;
    B(const B&) = default;
    ~B() {}
};

void copyAs(A *p, A *q, int n) {
    std::uninitialized_copy(p, p+n, q);  // successfully uses memmove
}
void copyBs(B *p, B *q, int n) {
    std::uninitialized_copy(p, p+n, q);  // fails to use memmove
}
>From gcc-bugs-return-664162-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 29 17:56:04 2019
Return-Path: <gcc-bugs-return-664162-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 85724 invoked by alias); 29 Dec 2019 17:56:03 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 85665 invoked by uid 48); 29 Dec 2019 17:55:59 -0000
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/93094] [10 Regression] ICE in maybe_gen_insn, at optabs.c:7433
Date: Sun, 29 Dec 2019 17:56:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: jakub at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 10.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on cc target_milestone everconfirmed
Message-ID: <bug-93094-4-XD4BOgmLpW@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93094-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93094-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02232.txt.bz2
Content-length: 617

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93094

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2019-12-29
                 CC|                            |jakub at gcc dot gnu.org
   Target Milestone|---                         |10.0
     Ever confirmed|0                           |1

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r272239.
>From gcc-bugs-return-664163-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 29 18:01:50 2019
Return-Path: <gcc-bugs-return-664163-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 92928 invoked by alias); 29 Dec 2019 18:01:49 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 92873 invoked by uid 48); 29 Dec 2019 18:01:44 -0000
From: "bernd.edlinger at hotmail dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/93059] char and char8_t does not talk with each other with memcpy. std::copy std::copy_n, std::fill, std::fill_n, std::uninitialized_copy std::uninitialized_copy_n, std::fill, std::uninitialized_fill_n fails to convert to memxxx functions
Date: Sun, 29 Dec 2019 18:01:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: bernd.edlinger at hotmail dot de
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc
Message-ID: <bug-93059-4-o76rYFJWTK@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93059-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93059-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02233.txt.bz2
Content-length: 1586

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93059

Bernd Edlinger <bernd.edlinger at hotmail dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bernd.edlinger at hotmail dot de

--- Comment #26 from Bernd Edlinger <bernd.edlinger at hotmail dot de> ---
(In reply to fdlbxtqi from comment #2)
> Also find a bug of __memmove
> 
>   /*
>    * A constexpr wrapper for __builtin_memmove.
>    * @param __num The number of elements of type _Tp (not bytes).
>    */
>   template<bool _IsMove, typename _Tp>
>     _GLIBCXX14_CONSTEXPR
>     inline void*
>     __memmove(_Tp* __dst, const _Tp* __src, size_t __num)
>     {
> #ifdef __cpp_lib_is_constant_evaluated
>       if (std::is_constant_evaluated())
> 	{
> 	  for(; __num > 0; --__num)
> 	    {
> 	      if constexpr (_IsMove)
> 		*__dst = std::move(*__src);
> 	      else
> 		*__dst = *__src;
> 	      ++__src;
> 	      ++__dst;
> 	    }
> 	  return __dst;
> 	}
>       else
> #endif
> 	return __builtin_memmove(__dst, __src, sizeof(_Tp) * __num);
>       return __dst;
>     }
> 
> The last 2nd line return __dst is wrong. It should not exist.

Sorry, I don't know what this function is all about.
But to me the code in the ifdef looks totally bogus.
First it returns __dst+__num, while memmove is sopposed
to return __dst, and is is somehow clear that
__dst and __src do not overlap?

because if they do the loop would overwite the __dst buffer before
__src is fully copied?
>From gcc-bugs-return-664164-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 29 18:06:29 2019
Return-Path: <gcc-bugs-return-664164-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 95466 invoked by alias); 29 Dec 2019 18:06:28 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 95399 invoked by uid 48); 29 Dec 2019 18:06:24 -0000
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/93094] [10 Regression] ICE in maybe_gen_insn, at optabs.c:7433
Date: Sun, 29 Dec 2019 18:06:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: jakub at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 10.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-93094-4-aJfARWvf9Q@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93094-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93094-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02234.txt.bz2
Content-length: 389

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93094

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Scalar MASK_STORE really shouldn't appear in the IL except in the copy of the
loop intended for vectorization only (when it is transformed into vectorized
MASK_STORE).  So I'm afraid the above change leaks the loop intended for
vectorization only into the IL somehow.
>From gcc-bugs-return-664166-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 29 19:39:47 2019
Return-Path: <gcc-bugs-return-664166-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 97247 invoked by alias); 29 Dec 2019 19:39:46 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 97216 invoked by uid 48); 29 Dec 2019 19:39:42 -0000
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/93098] [10 Regression] ICE with negative shifter
Date: Sun, 29 Dec 2019 19:39:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: pinskia at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 10.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: target_milestone
Message-ID: <bug-93098-4-LON1ot9qcp@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93098-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93098-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02236.txt.bz2
Content-length: 293

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93098

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |10.0
>From gcc-bugs-return-664165-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 29 19:39:36 2019
Return-Path: <gcc-bugs-return-664165-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 96600 invoked by alias); 29 Dec 2019 19:39:36 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 96573 invoked by uid 48); 29 Dec 2019 19:39:31 -0000
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/93098] New: [10 Regression] ICE with negative shifter
Date: Sun, 29 Dec 2019 19:39:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: pinskia at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter target_milestone
Message-ID: <bug-93098-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02235.txt.bz2
Content-length: 974

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93098

            Bug ID: 93098
           Summary: [10 Regression] ICE with negative shifter
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

Even though it is undefined code, we should not ICE on this code.
Try with -O2:
typedef unsigned long long uint64_t;
   int popcount64c_1 (uint64_t x)
   {
     x -= (x >> -1) & 0x5555555555555555ULL;
     x = (x & 0x3333333333333333ULL) + ((x >> 2) & 0x3333333333333333ULL);
     x = (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0fULL;
     return (x * 0x0101010101010101ULL) >> 56;
   }

Found this via inspection of match.pd after I was working on something else and
had the testcase for PR 50193 fails.
>From gcc-bugs-return-664167-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 29 19:48:56 2019
Return-Path: <gcc-bugs-return-664167-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 117615 invoked by alias); 29 Dec 2019 19:48:54 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 117435 invoked by uid 48); 29 Dec 2019 19:48:28 -0000
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/93098] [10 Regression] ICE with negative shifter
Date: Sun, 29 Dec 2019 19:48:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: pinskia at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 10.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-93098-4-bdF5iNyWNy@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93098-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93098-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02237.txt.bz2
Content-length: 156

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93098

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This was introduced with r276721 .
>From gcc-bugs-return-664168-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 29 21:25:05 2019
Return-Path: <gcc-bugs-return-664168-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 96376 invoked by alias); 29 Dec 2019 21:24:46 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 95796 invoked by uid 48); 29 Dec 2019 21:24:39 -0000
From: "hubicka at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/93055] accumulation loops in stepanov_vector benchmark use more instruction level parpallelism
Date: Sun, 29 Dec 2019 21:24:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: hubicka at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: attachments.created
Message-ID: <bug-93055-4-OL9zKm1wbY@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93055-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93055-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02238.txt.bz2
Content-length: 414

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93055

--- Comment #5 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Created attachment 47563
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47563&action=edit
fixed testcase

I have verified that building with 

g++ -O3 -march=bdver1 -fno-prefetch-loop-arrays ~/stepanov_vector.ii

gets me the lea into internal loop. This does not happen with gcc9.
>From gcc-bugs-return-664169-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 29 23:48:54 2019
Return-Path: <gcc-bugs-return-664169-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 58778 invoked by alias); 29 Dec 2019 23:48:54 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 58134 invoked by uid 55); 29 Dec 2019 23:48:43 -0000
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/92745] [8/9 Regression] Initializing array with vec4 results in compile error
Date: Sun, 29 Dec 2019 23:48:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 8.3.0
X-Bugzilla-Keywords: rejects-valid
X-Bugzilla-Severity: normal
X-Bugzilla-Who: jakub at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P2
X-Bugzilla-Assigned-To: mpolacek at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 8.4
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-92745-4-iAwI0BrAdE@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-92745-4@http.gcc.gnu.org/bugzilla/>
References: <bug-92745-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02239.txt.bz2
Content-length: 447

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92745

--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Sun Dec 29 23:47:55 2019
New Revision: 279758

URL: https://gcc.gnu.org/viewcvs?rev=279758&root=gcc&view=rev
Log:
        PR c++/92745
        * g++.dg/cpp0x/initlist118.C: Add -Wno-psabi -w to dg-options.

Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/cpp0x/initlist118.C
>From gcc-bugs-return-664170-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 29 23:53:48 2019
Return-Path: <gcc-bugs-return-664170-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 63790 invoked by alias); 29 Dec 2019 23:53:48 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 63719 invoked by uid 48); 29 Dec 2019 23:53:44 -0000
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libgomp/93097] Wrong OpenMP version reported
Date: Sun, 29 Dec 2019 23:53:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libgomp
X-Bugzilla-Version: 9.2.1
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: jakub at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-93097-4-KpH1y4BdYN@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93097-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93097-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02240.txt.bz2
Content-length: 419

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93097

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
That would be incorrect, as OpenMP 5 is only partially supported, there are
various OpenMP 5 features missing, some of them on the compiler side only, but
others (e.g. the allocators) on the library side too.
We can only claim OpenMP 5 support when everything is supported (hopefully in
GCC 11).
>From gcc-bugs-return-664171-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 30 01:42:22 2019
Return-Path: <gcc-bugs-return-664171-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 39929 invoked by alias); 30 Dec 2019 01:42:21 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 34054 invoked by uid 48); 30 Dec 2019 01:42:18 -0000
From: "danglin at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/67834] Local references inside comdat groups
Date: Mon, 30 Dec 2019 01:42:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 9.2.1
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: danglin at gcc dot gnu.org
X-Bugzilla-Status: REOPENED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: attachments.created
Message-ID: <bug-67834-4-heWAwCQJPc@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-67834-4@http.gcc.gnu.org/bugzilla/>
References: <bug-67834-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02241.txt.bz2
Content-length: 247

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67834

--- Comment #10 from John David Anglin <danglin at gcc dot gnu.org> ---
Created attachment 47564
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47564&action=edit
Patch

Untested fix.
>From gcc-bugs-return-664172-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 30 02:11:15 2019
Return-Path: <gcc-bugs-return-664172-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 64565 invoked by alias); 30 Dec 2019 02:11:15 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 64541 invoked by uid 48); 30 Dec 2019 02:11:10 -0000
From: "euloanty at live dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: =?UTF-8?B?W0J1ZyBjKysvOTMwOTVdIEJ1aWxkIExhdGVzdCBHQ0MgZmFpbCAuLi8uLi9n?= =?UTF-8?B?Y2MvZ2NjL2dpbXBsZS1mb2xkLmM6NDE0Njo4OiBlcnJvcjogZXhwZWN0ZWQg?= =?UTF-8?B?dW5xdWFsaWZpZWQtaWQgYmVmb3JlIOKAmHRocm93c+KAmQ==?Date: Mon, 30 Dec 2019 02:11:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: euloanty at live dot com
X-Bugzilla-Status: WAITING
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-93095-4-sXf7pMzFGd@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93095-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93095-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02242.txt.bz2
Content-length: 911

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93095

--- Comment #2 from fdlbxtqi <euloanty at live dot com> ---
(In reply to Jakub Jelinek from comment #1)
> Can't reproduce and don't see anything problematic on that code.
> Unless e.g. the system headers are defining throws as a macro, can you e.g.
> attach preprocessed gimple-fold.ii?  (E.g. do cd gcc; make gimple-fold.o
> and cut'n'paste the command line, replace -c with -E -dD)?

probably because I am working on a new Herbception's compiler?

BTW, throws should not be an identifier since Herb Sutter is going to use this
as his deterministic exception.

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0709r0.pdf


I am starting his herbception project.

https://github.com/expnkx/gcc/commit/41109f8f8c8f257e4b0ef691b27b1bcfe3d6d3ab

Can you give me some guidelines about how to start a new C++ branch???
Herbception is a huge change
>From gcc-bugs-return-664173-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 30 02:14:26 2019
Return-Path: <gcc-bugs-return-664173-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 102750 invoked by alias); 30 Dec 2019 02:14:26 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 101721 invoked by uid 48); 30 Dec 2019 02:14:22 -0000
From: "euloanty at live dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/93059] char and char8_t does not talk with each other with memcpy. std::copy std::copy_n, std::fill, std::fill_n, std::uninitialized_copy std::uninitialized_copy_n, std::fill, std::uninitialized_fill_n fails to convert to memxxx functions
Date: Mon, 30 Dec 2019 02:14:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: euloanty at live dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-93059-4-kcNJU49unz@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93059-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93059-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02243.txt.bz2
Content-length: 1574

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93059

--- Comment #27 from fdlbxtqi <euloanty at live dot com> ---
(In reply to Bernd Edlinger from comment #26)
> (In reply to fdlbxtqi from comment #2)
> > Also find a bug of __memmove
> > 
> >   /*
> >    * A constexpr wrapper for __builtin_memmove.
> >    * @param __num The number of elements of type _Tp (not bytes).
> >    */
> >   template<bool _IsMove, typename _Tp>
> >     _GLIBCXX14_CONSTEXPR
> >     inline void*
> >     __memmove(_Tp* __dst, const _Tp* __src, size_t __num)
> >     {
> > #ifdef __cpp_lib_is_constant_evaluated
> >       if (std::is_constant_evaluated())
> > 	{
> > 	  for(; __num > 0; --__num)
> > 	    {
> > 	      if constexpr (_IsMove)
> > 		*__dst = std::move(*__src);
> > 	      else
> > 		*__dst = *__src;
> > 	      ++__src;
> > 	      ++__dst;
> > 	    }
> > 	  return __dst;
> > 	}
> >       else
> > #endif
> > 	return __builtin_memmove(__dst, __src, sizeof(_Tp) * __num);
> >       return __dst;
> >     }
> > 
> > The last 2nd line return __dst is wrong. It should not exist.
> 
> Sorry, I don't know what this function is all about.
> But to me the code in the ifdef looks totally bogus.
> First it returns __dst+__num, while memmove is sopposed
> to return __dst, and is is somehow clear that
> __dst and __src do not overlap?
> 
> because if they do the loop would overwite the __dst buffer before
> __src is fully copied?

Nope. It is C++20's new feature if(std::is_constant_evaluated()) which allows
you to write functions can be used both in compile and runtime.
>From gcc-bugs-return-664174-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 30 02:21:35 2019
Return-Path: <gcc-bugs-return-664174-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 3779 invoked by alias); 30 Dec 2019 02:21:35 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 3733 invoked by uid 48); 30 Dec 2019 02:21:31 -0000
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: =?UTF-8?B?W0J1ZyBjKysvOTMwOTVdIEJ1aWxkIExhdGVzdCBHQ0MgZmFpbCAuLi8uLi9n?= =?UTF-8?B?Y2MvZ2NjL2dpbXBsZS1mb2xkLmM6NDE0Njo4OiBlcnJvcjogZXhwZWN0ZWQg?= =?UTF-8?B?dW5xdWFsaWZpZWQtaWQgYmVmb3JlIOKAmHRocm93c+KAmQ==?Date: Mon, 30 Dec 2019 02:21:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: pinskia at gcc dot gnu.org
X-Bugzilla-Status: WAITING
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-93095-4-fu8KJZmpyy@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93095-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93095-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02244.txt.bz2
Content-length: 1138

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93095

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to fdlbxtqi from comment #2)
> (In reply to Jakub Jelinek from comment #1)
> > Can't reproduce and don't see anything problematic on that code.
> > Unless e.g. the system headers are defining throws as a macro, can you e.g.
> > attach preprocessed gimple-fold.ii?  (E.g. do cd gcc; make gimple-fold.o
> > and cut'n'paste the command line, replace -c with -E -dD)?
> 
> probably because I am working on a new Herbception's compiler?

oh.  So if that is the case, then you need to have a list of reserved
identifiers and start changing them.  But that change should go in at the
begining of stage 1.


> ...
> Can you give me some guidelines about how to start a new C++ branch???
> Herbception is a huge change

There are four ways:
1) have a svn branch (https://gcc.gnu.org/svn.html)
2) have a git only branch (https://gcc.gnu.org/wiki/GitMirror )
3) wait for the svn moved over to git and make a git branch.
4) have a local git branch which can be rebased on the new git after the move
has happened.
>From gcc-bugs-return-664175-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 30 03:26:15 2019
Return-Path: <gcc-bugs-return-664175-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 25107 invoked by alias); 30 Dec 2019 03:26:15 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 25007 invoked by uid 48); 30 Dec 2019 03:26:11 -0000
From: "fxue at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/93084] [10 regression] Infinite loop in ipa-cp when building clang with LTO+PGO
Date: Mon, 30 Dec 2019 03:26:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: fxue at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc
Message-ID: <bug-93084-4-OU787Hr8h7@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93084-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93084-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02245.txt.bz2
Content-length: 455

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93084

fxue at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fxue at gcc dot gnu.org

--- Comment #5 from fxue at gcc dot gnu.org ---
I guess some situation is missed in self_recursively_generated_p(), this causes
propagation along scc explode.
>From gcc-bugs-return-664176-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 30 03:34:47 2019
Return-Path: <gcc-bugs-return-664176-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 43029 invoked by alias); 30 Dec 2019 03:34:47 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 42952 invoked by uid 48); 30 Dec 2019 03:34:43 -0000
From: "fxue at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/93084] [10 regression] Infinite loop in ipa-cp when building clang with LTO+PGO
Date: Mon, 30 Dec 2019 03:34:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: fxue at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-93084-4-y0BYdSi3vN@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93084-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93084-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02246.txt.bz2
Content-length: 168

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93084

--- Comment #6 from fxue at gcc dot gnu.org ---
Could you share how you build clang with PGO, and train workload?
>From gcc-bugs-return-664177-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 30 06:32:17 2019
Return-Path: <gcc-bugs-return-664177-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 7237 invoked by alias); 30 Dec 2019 06:32:17 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 7197 invoked by uid 48); 30 Dec 2019 06:32:13 -0000
From: "mcccs at gmx dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/93082] macOS Authorization.h needs fixinclude
Date: Mon, 30 Dec 2019 06:32:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 9.1.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: mcccs at gmx dot com
X-Bugzilla-Status: NEW
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-93082-4-gxwuB8obcn@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93082-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93082-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02247.txt.bz2
Content-length: 769

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93082

--- Comment #2 from mcccs at gmx dot com ---
Reported on the "other side" https://bugs.llvm.org/show_bug.cgi?id=44406

Changing it to enum works too, my only doubt is that it has a different width
and sign (but better than not compiling)

Updated patch, thank you Andrew:

fix = {
    hackname  = darwin_authorization;
    mach      = "*-*-darwin*";
    files     = Frameworks/Security.framework/Headers/Authorization.h;
    select    =
    "static const size_t kAuthorizationExternalFormLength = 32;\n";
    c_fix     = format;
    c_fix_arg =
    "enum { kAuthorizationExternalFormLength = 32 };\n";
    test_text =
    "static const size_t kAuthorizationExternalFormLength = 32;\n";
};
>From gcc-bugs-return-664178-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 30 07:51:14 2019
Return-Path: <gcc-bugs-return-664178-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 38833 invoked by alias); 30 Dec 2019 07:51:14 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 38300 invoked by uid 55); 30 Dec 2019 07:51:10 -0000
From: "rguenther at suse dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/61502] == comparison on "one-past" pointer gives wrong result
Date: Mon, 30 Dec 2019 07:51:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 4.8.1
X-Bugzilla-Keywords: wrong-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: rguenther at suse dot de
X-Bugzilla-Status: SUSPENDED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-61502-4-IGtCHcnZtT@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-61502-4@http.gcc.gnu.org/bugzilla/>
References: <bug-61502-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02248.txt.bz2
Content-length: 3165

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61502

--- Comment #36 from rguenther at suse dot de <rguenther at suse dot de> ---
On December 29, 2019 6:42:55 PM GMT+01:00, ch3root at openwall dot com
<gcc-bugzilla@gcc.gnu.org> wrote:
>https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61502
>
>--- Comment #35 from Alexander Cherepanov <ch3root at openwall dot com>
>---
>What remains in this pr is the original problem.
>
>1. The best way to demonstrate that there is indeed a bug here is
>probably to
>compare representation of pointers directly:
>
>----------------------------------------------------------------------
>#include <string.h>
>#include <stdio.h>
>
>__attribute__((noipa)) // imagine it in a separate TU
>static void *opaque(void *p) { return p; }
>
>int main()
>{
>    int x[5];
>    int y[2];
>
>    void *p = &x;
>    void *q = &y + 1;
>
>    printf("val1: %d\n", p == q);
>    printf("repr: %d\n", memcmp(&p, &q, sizeof(void *)) == 0);
>
>    opaque(&p); // move the next comparison to runtime
>    printf("val2: %d\n", p == q);
>
>    opaque(q);
>}
>----------------------------------------------------------------------
>$ gcc -std=c11 -pedantic -Wall -Wextra -O3 test.c && ./a.out
>val1: 0
>repr: 1
>val2: 1
>----------------------------------------------------------------------
>gcc x86-64 version: gcc (GCC) 10.0.0 20191229 (experimental)
>----------------------------------------------------------------------
>
>C11, 6.2.6.1p4: "Two values (other than NaNs) with the same object
>representation compare equal". Our pointers are not NaNs and have the
>same
>representation so should compare equal.
>
>DR 260 allows one to argue that representation of these pointers could
>change
>right between the checks but IMHO this part of DR 260 is just wrong as
>it makes
>copying objects byte-by-byte impossible. See
>https://bugs.llvm.org/show_bug.cgi?id=44188 for a nice illustration.
>
>While at it, the testcase also demonstrates that the comparison `p ==
>q` is
>unstable.
>
>I'm not taking sides here, just stating that the standard and the
>compiler
>disagree.
>
>2. C++ at some point made results of the discussed comparison
>unspecified --
>https://eel.is/c++draft/expr.eq#3.1 . According to the DR linked to in
>comment
>27, it's done to make the definition usable at compile time. Perhaps
>harmonization of the standards should move in this direction, not vice
>versa.
>
>3. OTOH clang was fixed to be complying with C11.
>
>4. What seems missing in the discussion is a clear description of
>benefits of
>the current gcc's approach. Does it make some optimizations easier to
>implement? Does it enable other optimizations?
>Obviously, it could be used to fold `a + i == b` to `0` if `a` and `b`
>are two
>different known arrays and `i` is unknown

That's indeed the main thing. Basically it allows points-to analysis work at
all in the presence of non-constant offsets. 

 (or known to be exactly the
>length of
>`a`). But this is probably not helpful for aliasing analysis as AA
>doesn't deal
>with past-the-end pointers. And optimization of loops like in comment
>19 is
>probably not superhelpful too:-)
>From gcc-bugs-return-664179-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 30 08:06:16 2019
Return-Path: <gcc-bugs-return-664179-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 97797 invoked by alias); 30 Dec 2019 08:06:16 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 97734 invoked by uid 48); 30 Dec 2019 08:06:12 -0000
From: "build+gcc@de-korte.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libgomp/93097] Wrong OpenMP version reported
Date: Mon, 30 Dec 2019 08:06:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libgomp
X-Bugzilla-Version: 9.2.1
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: build+gcc@de-korte.org
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Resolution: INVALID
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status resolution
Message-ID: <bug-93097-4-nRw7XhFy8T@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93097-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93097-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02249.txt.bz2
Content-length: 551

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93097

Arjen de Korte <build+gcc@de-korte.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #2 from Arjen de Korte <build+gcc@de-korte.org> ---
I see. I took the availability of a single OpenMP 5 function as an indication
of full support. I was wrong. Apologies for the noise.
>From gcc-bugs-return-664180-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 30 09:21:08 2019
Return-Path: <gcc-bugs-return-664180-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 36362 invoked by alias); 30 Dec 2019 09:21:08 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 36324 invoked by uid 48); 30 Dec 2019 09:21:04 -0000
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/93098] [10 Regression] ICE with negative shifter
Date: Mon, 30 Dec 2019 09:21:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: jakub at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 10.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on assigned_to everconfirmed attachments.created
Message-ID: <bug-93098-4-oy3aJfIVQj@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93098-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93098-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02250.txt.bz2
Content-length: 690

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93098

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2019-12-30
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 47565
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47565&action=edit
gcc10-pr93098.patch

Untested fix.
>From gcc-bugs-return-664181-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 30 10:01:49 2019
Return-Path: <gcc-bugs-return-664181-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 107880 invoked by alias); 30 Dec 2019 10:01:49 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 107786 invoked by uid 48); 30 Dec 2019 10:01:40 -0000
From: "rainer@emrich-ebersheim.de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libobjc/93099] New: Multiple definition error while linking libobjc.dll.a
Date: Mon, 30 Dec 2019 10:01:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libobjc
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: rainer@emrich-ebersheim.de
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone
Message-ID: <bug-93099-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02251.txt.bz2
Content-length: 9283

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93099

            Bug ID: 93099
           Summary: Multiple definition error while linking libobjc.dll.a
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libobjc
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rainer@emrich-ebersheim.de
  Target Milestone: ---

libtool: link:
/opt/devel/SCRATCH/tmp.F6n0FMZOiy/gcc-10.0.0/gcc-10.0.0/./gcc/xgcc
-B/opt/devel/SCRATCH/tmp.F6n0FMZOiy/gcc-10.0.0/gcc-10.0.0/./gcc/
-L/opt/devel/gnu/gcc/MINGW_NT/x86_64-w64-mingw32/mingw-w64-runtime-trunk-svn/gcc-10.0.0/x86_64-w64-mingw32/lib
-L/opt/devel/gnu/gcc/MINGW_NT/x86_64-w64-mingw32/mingw-w64-runtime-trunk-svn/gcc-10.0.0/mingw/lib
-isystem
/opt/devel/gnu/gcc/MINGW_NT/x86_64-w64-mingw32/mingw-w64-runtime-trunk-svn/gcc-10.0.0/x86_64-w64-mingw32/include
-isystem
/opt/devel/gnu/gcc/MINGW_NT/x86_64-w64-mingw32/mingw-w64-runtime-trunk-svn/gcc-10.0.0/mingw/include
-B/opt/devel/gnu/gcc/MINGW_NT/x86_64-w64-mingw32/mingw-w64-runtime-trunk-svn/gcc-10.0.0/x86_64-w64-mingw32/bin/
-B/opt/devel/gnu/gcc/MINGW_NT/x86_64-w64-mingw32/mingw-w64-runtime-trunk-svn/gcc-10.0.0/x86_64-w64-mingw32/lib/
-isystem
/opt/devel/gnu/gcc/MINGW_NT/x86_64-w64-mingw32/mingw-w64-runtime-trunk-svn/gcc-10.0.0/x86_64-w64-mingw32/include
-isystem
/opt/devel/gnu/gcc/MINGW_NT/x86_64-w64-mingw32/mingw-w64-runtime-trunk-svn/gcc-10.0.0/x86_64-w64-mingw32/sys-include
   -shared  .libs/NXConstStr.o .libs/Object.o .libs/Protocol.o
.libs/accessors.o .libs/linking.o .libs/class.o .libs/encoding.o .libs/error.o
.libs/gc.o .libs/hash.o .libs/init.o .libs/ivars.o .libs/memory.o
.libs/methods.o .libs/nil_method.o .libs/objc-foreach.o .libs/objc-sync.o
.libs/objects.o .libs/protocols.o .libs/sarray.o .libs/selector.o
.libs/sendmsg.o .libs/thr.o .libs/exception.o  
-L/opt/devel/gnu/gcc/MINGW_NT/x86_64-w64-mingw32/mingw-w64-runtime-trunk-svn/gcc-10.0.0/x86_64-w64-mingw32/lib
-L/opt/devel/gnu/gcc/MINGW_NT/x86_64-w64-mingw32/mingw-w64-runtime-trunk-svn/gcc-10.0.0/mingw/lib
 -shared-libgcc   -o .libs/libobjc-4.dll -Wl,--enable-auto-image-base -Xlinker
--out-implib -Xlinker .libs/libobjc.dll.a
D:\opt\devel\gnu\gcc\MINGW_NT\x86_64-w64-mingw32\mingw-w64-runtime-trunk-svn\gcc-10.0.0\bin\ld.exe:
.libs/Protocol.o:D:/opt/devel/gnu/src/gcc-mingw-w64/gcc-10.0.0/libobjc/objc/runtime.h:919:
multiple definition of `_objc_load_callback';
.libs/Object.o:D:/opt/devel/gnu/src/gcc-mingw-w64/gcc-10.0.0/libobjc/objc/runtime.h:919:
first defined here
D:\opt\devel\gnu\gcc\MINGW_NT\x86_64-w64-mingw32\mingw-w64-runtime-trunk-svn\gcc-10.0.0\bin\ld.exe:
.libs/class.o:D:/opt/devel/gnu/src/gcc-mingw-w64/gcc-10.0.0/libobjc/objc/runtime.h:919:
multiple definition of `_objc_load_callback';
.libs/Object.o:D:/opt/devel/gnu/src/gcc-mingw-w64/gcc-10.0.0/libobjc/objc/runtime.h:919:
first defined here
D:\opt\devel\gnu\gcc\MINGW_NT\x86_64-w64-mingw32\mingw-w64-runtime-trunk-svn\gcc-10.0.0\bin\ld.exe:
.libs/encoding.o:D:/opt/devel/gnu/src/gcc-mingw-w64/gcc-10.0.0/libobjc/objc/runtime.h:919:
multiple definition of `_objc_load_callback';
.libs/Object.o:D:/opt/devel/gnu/src/gcc-mingw-w64/gcc-10.0.0/libobjc/objc/runtime.h:919:
first defined here
D:\opt\devel\gnu\gcc\MINGW_NT\x86_64-w64-mingw32\mingw-w64-runtime-trunk-svn\gcc-10.0.0\bin\ld.exe:
.libs/hash.o:D:/opt/devel/gnu/src/gcc-mingw-w64/gcc-10.0.0/libobjc/objc/runtime.h:919:
multiple definition of `_objc_load_callback';
.libs/Object.o:D:/opt/devel/gnu/src/gcc-mingw-w64/gcc-10.0.0/libobjc/objc/runtime.h:919:
first defined here
D:\opt\devel\gnu\gcc\MINGW_NT\x86_64-w64-mingw32\mingw-w64-runtime-trunk-svn\gcc-10.0.0\bin\ld.exe:
.libs/init.o:D:/opt/devel/gnu/src/gcc-mingw-w64/gcc-10.0.0/libobjc/objc/runtime.h:919:
multiple definition of `_objc_load_callback';
.libs/Object.o:D:/opt/devel/gnu/src/gcc-mingw-w64/gcc-10.0.0/libobjc/objc/runtime.h:919:
first defined here
D:\opt\devel\gnu\gcc\MINGW_NT\x86_64-w64-mingw32\mingw-w64-runtime-trunk-svn\gcc-10.0.0\bin\ld.exe:
.libs/ivars.o:D:/opt/devel/gnu/src/gcc-mingw-w64/gcc-10.0.0/libobjc/objc/runtime.h:919:
multiple definition of `_objc_load_callback';
.libs/Object.o:D:/opt/devel/gnu/src/gcc-mingw-w64/gcc-10.0.0/libobjc/objc/runtime.h:919:
first defined here
D:\opt\devel\gnu\gcc\MINGW_NT\x86_64-w64-mingw32\mingw-w64-runtime-trunk-svn\gcc-10.0.0\bin\ld.exe:
.libs/memory.o:D:/opt/devel/gnu/src/gcc-mingw-w64/gcc-10.0.0/libobjc/objc/runtime.h:919:
multiple definition of `_objc_load_callback';
.libs/Object.o:D:/opt/devel/gnu/src/gcc-mingw-w64/gcc-10.0.0/libobjc/objc/runtime.h:919:
first defined here
D:\opt\devel\gnu\gcc\MINGW_NT\x86_64-w64-mingw32\mingw-w64-runtime-trunk-svn\gcc-10.0.0\bin\ld.exe:
.libs/methods.o:D:/opt/devel/gnu/src/gcc-mingw-w64/gcc-10.0.0/libobjc/objc/runtime.h:919:
multiple definition of `_objc_load_callback';
.libs/Object.o:D:/opt/devel/gnu/src/gcc-mingw-w64/gcc-10.0.0/libobjc/objc/runtime.h:919:
first defined here
D:\opt\devel\gnu\gcc\MINGW_NT\x86_64-w64-mingw32\mingw-w64-runtime-trunk-svn\gcc-10.0.0\bin\ld.exe:
.libs/objc-foreach.o:D:/opt/devel/gnu/src/gcc-mingw-w64/gcc-10.0.0/libobjc/objc/runtime.h:919:
multiple definition of `_objc_load_callback';
.libs/Object.o:D:/opt/devel/gnu/src/gcc-mingw-w64/gcc-10.0.0/libobjc/objc/runtime.h:919:
first defined here
D:\opt\devel\gnu\gcc\MINGW_NT\x86_64-w64-mingw32\mingw-w64-runtime-trunk-svn\gcc-10.0.0\bin\ld.exe:
.libs/objc-sync.o:D:/opt/devel/gnu/src/gcc-mingw-w64/gcc-10.0.0/libobjc/objc/runtime.h:919:
multiple definition of `_objc_load_callback';
.libs/Object.o:D:/opt/devel/gnu/src/gcc-mingw-w64/gcc-10.0.0/libobjc/objc/runtime.h:919:
first defined here
D:\opt\devel\gnu\gcc\MINGW_NT\x86_64-w64-mingw32\mingw-w64-runtime-trunk-svn\gcc-10.0.0\bin\ld.exe:
.libs/objects.o:D:/opt/devel/gnu/src/gcc-mingw-w64/gcc-10.0.0/libobjc/objc/runtime.h:919:
multiple definition of `_objc_load_callback';
.libs/Object.o:D:/opt/devel/gnu/src/gcc-mingw-w64/gcc-10.0.0/libobjc/objc/runtime.h:919:
first defined here
D:\opt\devel\gnu\gcc\MINGW_NT\x86_64-w64-mingw32\mingw-w64-runtime-trunk-svn\gcc-10.0.0\bin\ld.exe:
.libs/protocols.o:D:/opt/devel/gnu/src/gcc-mingw-w64/gcc-10.0.0/libobjc/objc/runtime.h:919:
multiple definition of `_objc_load_callback';
.libs/Object.o:D:/opt/devel/gnu/src/gcc-mingw-w64/gcc-10.0.0/libobjc/objc/runtime.h:919:
first defined here
D:\opt\devel\gnu\gcc\MINGW_NT\x86_64-w64-mingw32\mingw-w64-runtime-trunk-svn\gcc-10.0.0\bin\ld.exe:
.libs/sarray.o:D:/opt/devel/gnu/src/gcc-mingw-w64/gcc-10.0.0/libobjc/objc/runtime.h:919:
multiple definition of `_objc_load_callback';
.libs/Object.o:D:/opt/devel/gnu/src/gcc-mingw-w64/gcc-10.0.0/libobjc/objc/runtime.h:919:
first defined here
D:\opt\devel\gnu\gcc\MINGW_NT\x86_64-w64-mingw32\mingw-w64-runtime-trunk-svn\gcc-10.0.0\bin\ld.exe:
.libs/selector.o:D:/opt/devel/gnu/src/gcc-mingw-w64/gcc-10.0.0/libobjc/objc/runtime.h:919:
multiple definition of `_objc_load_callback';
.libs/Object.o:D:/opt/devel/gnu/src/gcc-mingw-w64/gcc-10.0.0/libobjc/objc/runtime.h:919:
first defined here
D:\opt\devel\gnu\gcc\MINGW_NT\x86_64-w64-mingw32\mingw-w64-runtime-trunk-svn\gcc-10.0.0\bin\ld.exe:
.libs/sendmsg.o:D:/opt/devel/gnu/src/gcc-mingw-w64/gcc-10.0.0/libobjc/objc/runtime.h:919:
multiple definition of `_objc_load_callback';
.libs/Object.o:D:/opt/devel/gnu/src/gcc-mingw-w64/gcc-10.0.0/libobjc/objc/runtime.h:919:
first defined here
D:\opt\devel\gnu\gcc\MINGW_NT\x86_64-w64-mingw32\mingw-w64-runtime-trunk-svn\gcc-10.0.0\bin\ld.exe:
.libs/thr.o:D:/opt/devel/gnu/src/gcc-mingw-w64/gcc-10.0.0/libobjc/objc/runtime.h:919:
multiple definition of `_objc_load_callback';
.libs/Object.o:D:/opt/devel/gnu/src/gcc-mingw-w64/gcc-10.0.0/libobjc/objc/runtime.h:919:
first defined here
D:\opt\devel\gnu\gcc\MINGW_NT\x86_64-w64-mingw32\mingw-w64-runtime-trunk-svn\gcc-10.0.0\bin\ld.exe:
.libs/thr.o:D:/opt/devel/gnu/src/gcc-mingw-w64/gcc-10.0.0/libobjc/objc/message.h:113:
multiple definition of `__objc_msg_forward2';
.libs/sendmsg.o:D:/opt/devel/gnu/src/gcc-mingw-w64/gcc-10.0.0/libobjc/objc/message.h:113:
first defined here
D:\opt\devel\gnu\gcc\MINGW_NT\x86_64-w64-mingw32\mingw-w64-runtime-trunk-svn\gcc-10.0.0\bin\ld.exe:
.libs/thr.o:D:/opt/devel/gnu/src/gcc-mingw-w64/gcc-10.0.0/libobjc/objc/message.h:112:
multiple definition of `__objc_msg_forward';
.libs/sendmsg.o:D:/opt/devel/gnu/src/gcc-mingw-w64/gcc-10.0.0/libobjc/objc/message.h:112:
first defined here
D:\opt\devel\gnu\gcc\MINGW_NT\x86_64-w64-mingw32\mingw-w64-runtime-trunk-svn\gcc-10.0.0\bin\ld.exe:
.libs/exception.o:D:/opt/devel/gnu/src/gcc-mingw-w64/gcc-10.0.0/libobjc/objc/runtime.h:919:
multiple definition of `_objc_load_callback';
.libs/Object.o:D:/opt/devel/gnu/src/gcc-mingw-w64/gcc-10.0.0/libobjc/objc/runtime.h:919:
first defined here
collect2.exe: error: ld returned 1 exit status
make[2]: *** [Makefile:265: libobjc.la] Error 1
make[2]: Leaving directory
'/opt/devel/SCRATCH/tmp.F6n0FMZOiy/gcc-10.0.0/gcc-10.0.0/x86_64-w64-mingw32/libobjc'
make[1]: *** [Makefile:21010: all-target-libobjc] Error 2
make[1]: Leaving directory
'/opt/devel/SCRATCH/tmp.F6n0FMZOiy/gcc-10.0.0/gcc-10.0.0'
make: *** [Makefile:1009: all] Error 2
>From gcc-bugs-return-664182-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 30 10:04:47 2019
Return-Path: <gcc-bugs-return-664182-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 111275 invoked by alias); 30 Dec 2019 10:04:46 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 111257 invoked by uid 48); 30 Dec 2019 10:04:42 -0000
From: "rainer@emrich-ebersheim.de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libobjc/93099] Multiple definition error while linking libobjc.dll.a
Date: Mon, 30 Dec 2019 10:04:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libobjc
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: rainer@emrich-ebersheim.de
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-93099-4-RS9sE85F1D@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93099-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93099-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02252.txt.bz2
Content-length: 150

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93099

--- Comment #1 from Rainer Emrich <rainer@emrich-ebersheim.de> ---
That's with revision 279747.
>From gcc-bugs-return-664183-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 30 10:27:52 2019
Return-Path: <gcc-bugs-return-664183-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 13234 invoked by alias); 30 Dec 2019 10:27:52 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 13197 invoked by uid 48); 30 Dec 2019 10:27:48 -0000
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libobjc/93099] Multiple definition error while linking libobjc.dll.a
Date: Mon, 30 Dec 2019 10:27:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libobjc
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: pinskia at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: pinskia at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on assigned_to everconfirmed attachments.created
Message-ID: <bug-93099-4-XrDc69e3v5@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93099-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93099-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02253.txt.bz2
Content-length: 795

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93099

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2019-12-30
           Assignee|unassigned at gcc dot gnu.org      |pinskia at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Created attachment 47566
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47566&action=edit
Patch to try

Can you try this patch?
It should fix the problem but I cannot test it as I don't have a windows build
machine setup.
>From gcc-bugs-return-664184-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 30 10:28:11 2019
Return-Path: <gcc-bugs-return-664184-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 14575 invoked by alias); 30 Dec 2019 10:28:11 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 14520 invoked by uid 48); 30 Dec 2019 10:28:07 -0000
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libobjc/93099] [10 Regression] Multiple definition error while linking libobjc.dll.a
Date: Mon, 30 Dec 2019 10:28:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libobjc
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords: build
X-Bugzilla-Severity: normal
X-Bugzilla-Who: pinskia at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: pinskia at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 10.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: keywords target_milestone short_desc
Message-ID: <bug-93099-4-NtcC6O0O5m@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93099-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93099-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02254.txt.bz2
Content-length: 565

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93099

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |build
   Target Milestone|---                         |10.0
            Summary|Multiple definition error   |[10 Regression] Multiple
                   |while linking libobjc.dll.a |definition error while
                   |                            |linking libobjc.dll.a
>From gcc-bugs-return-664185-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 30 10:31:47 2019
Return-Path: <gcc-bugs-return-664185-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 19215 invoked by alias); 30 Dec 2019 10:31:47 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 19146 invoked by uid 48); 30 Dec 2019 10:31:43 -0000
From: "bhalevy at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/93100] New: gcc -fsanitize­dress inhibits -Wuninitialized
Date: Mon, 30 Dec 2019 10:31:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: middle-end
X-Bugzilla-Version: 9.2.1
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: bhalevy at gmail dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone
Message-ID: <bug-93100-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02255.txt.bz2
Content-length: 1787

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93100

            Bug ID: 93100
           Summary: gcc -fsanitize=address inhibits -Wuninitialized
           Product: gcc
           Version: 9.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bhalevy at gmail dot com
  Target Milestone: ---

Similar to -fsanitize=undefined in
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89284, -fsanitize=address also
inhibits -Wuninitialized.

$ cat prog.cc
struct A
{
  bool a;
  int i;
};

void f (void)
{
  struct A a;

  if (a.i) {   // expecting -Wuninitialized wearning
    struct A b = a;
  }
}

void g (void)
{
  struct A a;

  if (a.a) {   // expecting -Wuninitialized wearning
    struct A b = a;
  }
}

$ gcc -O0 -S -Wuninitialized -Wno-unused prog.cc --sanitize=address
<no output>

$ gcc -O0 -S -Wuninitialized -Wno-unused prog.cc
prog.cc: In function ‘void f()’:
prog.cc:11:9: warning: ‘a.A::i’ is used uninitialized in this function
[-Wuninitialized]
   11 |   if (a.i) {   // expecting -Wuninitialized wearning
      |       ~~^
prog.cc:12:14: warning: ‘a’ may be used uninitialized in this function
[-Wmaybe-uninitialized]
   12 |     struct A b = a;
      |              ^
prog.cc: In function ‘void g()’:
prog.cc:20:9: warning: ‘a.A::a’ is used uninitialized in this function
[-Wuninitialized]
   20 |   if (a.a) {   // expecting -Wuninitialized wearning
      |       ~~^
prog.cc:21:14: warning: ‘a’ may be used uninitialized in this function
[-Wmaybe-uninitialized]
   21 |     struct A b = a;
      |              ^
>From gcc-bugs-return-664186-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 30 10:34:48 2019
Return-Path: <gcc-bugs-return-664186-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 21752 invoked by alias); 30 Dec 2019 10:34:47 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 21703 invoked by uid 55); 30 Dec 2019 10:34:43 -0000
From: "tkoenig at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/92961] [8/9/10 Regression] ICE in gfc_zero_size_array, at fortran/arith.c:1680
Date: Mon, 30 Dec 2019 10:34:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords: ice-on-invalid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: tkoenig at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: tkoenig at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-92961-4-OsE0PkRQbW@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-92961-4@http.gcc.gnu.org/bugzilla/>
References: <bug-92961-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02256.txt.bz2
Content-length: 1097

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92961

--- Comment #2 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
Author: tkoenig
Date: Mon Dec 30 10:34:11 2019
New Revision: 279762

URL: https://gcc.gnu.org/viewcvs?rev=279762&root=gcc&view=rev
Log:
Catch division by zero errors in array sizes.

2019-12-30  Thomas Koenig  <tkoenig@gcc.gnu.org>

        PR fortran/92961
        * gfortran.h (gfc_seen_div0): Add declaration.
        * arith.h (gfc_seen_div0): Add definition.
        (eval_intrinsic): For integer division by zero, set gfc_seen_div0.
        * decl.c (variable_decl):  If resolution resp. simplification
        fails for array spec and a division of zero error has been
        seen, return MATCH_ERROR.

2019-12-30  Thomas Koenig  <tkoenig@gcc.gnu.org>

        PR fortran/92961
        * gfortran.dg/arith_divide_2.f90: New test.


Added:
    trunk/gcc/testsuite/gfortran.dg/arith_divide_2.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/arith.c
    trunk/gcc/fortran/decl.c
    trunk/gcc/fortran/gfortran.h
    trunk/gcc/testsuite/ChangeLog
>From gcc-bugs-return-664187-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 30 10:44:14 2019
Return-Path: <gcc-bugs-return-664187-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 29744 invoked by alias); 30 Dec 2019 10:44:14 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 29718 invoked by uid 55); 30 Dec 2019 10:44:10 -0000
From: "tkoenig at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/91541] [C++17] Exception specification of operator= of node-based containers may be broken
Date: Mon, 30 Dec 2019 10:44:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Version: 9.1.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: tkoenig at gcc dot gnu.org
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Resolution: WONTFIX
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-91541-4-ZV01mVwzqn@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-91541-4@http.gcc.gnu.org/bugzilla/>
References: <bug-91541-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02257.txt.bz2
Content-length: 1350

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91541

--- Comment #11 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
Author: tkoenig
Date: Mon Dec 30 10:43:38 2019
New Revision: 279763

URL: https://gcc.gnu.org/viewcvs?rev=279763&root=gcc&view=rev
Log:
Remove KIND argument from INDEX so it does not mess up scalarization.

2019-12-30  Thomas Koenig  <tkoenig@gcc.gnu.org>

        PR fortran/91541
        * intrinsic.c (add_sym_4ind): New function.
        (add_functions): Use it for INDEX.
        (resolve_intrinsic): Also call f1m for INDEX.
        * intrinsic.h (gfc_resolve_index_func): Adjust prototype to
        take a gfc_arglist instead of individual arguments.
        * iresolve.c (gfc_resolve_index_func): Adjust arguments.
        Remove KIND argument if present, and make sure this is
        not done twice.
        * trans-decl.c: Include "intrinsic.h".
        (gfc_get_extern_function_decl): Special case for resolving INDEX.

2019-12-30  Thomas Koenig  <tkoenig@gcc.gnu.org>

        PR fortran/91541
        * gfortran.dg/index_3.f90: New test.


Added:
    trunk/gcc/testsuite/gfortran.dg/index_3.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/intrinsic.c
    trunk/gcc/fortran/intrinsic.h
    trunk/gcc/fortran/iresolve.c
    trunk/gcc/fortran/trans-decl.c
    trunk/gcc/testsuite/ChangeLog
>From gcc-bugs-return-664188-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 30 10:44:47 2019
Return-Path: <gcc-bugs-return-664188-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 30620 invoked by alias); 30 Dec 2019 10:44:44 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 30577 invoked by uid 48); 30 Dec 2019 10:44:39 -0000
From: "tkoenig at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/92961] [8/9 Regression] ICE in gfc_zero_size_array, at fortran/arith.c:1680
Date: Mon, 30 Dec 2019 10:44:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 9.2.1
X-Bugzilla-Keywords: ice-on-invalid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: tkoenig at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: tkoenig at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: version short_desc
Message-ID: <bug-92961-4-NmqAMunVpO@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-92961-4@http.gcc.gnu.org/bugzilla/>
References: <bug-92961-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02258.txt.bz2
Content-length: 601

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92961

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|10.0                        |9.2.1
            Summary|[8/9/10 Regression] ICE in  |[8/9 Regression] ICE in
                   |gfc_zero_size_array, at     |gfc_zero_size_array, at
                   |fortran/arith.c:1680        |fortran/arith.c:1680

--- Comment #3 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
Fixed on trunk so far.
>From gcc-bugs-return-664190-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 30 10:46:56 2019
Return-Path: <gcc-bugs-return-664190-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 33346 invoked by alias); 30 Dec 2019 10:46:55 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 33318 invoked by uid 48); 30 Dec 2019 10:46:51 -0000
From: "m.cencora at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/93101] New: [regression] ICE - aggregate initialization of base
Date: Mon, 30 Dec 2019 10:46:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: m.cencora at gmail dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone
Message-ID: <bug-93101-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02260.txt.bz2
Content-length: 730

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93101

            Bug ID: 93101
           Summary: [regression] ICE - aggregate initialization of base
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: m.cencora at gmail dot com
  Target Milestone: ---

Following code snippet compiles fine with gcc 9 and earlier, but ICEs on gcc
10.0.0 20191229 (verified on godbolt.org)

#include <string>
struct base
{
    std::string bla;
};

struct foo : base
{
    int a;
};

base makeBase();
int getInt();

foo create()
{
    return foo{ makeBase(), getInt() };
}
>From gcc-bugs-return-664189-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 30 10:46:11 2019
Return-Path: <gcc-bugs-return-664189-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 32492 invoked by alias); 30 Dec 2019 10:46:11 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 32430 invoked by uid 48); 30 Dec 2019 10:46:06 -0000
From: "tkoenig at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/91651] [F03] Implement KIND argument for INDEX
Date: Mon, 30 Dec 2019 10:46:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: tkoenig at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: tkoenig at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-91651-4-XBWEDCtpFW@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-91651-4@http.gcc.gnu.org/bugzilla/>
References: <bug-91651-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02259.txt.bz2
Content-length: 1349

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91651

--- Comment #3 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
Author: tkoenig
Date: Mon Dec 30 10:43:38 2019
New Revision: 279763

URL: https://gcc.gnu.org/viewcvs?rev=279763&root=gcc&view=rev
Log:
Remove KIND argument from INDEX so it does not mess up scalarization.

2019-12-30  Thomas Koenig  <tkoenig@gcc.gnu.org>

        PR fortran/91541
        * intrinsic.c (add_sym_4ind): New function.
        (add_functions): Use it for INDEX.
        (resolve_intrinsic): Also call f1m for INDEX.
        * intrinsic.h (gfc_resolve_index_func): Adjust prototype to
        take a gfc_arglist instead of individual arguments.
        * iresolve.c (gfc_resolve_index_func): Adjust arguments.
        Remove KIND argument if present, and make sure this is
        not done twice.
        * trans-decl.c: Include "intrinsic.h".
        (gfc_get_extern_function_decl): Special case for resolving INDEX.

2019-12-30  Thomas Koenig  <tkoenig@gcc.gnu.org>

        PR fortran/91541
        * gfortran.dg/index_3.f90: New test.


Added:
    trunk/gcc/testsuite/gfortran.dg/index_3.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/intrinsic.c
    trunk/gcc/fortran/intrinsic.h
    trunk/gcc/fortran/iresolve.c
    trunk/gcc/fortran/trans-decl.c
    trunk/gcc/testsuite/ChangeLog
>From gcc-bugs-return-664192-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 30 10:48:40 2019
Return-Path: <gcc-bugs-return-664192-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 35588 invoked by alias); 30 Dec 2019 10:48:21 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 35429 invoked by uid 55); 30 Dec 2019 10:48:16 -0000
From: "tkoenig at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/91651] [F03] Implement KIND argument for INDEX
Date: Mon, 30 Dec 2019 10:48:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: tkoenig at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: tkoenig at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-91651-4-iGSZWybQOU@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-91651-4@http.gcc.gnu.org/bugzilla/>
References: <bug-91651-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02262.txt.bz2
Content-length: 452

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91651

--- Comment #4 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
Author: tkoenig
Date: Mon Dec 30 10:47:39 2019
New Revision: 279765

URL: https://gcc.gnu.org/viewcvs?rev=279765&root=gcc&view=rev
Log:
2019-12-30  Thomas Koenig  <tkoenig@gcc.gnu.org>

        PR fortran/91651
        Fix PR numbers in ChangeLog.

Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/testsuite/ChangeLog
>From gcc-bugs-return-664191-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 30 10:48:00 2019
Return-Path: <gcc-bugs-return-664191-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 34562 invoked by alias); 30 Dec 2019 10:48:00 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 34528 invoked by uid 48); 30 Dec 2019 10:47:56 -0000
From: "tkoenig at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/91541] [C++17] Exception specification of operator= of node-based containers may be broken
Date: Mon, 30 Dec 2019 10:48:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Version: 9.1.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: tkoenig at gcc dot gnu.org
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Resolution: WONTFIX
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc
Message-ID: <bug-91541-4-8tzhXVErxQ@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-91541-4@http.gcc.gnu.org/bugzilla/>
References: <bug-91541-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02261.txt.bz2
Content-length: 467

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91541

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tkoenig at gcc dot gnu.org

--- Comment #12 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
(In reply to Thomas Koenig from comment #11)

*sigh* corrected in the original PR.
>From gcc-bugs-return-664193-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 30 10:49:52 2019
Return-Path: <gcc-bugs-return-664193-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 36841 invoked by alias); 30 Dec 2019 10:49:52 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 36804 invoked by uid 48); 30 Dec 2019 10:49:48 -0000
From: "tkoenig at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/91651] [F03] Implement KIND argument for INDEX
Date: Mon, 30 Dec 2019 10:49:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: tkoenig at gcc dot gnu.org
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Resolution: FIXED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: tkoenig at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status resolution
Message-ID: <bug-91651-4-wUt9wXmoKv@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-91651-4@http.gcc.gnu.org/bugzilla/>
References: <bug-91651-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02263.txt.bz2
Content-length: 464

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91651

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
Fixed on trunk.

Thanks for the bug report!
>From gcc-bugs-return-664194-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 30 11:01:29 2019
Return-Path: <gcc-bugs-return-664194-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 91168 invoked by alias); 30 Dec 2019 11:01:29 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 91152 invoked by uid 89); 30 Dec 2019 11:01:29 -0000
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=-8.1 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,KAM_SHORT autolearn=ham version=3.3.1 spammy=supplying
X-HELO: nikam.ms.mff.cuni.cz
Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 30 Dec 2019 11:01:27 +0000
Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202)	id 97903280863; Mon, 30 Dec 2019 12:01:24 +0100 (CET)
Date: Mon, 30 Dec 2019 11:01:00 -0000
From: Jan Hubicka <hubicka@ucw.cz>
To: "fxue at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
Cc: gcc-bugs@gcc.gnu.org
Subject: Re: [Bug tree-optimization/93084] [10 regression] Infinite loop in ipa-cp when building clang with LTO+PGO
Message-ID: <20191230110124.GE44622@kam.mff.cuni.cz>
References: <bug-93084-4@http.gcc.gnu.org/bugzilla/> <bug-93084-4-y0BYdSi3vN@http.gcc.gnu.org/bugzilla/>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <bug-93084-4-y0BYdSi3vN@http.gcc.gnu.org/bugzilla/>
User-Agent: Mutt/1.10.1 (2018-07-13)
X-SW-Source: 2019-12/txt/msg02264.txt.bz2
Content-length: 2820

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id“084
>
> --- Comment #6 from fxue at gcc dot gnu.org ---
> Could you share how you build clang with PGO, and train workload?
It needs a lot of patience.   If you have patch I can try it since I
still have the train data and corresponding gcc tree.

I do the following. Pretty much imitating what
utils/collect_and_build_with_pgo.py does.

First I build instrumented compiler and train it on testsuite (it takes
a long time and probably could be omitted)

cmake -G Ninja /aux/hubicka/llvm \
  -DCLANG_TABLEGEN=/aux/hubicka/llvm/out/stage1/bin/clang-tblgen \
  -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_CXX_COMPILER=/aux/hubicka/trunk-install/bin/g++ \
  -DCMAKE_C_COMPILER=/aux/hubicka/trunk-install/bin/gcc \
  -DCMAKE_INSTALL_PREFIX=/aux/hubicka/llvm10-install-gccfdolto \
  -DLLVM_BINUTILS_INCDIR=/aux/hubicka/binutils-install/include/ \
  -DLLVM_BUILD_RUNTIME=No \
  -DLLVM_TABLEGEN=/aux/hubicka/llvm/out/stage1/bin/llvm-tblgen \
  -DLLVM_TARGETS_TO_BUILD=X86 \
  -DCMAKE_RANLIB=/aux/hubicka/trunk-install/bin/gcc-ranlib \
  -DCMAKE_AR=/aux/hubicka/trunk-install/bin/gcc-ar \
  -DCMAKE_C_FLAGS="-O2 -flto=auto -flifetime-dse=1 -fno-semantic-interposition -fprofile-generate" \
  -DCMAKE_CXX_FLAGS="-O2 -flto=auto -flifetime-dse=1 -fno-semantic-interposition -fprofile-generate" \
  -DLLVM_PARALLEL_LINK_JOBS=1
ninja clang lld
ninja check-llvm check-clang

next I do train build in new directory.

cmake -G Ninja /aux/hubicka/llvm \
  -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_CXX_COMPILER=/aux/hubicka/llvm/out/instrumented-gcc/bin/clang++ \
  -DCMAKE_C_COMPILER=/aux/hubicka/llvm/out/instrumented-gcc/bin/clang
ninja all

then I tar gcda files collected in the first build directory

    cd /aux/hubicka/llvm/instrumented-gcc/
    tar czvf ../clang-profile.tgz `find . -name "*.gcda"`

and do final build supplying the gcda files.

tar xzvf ../clang-profile.tgz
cmake -G Ninja /aux/hubicka/llvm \
  -DCLANG_TABLEGEN=/aux/hubicka/llvm/out/stage1/bin/clang-tblgen \
  -DCMAKE_BUILD_TYPE=Release  -DCMAKE_C_FLAGS=-Wno-backend-plugin  \
  -DLLVM_TABLEGEN=/aux/hubicka/llvm/out/stage1/bin/llvm-tblgen \
  -DCMAKE_RANLIB=/aux/hubicka/trunk-install/bin/gcc-ranlib \
  -DCMAKE_AR=/aux/hubicka/trunk-install/bin/gcc-ar \
  -DCMAKE_C_FLAGS="-O2 -fno-semantic-interposition -fprofile-use -Wno-missing-profile -flto=auto -flifetime-dse=1  -fprofile-correction -Wno-error" \
  -DCMAKE_CXX_FLAGS="-O2 -fno-semantic-interposition -fprofile-use -Wno-missing-profile -flifetime-dse=1  -flto=auto -fprofile-correction -Wno-error" \
  -DLLVM_TARGETS_TO_BUILD=X86 \
  -DCMAKE_CXX_COMPILER=/aux/hubicka/trunk-install/bin/g++ \
  -DCMAKE_C_COMPILER=/aux/hubicka/trunk-install/bin/gcc  \
  -DLLVM_BINUTILS_INCDIR=/aux/hubicka/binutils-install/include/ \
  -DLLVM_PARALLEL_LINK_JOBS=1
ninja all


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libstdc++/93059] char and char8_t does not talk with each other with memcpy. std::copy std::copy_n, std::fill, std::fill_n, std::uninitialized_copy std::uninitialized_copy_n, std::fill, std::uninitialized_fill_n fails to convert to memxxx functions
       [not found] <bug-93059-4@http.gcc.gnu.org/bugzilla/>
  2019-12-29  3:33 ` [Bug libstdc++/93059] char and char8_t does not talk with each other with memcpy. std::copy std::copy_n, std::fill, std::fill_n, std::uninitialized_copy std::uninitialized_copy_n, std::fill, std::uninitialized_fill_n fails to convert to memxxx functions euloanty at live dot com
@ 2019-12-31  6:03 ` euloanty at live dot com
  2020-09-02 14:51 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: euloanty at live dot com @ 2019-12-31  6:03 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93059

fdlbxtqi <euloanty at live dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #47559|0                           |1
        is obsolete|                            |
  Attachment #47560|0                           |1
        is obsolete|                            |
  Attachment #47570|0                           |1
        is obsolete|                            |
  Attachment #47571|0                           |1
        is obsolete|                            |

--- Comment #33 from fdlbxtqi <euloanty at live dot com> ---
Created attachment 47574
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47574&action=edit
copy_backward bug fixed for the last patch

going to further run testsuite
>From gcc-bugs-return-664254-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Dec 31 07:25:35 2019
Return-Path: <gcc-bugs-return-664254-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 122678 invoked by alias); 31 Dec 2019 07:25:35 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 122613 invoked by uid 48); 31 Dec 2019 07:25:31 -0000
From: "bernd.edlinger at hotmail dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/93059] char and char8_t does not talk with each other with memcpy. std::copy std::copy_n, std::fill, std::fill_n, std::uninitialized_copy std::uninitialized_copy_n, std::fill, std::uninitialized_fill_n fails to convert to memxxx functions
Date: Tue, 31 Dec 2019 07:25:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: bernd.edlinger at hotmail dot de
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-93059-4-Dl8viYmTcM@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93059-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93059-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02324.txt.bz2
Content-length: 333

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93059

--- Comment #34 from Bernd Edlinger <bernd.edlinger at hotmail dot de> ---
(In reply to fdlbxtqi from comment #33)
> Created attachment 47574 [details]
> copy_backward bug fixed for the last patch
> 
> going to further run testsuite

Your test does not contain any test cases.
>From gcc-bugs-return-664255-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Dec 31 08:44:17 2019
Return-Path: <gcc-bugs-return-664255-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 18542 invoked by alias); 31 Dec 2019 08:44:17 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 18511 invoked by uid 48); 31 Dec 2019 08:44:13 -0000
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug preprocessor/93109] New: #undefine suggests #define but not #undef
Date: Tue, 31 Dec 2019 08:44:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: preprocessor
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords: diagnostic
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: pinskia at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter target_milestone
Message-ID: <bug-93109-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02325.txt.bz2
Content-length: 729

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93109

            Bug ID: 93109
           Summary: #undefine suggests #define but not #undef
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: enhancement
          Priority: P3
         Component: preprocessor
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

t.c:24:2: error: invalid preprocessing directive #undefine; did you mean
#define?
   24 | #undefine shift
      |  ^~~~~~~~
      |  define


I was not thinking when I was writing code for a second but the preprocessor
definitely could do better at the suggestion.
>From gcc-bugs-return-664256-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Dec 31 09:35:55 2019
Return-Path: <gcc-bugs-return-664256-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 86817 invoked by alias); 31 Dec 2019 09:35:55 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 86804 invoked by uid 89); 31 Dec 2019 09:35:55 -0000
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=-15.4 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=H*Ad:U*rth, HX-Languages-Length:1223, anybody
X-HELO: us-smtp-delivery-1.mimecast.com
Received: from us-smtp-2.mimecast.com (HELO us-smtp-delivery-1.mimecast.com) (207.211.31.81) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 31 Dec 2019 09:35:53 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;	s=mimecast20190719; t\x1577784951;	h=from:from:reply-to:reply-to:subject:subject:date:date:	 message-id:message-id:to:to:cc:cc:mime-version:mime-version:	 content-type:content-type:	 content-transfer-encoding:content-transfer-encoding:	 in-reply-to:in-reply-to:references:references;	bh=SCoIGxjgEKS7o529mrjIp6IRUNH1tgMP+pFZI2LMAuQ=;	b=ajXSvpvPiEvQB//QIDRJJ6V52gvPbRhie3QGCizNmtXewQyD+2/xH0ljZ4MOEysXbNG4WU	IGnOKA88pSXfJ5HTtY0n3wPCzPemTej9/UYAbbdvA9Bjstnsn26jnjPvSmlRW2MQ0YFDLq	6R9K0g35fojxrEDuMzYSuIwL9P70i2oReceived: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-421-VuVxMzQ5Okuj9fluJwnNZw-1; Tue, 31 Dec 2019 04:35:49 -0500
Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22])	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))	(No client certificate requested)	by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B07B3800D4E;	Tue, 31 Dec 2019 09:35:47 +0000 (UTC)
Received: from tucnak.zalov.cz (ovpn-116-112.ams2.redhat.com [10.36.116.112])	by smtp.corp.redhat.com (Postfix) with ESMTPS id 1C1C7107A44C;	Tue, 31 Dec 2019 09:35:43 +0000 (UTC)
Received: from tucnak.zalov.cz (localhost [127.0.0.1])	by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id xBV9Zf5D019144;	Tue, 31 Dec 2019 10:35:42 +0100
Received: (from jakub@localhost)	by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id xBV9ZeOH019143;	Tue, 31 Dec 2019 10:35:40 +0100
Date: Tue, 31 Dec 2019 09:35:00 -0000
From: Jakub Jelinek <jakub@redhat.com>
To: Ayush Mittal <ayush.m@samsung.com>
Cc: gcc-bugs@gcc.gnu.org, rth@redhat.com, jakub@gcc.gnu.org,        avnish.jain@samsung.com, a.sahrawat@samsung.com, v.narang@samsung.com,        maninder1.s@samsung.com, akhilesh.k@samsung.com
Subject: Re: [v2] libgomp: Add destructor to delete runtime env keys
Message-ID: <20191231093540.GX10088@tucnak>
Reply-To: Jakub Jelinek <jakub@redhat.com>
References: <CGME20191230141205epcas5p10746a819f7b169270122c56bf3309e18@epcas5p1.samsung.com> <1577714048-1939-1-git-send-email-ayush.m@samsung.com>
MIME-Version: 1.0
In-Reply-To: <1577714048-1939-1-git-send-email-ayush.m@samsung.com>
User-Agent: Mutt/1.11.3 (2019-02-01)
X-Mimecast-Spam-Score: 0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
X-SW-Source: 2019-12/txt/msg02326.txt.bz2
Content-length: 1197

On Mon, Dec 30, 2019 at 07:24:08PM +0530, Ayush Mittal wrote:
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,3 +1,7 @@
> +2019-12-30  Ayush Mittal  <ayush.m@samsung.com>
> +
> +	* libgomp: Add destructor to delete runtime env keys

This line should have been instead something like:
	* oacc-init.c (goacc_runtime_deinitialize): New function.
and it should go into libgomp/ChangeLog rather than toplevel ChangeLog.

Otherwise, LGTM.
Do you have anybody that can commit it for you, or do you want me to commit
it for you?

>  2019-12-20  Jerome Lambourg  <lambourg@adacore.com>
>  
>  	* MAINTAINERS (write_after_approval): Add myself.
> diff --git a/libgomp/oacc-init.c b/libgomp/oacc-init.c
> index 487a2cca61f..6aa5fd297d6 100644
> --- a/libgomp/oacc-init.c
> +++ b/libgomp/oacc-init.c
> @@ -858,6 +858,15 @@ goacc_runtime_initialize (void)
>    goacc_host_init ();
>  }
>  
> +static void __attribute__((destructor))
> +goacc_runtime_deinitialize (void)
> +{
> +#if !(defined HAVE_TLS || defined USE_EMUTLS)
> +  pthread_key_delete (goacc_tls_key);
> +#endif
> +  pthread_key_delete (goacc_cleanup_key);
> +}
> +
>  /* Compiler helper functions */
>  
>  attribute_hidden void

	Jakub


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libstdc++/93059] char and char8_t does not talk with each other with memcpy. std::copy std::copy_n, std::fill, std::fill_n, std::uninitialized_copy std::uninitialized_copy_n, std::fill, std::uninitialized_fill_n fails to convert to memxxx functions
       [not found] <bug-93059-4@http.gcc.gnu.org/bugzilla/>
  2019-12-29  3:33 ` [Bug libstdc++/93059] char and char8_t does not talk with each other with memcpy. std::copy std::copy_n, std::fill, std::fill_n, std::uninitialized_copy std::uninitialized_copy_n, std::fill, std::uninitialized_fill_n fails to convert to memxxx functions euloanty at live dot com
  2019-12-31  6:03 ` euloanty at live dot com
@ 2020-09-02 14:51 ` cvs-commit at gcc dot gnu.org
  2021-04-27 11:38 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-09-02 14:51 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93059

--- Comment #46 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:2f983fa69005b603ea1758a013b4134d5b0f24a8

commit r11-2981-g2f983fa69005b603ea1758a013b4134d5b0f24a8
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Wed Sep 2 15:17:24 2020 +0100

    libstdc++: Fix three-way comparison for std::array [PR 96851]

    The spaceship operator for std::array uses memcmp when the
    __is_byte<value_type> trait is true, but memcmp isn't usable in
    constexpr contexts. Also, memcmp should only be used for unsigned byte
    types, because it gives the wrong answer for signed chars with negative
    values.

    We can simply check std::is_constant_evaluated() so that we don't use
    memcmp during constant evaluation.

    To fix the problem of using memcmp for inappropriate types, this patch
    adds new __is_memcmp_ordered and __is_memcmp_ordered_with traits. These
    say whether using memcmp will give the right answer for ordering
    operations such as lexicographical_compare and three-way comparisons.
    The new traits can be used in several places, and can also be used to
    implement my suggestion in PR 93059 comment 37 to use memcmp for
    unsigned integers larger than one byte on big endian targets.

    libstdc++-v3/ChangeLog:

            PR libstdc++/96851
            * include/bits/cpp_type_traits.h (__is_memcmp_ordered):
            New trait that says if memcmp can be used for ordering.
            (__is_memcmp_ordered_with): Likewise, for two types.
            * include/bits/deque.tcc (__lex_cmp_dit): Use new traits
            instead of __is_byte and __numeric_traits.
            (__lexicographical_compare_aux1): Likewise.
            * include/bits/ranges_algo.h (__lexicographical_compare_fn):
            Likewise.
            * include/bits/stl_algobase.h (__lexicographical_compare_aux1)
            (__is_byte_iter): Likewise.
            * include/std/array (operator<=>): Likewise. Only use memcmp
            when std::is_constant_evaluated() is false.
            * testsuite/23_containers/array/comparison_operators/96851.cc:
            New test.
            * testsuite/23_containers/array/tuple_interface/get_neg.cc:
            Adjust dg-error line numbers.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libstdc++/93059] char and char8_t does not talk with each other with memcpy. std::copy std::copy_n, std::fill, std::fill_n, std::uninitialized_copy std::uninitialized_copy_n, std::fill, std::uninitialized_fill_n fails to convert to memxxx functions
       [not found] <bug-93059-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2020-09-02 14:51 ` cvs-commit at gcc dot gnu.org
@ 2021-04-27 11:38 ` jakub at gcc dot gnu.org
  2021-04-27 11:57 ` redi at gcc dot gnu.org
  2021-10-06 10:40 ` m.cencora at gmail dot com
  5 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-04-27 11:38 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93059

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|11.0                        |11.2

--- Comment #47 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 11.1 has been released, retargeting bugs to GCC 11.2.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libstdc++/93059] char and char8_t does not talk with each other with memcpy. std::copy std::copy_n, std::fill, std::fill_n, std::uninitialized_copy std::uninitialized_copy_n, std::fill, std::uninitialized_fill_n fails to convert to memxxx functions
       [not found] <bug-93059-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2021-04-27 11:38 ` jakub at gcc dot gnu.org
@ 2021-04-27 11:57 ` redi at gcc dot gnu.org
  2021-10-06 10:40 ` m.cencora at gmail dot com
  5 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2021-04-27 11:57 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93059

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|11.2                        |---

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libstdc++/93059] char and char8_t does not talk with each other with memcpy. std::copy std::copy_n, std::fill, std::fill_n, std::uninitialized_copy std::uninitialized_copy_n, std::fill, std::uninitialized_fill_n fails to convert to memxxx functions
       [not found] <bug-93059-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2021-04-27 11:57 ` redi at gcc dot gnu.org
@ 2021-10-06 10:40 ` m.cencora at gmail dot com
  5 siblings, 0 replies; 6+ messages in thread
From: m.cencora at gmail dot com @ 2021-10-06 10:40 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93059

m.cencora at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |m.cencora at gmail dot com

--- Comment #48 from m.cencora at gmail dot com ---
Any progress on this?

I have stumbled upon same inefficiencies when writing serialization code that
copies raw bytes to unsigned char* raw memory buffer from contiguous containers
(string/vector/array) with elements of any 1 byte trivially copyable type
(signed char, char, enum, UDT).

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-10-06 10:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-93059-4@http.gcc.gnu.org/bugzilla/>
2019-12-29  3:33 ` [Bug libstdc++/93059] char and char8_t does not talk with each other with memcpy. std::copy std::copy_n, std::fill, std::fill_n, std::uninitialized_copy std::uninitialized_copy_n, std::fill, std::uninitialized_fill_n fails to convert to memxxx functions euloanty at live dot com
2019-12-31  6:03 ` euloanty at live dot com
2020-09-02 14:51 ` cvs-commit at gcc dot gnu.org
2021-04-27 11:38 ` jakub at gcc dot gnu.org
2021-04-27 11:57 ` redi at gcc dot gnu.org
2021-10-06 10:40 ` m.cencora at gmail dot com

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).