public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "evangelos at foutrelis dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/66007] New: [5 Regression] Narrowing conversion inside { } results in all zero elements in C++11 mode
Date: Mon, 04 May 2015 14:13:00 -0000	[thread overview]
Message-ID: <bug-66007-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 66007
           Summary: [5 Regression] Narrowing conversion inside { } results
                    in all zero elements in C++11 mode
           Product: gcc
           Version: 5.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: evangelos at foutrelis dot com
  Target Milestone: ---

Created attachment 35453
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35453&action=edit
Different narrowing behavior between GCC 4.9 and GCC 5

This is related to PR c++/65801 which allowed -Wno-narrowing to be used to
silence narrowing errors in C++11 mode.

Compiling something like "int foo[] = { 1, 0xFFFFFFFF, 3 };" with "-std=c++11
-Wno-error=narrowing" will initialize foo to {0, 0, 0}, whereas GCC 4.9 would
initialize it to {1, -1, 3}. (Attached is the assembler code generated by both
GCC versions.)

(This change in behavior causes at least one crash in Chromium; when using the
search box on the settings page, the tab will crash.)


             reply	other threads:[~2015-05-04 14:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-04 14:13 evangelos at foutrelis dot com [this message]
2015-05-04 14:34 ` [Bug c++/66007] " trippels at gcc dot gnu.org
2015-05-04 14:50 ` trippels at gcc dot gnu.org
2015-05-04 16:10 ` jakub at gcc dot gnu.org
2015-05-04 16:22 ` evangelos at foutrelis dot com
2015-05-04 16:31 ` [Bug c++/66007] [5/6 Regression] Narrowing conversion inside { } results in all zero elements in C++11 mode with -Wno-error=narrowing trippels at gcc dot gnu.org
2015-05-04 16:33 ` paolo.carlini at oracle dot com
2015-05-04 16:34 ` paolo.carlini at oracle dot com
2015-05-04 16:40 ` jakub at gcc dot gnu.org
2015-05-04 17:46 ` paolo.carlini at oracle dot com
2015-05-04 20:59 ` paolo at gcc dot gnu.org
2015-05-04 20:59 ` paolo at gcc dot gnu.org
2015-05-04 21:23 ` paolo.carlini at oracle dot com

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=bug-66007-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

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

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).