public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/66485] New: std::string single-character assignment operator
@ 2015-06-10 12:43 yurivkhan at gmail dot com
  2015-06-10 13:29 ` [Bug libstdc++/66485] " redi at gcc dot gnu.org
  2015-06-10 13:37 ` yurivkhan at gmail dot com
  0 siblings, 2 replies; 3+ messages in thread
From: yurivkhan at gmail dot com @ 2015-06-10 12:43 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 66485
           Summary: std::string single-character assignment operator
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: yurivkhan at gmail dot com
  Target Milestone: ---

gcc’s implementation of std::basic_string contains a non-standard and very
surprising operator= which accepts a single character or anything that is
implicitly castable thereto.

To reproduce:

===
#include <iostream>
#include <string>

int main()
{
    std::string s;
    s = 42;
    std::cout << s << "\n";
}
===

$ g++ --version
g++ (Ubuntu 4.8.2-19ubuntu1) 4.8.2[…]

$ g++ test.cpp
(with any of -std= variations, with or without -Wall -pedantic)

Observed behavior: compiles, runs, outputs a single character * (asterisk).

Expected behavior: compilation error, because the standard does not define any
such operator=.
>From gcc-bugs-return-488597-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Jun 10 12:49:15 2015
Return-Path: <gcc-bugs-return-488597-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 9714 invoked by alias); 10 Jun 2015 12:49: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 9673 invoked by uid 48); 10 Jun 2015 12:49:10 -0000
From: "kyukhin at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/66473] ICE: in extract_insn, at recog.c:2343 (unrecognizable insn) with -mavx512f
Date: Wed, 10 Jun 2015 12:49: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: 5.1.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: kyukhin at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: kyukhin at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 5.2
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-66473-4-DDIQdsBgpI@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-66473-4@http.gcc.gnu.org/bugzilla/>
References: <bug-66473-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: 2015-06/txt/msg00929.txt.bz2
Content-length: 401

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

--- Comment #5 from Kirill Yukhin <kyukhin at gcc dot gnu.org> ---
(In reply to Uroš Bizjak from comment #3)
> Kirill, you have much better facilities for testing, do you want to take the
> proposed patch from here?

Your patch is fine for sure. No AVX-512* tests fail.
The only nit is that I that I think we need regtest in patch as well.
>From gcc-bugs-return-488598-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Jun 10 12:52:37 2015
Return-Path: <gcc-bugs-return-488598-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 18569 invoked by alias); 10 Jun 2015 12:52:37 -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 18534 invoked by uid 48); 10 Jun 2015 12:52:33 -0000
From: "ubizjak at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/66473] ICE: in extract_insn, at recog.c:2343 (unrecognizable insn) with -mavx512f
Date: Wed, 10 Jun 2015 12:52: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: 5.1.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ubizjak at gmail dot com
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: kyukhin at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 5.2
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-66473-4-AeNz42eJYW@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-66473-4@http.gcc.gnu.org/bugzilla/>
References: <bug-66473-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: 2015-06/txt/msg00930.txt.bz2
Content-length: 358

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

--- Comment #6 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Kirill Yukhin from comment #5)

> Your patch is fine for sure. No AVX-512* tests fail.
> The only nit is that I that I think we need regtest in patch as well.

Yep, it will be added when the patch is submitted later today.
>From gcc-bugs-return-488599-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Jun 10 12:53:50 2015
Return-Path: <gcc-bugs-return-488599-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 27499 invoked by alias); 10 Jun 2015 12:53:50 -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 27346 invoked by uid 55); 10 Jun 2015 12:53:44 -0000
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/60656] [4.8 regression] x86 vectorization produces wrong code
Date: Wed, 10 Jun 2015 12:53: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: unknown
X-Bugzilla-Keywords: wrong-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: rguenth at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P2
X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.8.5
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-60656-4-85XEavFUYJ@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-60656-4@http.gcc.gnu.org/bugzilla/>
References: <bug-60656-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-06/txt/msg00931.txt.bz2
Content-length: 1482

https://gcc.gnu.org/bugzilla/show_bug.cgi?id`656

--- Comment #18 from Richard Biener <rguenth at gcc dot gnu.org> ---
Author: rguenth
Date: Wed Jun 10 12:53:09 2015
New Revision: 224327

URL: https://gcc.gnu.org/viewcvs?rev"4327&root=gcc&view=rev
Log:
2015-06-10  Richard Biener  <rguenther@suse.de>

        Backport from mainline
        2014-04-04  Cong Hou  <congh@google.com>

        PR tree-optimization/60656
        * tree-vect-stmts.c (supportable_widening_operation):
        Fix a bug that elements in a vector with vect_used_by_reduction
        property are incorrectly reordered when the operation on it is not
        consistant with the one in reduction operation.

        * gcc.dg/vect/pr60656.c: New test.

        2014-01-31  Richard Biener  <rguenther@suse.de>

        PR middle-end/59990
        * builtins.c (fold_builtin_memory_op): Make sure to not
        use a floating-point mode or a boolean or enumeral type for
        the copy operation.

        * gcc.dg/torture/pr59990.c: New testcase.
        * gcc.target/i386/pr49168-1.c: Adjust.

Added:
    branches/gcc-4_8-branch/gcc/testsuite/gcc.dg/torture/pr59990.c
    branches/gcc-4_8-branch/gcc/testsuite/gcc.dg/vect/pr60656.c
Modified:
    branches/gcc-4_8-branch/gcc/ChangeLog
    branches/gcc-4_8-branch/gcc/builtins.c
    branches/gcc-4_8-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_8-branch/gcc/testsuite/gcc.target/i386/pr49168-1.c
    branches/gcc-4_8-branch/gcc/tree-vect-stmts.c


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

* [Bug libstdc++/66485] std::string single-character assignment operator
  2015-06-10 12:43 [Bug libstdc++/66485] New: std::string single-character assignment operator yurivkhan at gmail dot com
@ 2015-06-10 13:29 ` redi at gcc dot gnu.org
  2015-06-10 13:37 ` yurivkhan at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: redi at gcc dot gnu.org @ 2015-06-10 13:29 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
See (4) at http://en.cppreference.com/w/cpp/string/basic_string/operator%3D

c.f. http://cplusplus.github.io/LWG/lwg-active.html#2372


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

* [Bug libstdc++/66485] std::string single-character assignment operator
  2015-06-10 12:43 [Bug libstdc++/66485] New: std::string single-character assignment operator yurivkhan at gmail dot com
  2015-06-10 13:29 ` [Bug libstdc++/66485] " redi at gcc dot gnu.org
@ 2015-06-10 13:37 ` yurivkhan at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: yurivkhan at gmail dot com @ 2015-06-10 13:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Yuri Khan <yurivkhan at gmail dot com> ---
Right, I somehow missed it. The overload is there. Sorry for the noise.


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

end of thread, other threads:[~2015-06-10 13:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-10 12:43 [Bug libstdc++/66485] New: std::string single-character assignment operator yurivkhan at gmail dot com
2015-06-10 13:29 ` [Bug libstdc++/66485] " redi at gcc dot gnu.org
2015-06-10 13:37 ` yurivkhan 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).