From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 110842 invoked by alias); 11 Apr 2015 02:16:19 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 110821 invoked by uid 89); 11 Apr 2015 02:16:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Sat, 11 Apr 2015 02:16:16 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t3B2GDCF009742 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 10 Apr 2015 22:16:14 -0400 Received: from redhat.com (ovpn-204-30.brq.redhat.com [10.40.204.30]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t3B2G9aB027117 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO); Fri, 10 Apr 2015 22:16:12 -0400 Date: Sat, 11 Apr 2015 02:16:00 -0000 From: Marek Polacek To: "H.J. Lu" Cc: GCC Patches Subject: Re: [PATCH] Fix ctor reference folding (PR middle-end/65554) Message-ID: <20150411021609.GE9798@redhat.com> References: <20150409182817.GD9798@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2015-04/txt/msg00491.txt.bz2 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 wrote: > > On Thu, Apr 9, 2015 at 11:28 AM, Marek Polacek 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 > >> Jakub Jelinek > >> > >> 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 ^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 ^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