From: Marek Polacek <polacek@redhat.com>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] Fix ctor reference folding (PR middle-end/65554)
Date: Sat, 11 Apr 2015 02:16:00 -0000 [thread overview]
Message-ID: <20150411021609.GE9798@redhat.com> (raw)
In-Reply-To: <CAMe9rOpF9RG52FeTB=m2byzLmCRuo6+FK17s6Q+eaRYOUHE4rg@mail.gmail.com>
On Fri, Apr 10, 2015 at 05:15:33PM -0700, H.J. Lu wrote:
> On Fri, Apr 10, 2015 at 5:06 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> > On Thu, Apr 9, 2015 at 11:28 AM, Marek Polacek <polacek@redhat.com> wrote:
> >> This test was failing at -O due to non-trivial conversion at assignment.
> >> The reason is that gimple_fold_builtin_memory_op created invalid GIMPLE,
> >> because fold_ctor_reference called via fold_const_aggregate_ref was
> >> discarding a cast, so it returned a different type than it got. Fixed by
> >> dropping useless type conversions only.
> >>
> >> It also fixes a stale comment that I noticed.
> >>
> >> Bootstrapped/regtested on x86_64-linux. Preapproved by Jakub on IRC,
> >> applying to trunk.
> >>
> >> 2015-04-09 Marek Polacek <polacek@redhat.com>
> >> Jakub Jelinek <jakub@redhat.com>
> >>
> >> PR middle-end/65554
> >> * gimple-fold.c (gimple_fold_builtin_memory_op): Update comment.
> >> (fold_ctor_reference): Use STRIP_USELESS_TYPE_CONVERSION instead
> >> of STRIP_NOPS.
> >>
> >> * g++.dg/opt/pr65554.C: New test.
> >>
> >
> > The testcase failed for 32-bit target:
> >
> > /export/gnu/import/git/gcc-test-ia32/src-trunk/gcc/testsuite/g++.dg/opt/pr65554.C:47:30:
> > fatal error: definition of std::initializer_list does not match
> > #include <initializer_list>^M
> > compilation terminated.^M
> > compiler exited with status 1
> > output is:
> > /export/gnu/import/git/gcc-test-ia32/src-trunk/gcc/testsuite/g++.dg/opt/pr65554.C:47:30:
> > fatal error: definition of std::initializer_list does not match
> > #include <initializer_list>^M
> > compilation terminated.^M
> >
> > FAIL: g++.dg/opt/pr65554.C -std=gnu++11 (test for excess errors)
>
> This patch fixes it.
>
> --
> H.J.
> ---
> diff --git a/gcc/testsuite/g++.dg/opt/pr65554.C
> b/gcc/testsuite/g++.dg/opt/pr65554.C
> index 70e43a4..1519964 100644
> --- a/gcc/testsuite/g++.dg/opt/pr65554.C
> +++ b/gcc/testsuite/g++.dg/opt/pr65554.C
> @@ -48,7 +48,7 @@ namespace std
> {
> typedef _E *const_iterator;
> _E *_M_array;
> - unsigned long _M_len;
> + __SIZE_TYPE__ _M_len;
> const_iterator begin () { return _M_array; }
> const_iterator end () { return begin () + 1; }
> };
Patch is ok.
Marek
prev parent reply other threads:[~2015-04-11 2:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-09 18:28 Marek Polacek
2015-04-11 0:06 ` H.J. Lu
2015-04-11 0:15 ` H.J. Lu
2015-04-11 2:16 ` Marek Polacek [this message]
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=20150411021609.GE9798@redhat.com \
--to=polacek@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=hjl.tools@gmail.com \
/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).