public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/94303] [8/9/10 Regression] Program result error When using global object array (partially initialized with a special constructor, and the rest with the default constructor)
Date: Wed, 25 Mar 2020 08:21:49 +0000	[thread overview]
Message-ID: <bug-94303-4-VgbfmgvJ9a@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-94303-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:5f18995e23edc944af3a401d9d9d3320a9362652

commit r10-7368-g5f18995e23edc944af3a401d9d9d3320a9362652
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Mar 25 09:21:05 2020 +0100

    varasm: Fix output_constructor where a RANGE_EXPR index needs to skip some
elts [PR94303]

    The following testcase is miscompiled, because output_constructor doesn't
    output the initializer correctly.  The FE creates {[1...2] = 9} in this
    case, and we emit .long 9; long 9; .zero 8 instead of the expected
    .zero 8; .long 9; .long 9.  If the CONSTRUCTOR is {[1] = 9, [2] = 9},
    output_constructor_regular_field has code to notice that the current
    location (local->total_bytes) is smaller than the location we want to write
    to (1*sizeof(elt)) and will call assemble_zeros to skip those.  But
    RANGE_EXPRs are handled by a different function which didn't do this,
    so for RANGE_EXPRs we emitted them properly only if local->total_bytes
    was always equal to the location where the RANGE_EXPR needs to start.

    2020-03-25  Jakub Jelinek  <jakub@redhat.com>

            PR middle-end/94303
            * varasm.c (output_constructor_array_range): If local->index
            RANGE_EXPR doesn't start at the current location in the
constructor,
            skip needed number of bytes using assemble_zeros or assert we don't
            go backwards.

            PR middle-end/94303
            * g++.dg/torture/pr94303.C: New test.

  parent reply	other threads:[~2020-03-25  8:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-24 16:25 [Bug c++/94303] New: " moonchasing1999 at gmail dot com
2020-03-24 17:07 ` [Bug c++/94303] [8/9/10 Regression] " jakub at gcc dot gnu.org
2020-03-24 17:09 ` redi at gcc dot gnu.org
2020-03-24 17:10 ` jakub at gcc dot gnu.org
2020-03-24 17:20 ` [Bug middle-end/94303] " jakub at gcc dot gnu.org
2020-03-25  7:41 ` redi at gcc dot gnu.org
2020-03-25  8:21 ` cvs-commit at gcc dot gnu.org [this message]
2020-03-25  8:23 ` [Bug middle-end/94303] [8/9 " jakub at gcc dot gnu.org
2020-04-07 19:04 ` cvs-commit at gcc dot gnu.org
2020-04-07 20:01 ` [Bug middle-end/94303] [8 " jakub at gcc dot gnu.org
2020-09-17 17:21 ` jakub 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-94303-4-VgbfmgvJ9a@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).