From patchwork Sat Jun 9 14:34:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 163922 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]) by ozlabs.org (Postfix) with SMTP id A68A8B6FA7 for ; Sun, 10 Jun 2012 00:34:51 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1339857292; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Message-ID:Date:From:User-Agent:MIME-Version:To:Subject: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=bTurZP4 hmq3wcKmwvAz2rrztLts=; b=MG6KS3c9ySMozm0VCZfNqKlDmVq0YYsbZR6pAzr blO14WqFkwVgvxKT/CkOF+N5aSSbsh2uamHaWldkSxDDVo/nLqgThhzAlcGnvVjo SjgCSKwONwyYSpDRwcwVldYLXWZWmyggD+YLJaNjhrF3xCXKK726CXRrl8/nnHMw 95M4= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=RDD//kt5CiRkwn7/P4qFYX9MRwGlxHYDrEkrz4FX4H76WV0EHaNQM691YAcGjq aZ2CUB5z0lvAEsoCTaYAJjzrG4nFq3nfvqUJCHEklZGQjfd55NYNnZEOaW7Ya7U4 H82nTTHpbJE11OKPyUkk7Tx8KfSEKtnQ56GI+pX4I0zGk=; Received: (qmail 26180 invoked by alias); 9 Jun 2012 14:34:47 -0000 Received: (qmail 25824 invoked by uid 22791); 9 Jun 2012 14:34:44 -0000 X-SWARE-Spam-Status: No, hits=-6.1 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, SPF_HELO_PASS, TW_CX, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 09 Jun 2012 14:34:28 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q59EYRPO016926 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 9 Jun 2012 10:34:27 -0400 Received: from pebble.twiddle.home (vpn-8-248.rdu.redhat.com [10.11.8.248]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q59EYPBp009765 for ; Sat, 9 Jun 2012 10:34:26 -0400 Message-ID: <4FD35EEE.4070806@redhat.com> Date: Sat, 09 Jun 2012 07:34:22 -0700 From: Richard Henderson User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 MIME-Version: 1.0 To: GCC Patches Subject: Fix c++/53602, part 1 X-IsSubscribed: yes 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 One of two patches that make the testcase ICE go away, both of which make sense, but our release manager thought that only this simple one was appropriate for the 4.7 branch. Committed to 4.7 and mainline after testing on i686 with BOOT_CFLAGS -Os, and x86_64 (for sanity). r~ PR c++/53602 * combine-stack-adj.c (force_move_args_size_note): Add ARGS_SIZE note to a clobber insn when no other insn is available. diff --git a/gcc/combine-stack-adj.c b/gcc/combine-stack-adj.c index 6b6f74b..273252e 100644 --- a/gcc/combine-stack-adj.c +++ b/gcc/combine-stack-adj.c @@ -1,7 +1,7 @@ /* Combine stack adjustments. Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, - 2010 Free Software Foundation, Inc. + 2010, 2012 Free Software Foundation, Inc. This file is part of GCC. @@ -414,9 +414,10 @@ force_move_args_size_note (basic_block bb, rtx prev, rtx insn) { /* ??? We *must* have a place, lest we ICE on the lost adjustment. Options are: dummy clobber insn, nop, or prevent the removal of - the sp += 0 insn. Defer that decision until we can prove this - can actually happen. */ - gcc_unreachable (); + the sp += 0 insn. */ + /* TODO: Find another way to indicate to the dwarf2 code that we + have not in fact lost an adjustment. */ + test = emit_insn_before (gen_rtx_CLOBBER (VOIDmode, const0_rtx), insn); } add_reg_note (test, REG_ARGS_SIZE, XEXP (note, 0)); } diff --git a/gcc/testsuite/g++.dg/torture/pr53602.C b/gcc/testsuite/g++.dg/torture/pr53602.C new file mode 100644 index 0000000..1bb9cf4 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr53602.C @@ -0,0 +1,365 @@ +// { dg-do compile } +// { dg-options "-std=c++11" } + +namespace std +{ + template + struct pair + { + }; + struct input_iterator_tag + { + }; + struct forward_iterator_tag : public input_iterator_tag + { + }; + template + struct iterator + { + }; +} +namespace __gnu_cxx +{ + template + struct new_allocator + { + typedef _Tp pointer; + typedef _Tp value_type; + template + struct rebind + { + typedef new_allocator <_Tp1> other; + }; + }; +} +namespace std +{ + template + struct allocator : public __gnu_cxx::new_allocator <_Tp> + { + }; +} +extern "C" +{ + struct rtl_String; + void rtl_string_release (rtl_String *) throw (); + void rtl_string_newFromStr (rtl_String * *, const char *) throw (); +} +namespace std +{ + template struct binary_function; + template + struct equal_to : public binary_function <_Tp, _Tp, bool> + { + }; +} +namespace rtl +{ + struct OString + { + rtl_String * pData; + OString (const char *value) + { + rtl_string_newFromStr (&pData, value); + } + ~OString () + { + rtl_string_release (pData); + } + }; + struct OStringHash; +} +namespace boost +{ + template struct hash; + namespace unordered + { + template , class = std::equal_to , class = std::allocator >class unordered_set; + } + using boost::unordered::unordered_set; + namespace detail + { + template + struct if_true + { + template + struct then + { + typedef F type; + }; + }; + } + template struct pointer_to_other; + template + struct pointer_to_other + { + typedef U type; + }; + namespace unordered + { + namespace detail + { + template struct integral_constant + { + }; + struct choice9 + { + typedef char (&type)[9]; + }; + struct choice8:choice9 + { + }; + struct choice7:choice8 + { + }; + struct choice6:choice7 + { + }; + struct choice5:choice6 + { + }; + struct choice4:choice5 + { + }; + struct choice3:choice4 + { + }; + struct choice2:choice3 + { + }; + struct choice1:choice2 + { + }; + choice1 choose (); + template + struct rebind_wrap + { + typedef typename Alloc::template rebind ::other type; + }; + template + struct sfinae:T2 + { + }; + template + struct default_type_pointer + { + template + static boost::unordered::detail::sfinae test (choice1); + struct DefaultWrap + { + typedef Default pointer; + }; + enum { value = (1 == sizeof (test (choose ()))) }; + typedef typename boost::detail::if_true ::template then ::type::pointer type; + }; + template + struct default_type_const_pointer + { + template + static choice2::type test (choice2); + struct DefaultWrap + { + }; + enum { value = (1 == sizeof (test (choose ()))) }; + typedef typename boost::detail::if_true ::template then type; + }; + struct default_type_propagate_on_container_swap + { + struct DefaultWrap + { + }; + }; + template + struct allocator_traits + { + typedef typename Alloc::value_type value_type; + typedef typename default_type_pointer ::type pointer; + template + struct pointer_to_other : boost::pointer_to_other + { + }; + typedef typename default_type_const_pointer ::type>::type const_pointer; + }; + } + namespace detail + { + struct move_tag + { + }; + template struct table; + template + struct node_constructor + { + void construct_value () + { + } + }; + struct ptr_bucket + { + ptr_bucket () + { + } + }; + template + struct buckets + { + typedef Node node; + typedef Bucket bucket; + typedef typename boost::unordered::detail::rebind_wrap ::type node_allocator; + typedef typename boost::unordered::detail::rebind_wrap ::type bucket_allocator; + typedef boost::unordered::detail::allocator_traits node_allocator_traits; + typedef boost::unordered::detail::allocator_traits bucket_allocator_traits; + typedef typename node_allocator_traits::pointer node_pointer; + typedef typename node_allocator_traits::const_pointer const_node_pointer; + typedef typename bucket_allocator_traits::pointer bucket_pointer; + typedef boost::unordered::detail::node_constructor node_constructor; + bucket_pointer buckets_; + unsigned size_; + template + buckets (boost::unordered::detail::table , boost::unordered::detail::move_tag) : buckets_ (), size_ () + { + } + }; + struct functions + { + }; + } + } + namespace detail + { + template + struct iterator_base:std::iterator + { + }; + } + template + struct iterator:boost::detail::iterator_base + { + }; + namespace unordered + { + namespace iterator_detail + { + template struct c_iterator:public boost::iterator + { + friend bool operator== (c_iterator, c_iterator) + { + } + }; + } + namespace detail + { + template + struct value_base + { + typedef ValueType value_type; + value_type value () + { + } + }; + template + struct table:boost::unordered::detail::buckets + { + typedef typename Types::value_type value_type; + typedef boost::unordered::detail::buckets buckets; + typedef typename buckets::node_pointer node_pointer; + typedef typename buckets::const_node_pointer const_node_pointer; + typedef boost::unordered::iterator_detail::c_iterator c_iterator; + unsigned max_size () + { + } + }; + template struct table_impl; + template + struct ptr_node : boost::unordered::detail::value_base , boost::unordered::detail::ptr_bucket + { + boost::unordered::detail::ptr_bucket bucket_base; + unsigned hash_; + ptr_node () : bucket_base (), hash_ () + { + } + }; + template struct pick_node2 + { + }; + template struct pick_node2 *, boost::unordered::detail::ptr_bucket *> + { + typedef boost::unordered::detail::ptr_node node; + typedef boost::unordered::detail::ptr_bucket bucket; + }; + template struct pick_node + { + typedef boost::unordered::detail::allocator_traits >::type> tentative_node_traits; + typedef boost::unordered::detail::allocator_traits ::type> tentative_bucket_traits; + typedef pick_node2 pick; + typedef typename pick::node node; + typedef typename pick::bucket bucket; + }; + template + struct set + { + typedef boost::unordered::detail::set types; + typedef T value_type; + typedef P key_equal; + typedef typename boost::unordered::detail::rebind_wrap ::type allocator; + typedef boost::unordered::detail::pick_node pick; + typedef typename pick::node node; + typedef typename pick::bucket bucket; + typedef boost::unordered::detail::table_impl table; + }; + template + struct table_impl : boost::unordered::detail::table + { + typedef boost::unordered::detail::table table; + typedef typename table::node_constructor node_constructor; + table_impl () : table () + { + } + template + void insert_range_impl2 (node_constructor, InputIt) + { + } + }; + } + template + struct unordered_set + { + typedef T key_type; + typedef T value_type; + typedef boost::unordered::detail::set types; + typedef typename types::table table; + typedef typename table::c_iterator const_iterator; + typedef typename table::c_iterator iterator; + table table_; + bool empty () + { + return table_.size_; + } + iterator end () + { + } + std::pair insert (value_type) + { + } + unsigned erase (const key_type &); + const_iterator find (const key_type); + }; + template + unsigned unordered_set ::erase (const key_type &) + { + } + } +} +using namespace::rtl; +namespace skeletonmaker +{ + void + checkDefaultInterfaces (boost::unordered_set interfaces, + boost::unordered_set services, OString) + { + if (services.empty ()) + interfaces.erase ("com.sun.star.lang.XServiceInfo"); + else if (interfaces.find ("com.sun.star.lang.XServiceInfo") == interfaces.end ()) + interfaces.insert ("com.sun.star.lang.XServiceInfo"); + } +}