This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix ctor reference folding (PR middle-end/65554)


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]