This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix ctor reference folding (PR middle-end/65554)
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Marek Polacek <polacek at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 10 Apr 2015 17:06:32 -0700
- Subject: Re: [PATCH] Fix ctor reference folding (PR middle-end/65554)
- Authentication-results: sourceware.org; auth=none
- References: <20150409182817 dot GD9798 at redhat dot com>
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)
--
H.J.