From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 64545 invoked by alias); 11 Apr 2015 00:15:38 -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 64499 invoked by uid 89); 11 Apr 2015 00:15:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-vn0-f52.google.com Received: from mail-vn0-f52.google.com (HELO mail-vn0-f52.google.com) (209.85.216.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Sat, 11 Apr 2015 00:15:35 +0000 Received: by vnbf190 with SMTP id f190so9714397vnb.1 for ; Fri, 10 Apr 2015 17:15:33 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.60.103.234 with SMTP id fz10mr4678375oeb.11.1428711333562; Fri, 10 Apr 2015 17:15:33 -0700 (PDT) Received: by 10.76.54.14 with HTTP; Fri, 10 Apr 2015 17:15:33 -0700 (PDT) In-Reply-To: References: <20150409182817.GD9798@redhat.com> Date: Sat, 11 Apr 2015 00:15:00 -0000 Message-ID: Subject: Re: [PATCH] Fix ctor reference folding (PR middle-end/65554) From: "H.J. Lu" To: Marek Polacek Cc: GCC Patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-04/txt/msg00488.txt.bz2 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; } };