public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ktietz at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/63904] ICE when accessing array member of constexpr struct
Date: Tue, 18 Nov 2014 11:26:00 -0000	[thread overview]
Message-ID: <bug-63904-4-IZUcrIVCrF@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-63904-4@http.gcc.gnu.org/bugzilla/>

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

Kai Tietz <ktietz at gcc dot gnu.org> changed:

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

--- Comment #1 from Kai Tietz <ktietz at gcc dot gnu.org> ---
It seems to be related to constexpr.c:cxx_eval_vec_init_1 function.  The line '
int max = tree_to_shwi (array_type_nelts (atype));' there should be changed
into 'int max = (int) tree_to_uhwi (array_type_nelts (atype));'.

Issue is that array_type_netls returns size_type node (which is unsigned) with
UHWI_MAX as value.  Means that on conversions the value won't fit into shwi. 
By reading value as unsigned and then later on casting it to signed (btw
shouldn't we use here instead HOST_WIDE_INT?), we solve this issue.


  parent reply	other threads:[~2014-11-18 11:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-16 21:38 [Bug c++/63904] New: ICE when acessing " gcc-bugzilla at bmevers dot de
2014-11-18 10:49 ` [Bug c++/63904] ICE when accessing " paolo.carlini at oracle dot com
2014-11-18 11:26 ` ktietz at gcc dot gnu.org [this message]
2014-11-27 13:03 ` ktietz at gcc dot gnu.org
2014-11-27 13:07 ` ktietz at gcc dot gnu.org

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-63904-4-IZUcrIVCrF@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).