From patchwork Thu Apr 14 14:30:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Polacek X-Patchwork-Id: 610479 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qm3591d33z9t3m for ; Fri, 15 Apr 2016 00:31:24 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=UHhCrdxC; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=cTb5UEscaJFb3tp5JNI3RUj7oQ/UXzbKMiFbp8kx1xPZjpuCHfLQq wFlamxUAjOjHP++tSCp4C1kXmab/n+5CaDYkEkgnJ+lmZhqGfAqZRG/t1l1X1ihg nt9XffCXoV5XkaR6UTuboBObMsnj89L0Xtrc0M0ZugitOXxIbcyTao= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=4WLRfpz5TeWqD0GIqWIL9Y9B9c4=; b=UHhCrdxCaySP5Zrorl4n AcHM2iHdzRGzYZf7PTo9b5PaTaEJtwJJ0AfRrkufuo0rIGztZHh2S9HU3DTl61DY uA1fPWMNhk2tkJFbFDxE+A1+he916mpyMUcwTzQs/HKf1Y2YtjN0rvBl5lgnWgSs fL/33XWuUNBWQIbraIvnaHY= Received: (qmail 92296 invoked by alias); 14 Apr 2016 14:31:14 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 92280 invoked by uid 89); 14 Apr 2016 14:31:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= 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; Thu, 14 Apr 2016 14:31:03 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5F2B281122; Thu, 14 Apr 2016 14:31:02 +0000 (UTC) Received: from redhat.com (ovpn-204-18.brq.redhat.com [10.40.204.18]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u3EEUw0W030308 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 14 Apr 2016 10:31:01 -0400 Date: Thu, 14 Apr 2016 16:30:58 +0200 From: Marek Polacek To: GCC Patches , Jason Merrill , Jan Hubicka Subject: PATCH to disable the canonical types check in verify_type (PR c++/70029) Message-ID: <20160414143058.GA28445@redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Looking at this PR again, seems we have reached conclusion that the way forward for GCC 6 is to temporarily disable the check, so I'm posting a patch for that, so as to finally resolve this PR. The problem is that the C++ FE violates the check when it sets FUNCTION_*_QUALIFIED flags. Bootstrapped/regtested on x86_64-linux, ok for trunk? 2016-04-14 Marek Polacek Jan Hubicka PR c++/70029 * tree.c (verify_type): Disable the canonical type of main variant check. * g++.dg/torture/pr70029.C: New test. Marek diff --git gcc/testsuite/g++.dg/torture/pr70029.C gcc/testsuite/g++.dg/torture/pr70029.C index e69de29..9592f0c 100644 --- gcc/testsuite/g++.dg/torture/pr70029.C +++ gcc/testsuite/g++.dg/torture/pr70029.C @@ -0,0 +1,12 @@ +// PR c++/70029 +// { dg-do compile } +// { dg-options "-std=c++11 -g -flto" } +// { dg-require-effective-target lto } + +struct A +{ + A(); + int foo() && __attribute__ ((__warn_unused_result__)) { return 0; } +}; + +A a; diff --git gcc/tree.c gcc/tree.c index ed28429..c64d720 100644 --- gcc/tree.c +++ gcc/tree.c @@ -13584,7 +13584,9 @@ verify_type (const_tree t) debug_tree (ct); error_found = true; } - if (TYPE_MAIN_VARIANT (t) == t && ct && TYPE_MAIN_VARIANT (ct) != ct) + /* FIXME: this is violated by the C++ FE as discussed in PR70029, when + FUNCTION_*_QUALIFIED flags are set. */ + if (0 && TYPE_MAIN_VARIANT (t) == t && ct && TYPE_MAIN_VARIANT (ct) != ct) { error ("TYPE_CANONICAL of main variant is not main variant"); debug_tree (ct);