From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28749 invoked by alias); 30 Jun 2005 20:21:53 -0000 Mailing-List: contact sid-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: sid-owner@sources.redhat.com Received: (qmail 28444 invoked by uid 22791); 30 Jun 2005 20:21:43 -0000 Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Thu, 30 Jun 2005 20:21:43 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j5UKLgTg025961 for ; Thu, 30 Jun 2005 16:21:42 -0400 Received: from pobox.toronto.redhat.com (pobox.toronto.redhat.com [172.16.14.4]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j5UKLfu13122 for ; Thu, 30 Jun 2005 16:21:42 -0400 Received: from touchme.toronto.redhat.com (IDENT:postfix@touchme.toronto.redhat.com [172.16.14.9]) by pobox.toronto.redhat.com (8.12.8/8.12.8) with ESMTP id j5UKLf1M012823 for ; Thu, 30 Jun 2005 16:21:41 -0400 Received: from tooth.toronto.redhat.com (tooth.toronto.redhat.com [172.16.14.29]) by touchme.toronto.redhat.com (Postfix) with ESMTP id B6878800108 for ; Thu, 30 Jun 2005 16:21:41 -0400 (EDT) Received: from tooth.toronto.redhat.com (IDENT:8TVMhyO0L7Uom22xj9w8qVdN8SvfOYqf@localhost [127.0.0.1]) by tooth.toronto.redhat.com (8.12.8/8.12.8) with ESMTP id j5UKLfdS008428 for ; Thu, 30 Jun 2005 16:21:41 -0400 Received: (from fche@localhost) by tooth.toronto.redhat.com (8.12.8/8.12.8/Submit) id j5UKLfd1008426 for sid@sources.redhat.com; Thu, 30 Jun 2005 16:21:41 -0400 Date: Thu, 30 Jun 2005 20:21:00 -0000 From: "Frank Ch. Eigler" To: sid@sources.redhat.com Subject: [aldyh@redhat.com: sid doesn't build with gcc 4.0.x] Message-ID: <20050630202141.GB7997@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-SW-Source: 2005-q2/txt/msg00055.txt.bz2 From: Aldy Hernandez To: cgen@sources.redhat.com [...] Subject: sid doesn't build with gcc 4.0.x Hi folks. Sid is not building with GCC 4.0 or above. The problem is in component/cgen-cpu/cgen-cpu.h's use of reinterpret_cast. The reinterpret_cast construct is not allowed amongst integers. Section 5.2.10 of the C++ specs list the specific set of conversions allowed by the construct. Converting from an integer to itself is not among them. Jason mentioned that y'all probably want to use static_cast. I also ran into a template problem which I tried fixing. The patch below showed no regressions when testing with GCC 3.4, but still has more regressions than 3.4 when building sid with 4.0. I'm not very C++ savvy (at all). I was hoping one of you cgen fancy folks could please take a look at this. The patch below is what you need to at least build with 4.0. Cheers. Aldy * component/interrupt/components.h (bus_size): Fix constructor to be legitimate C++. * component/cgen-cpu/cgen-cpu.h (GETMEMSF): Change reinterpret_cast to static_cast. (SETMEMSF): Same. (GETMEMDF): Same. (SETMEMDF): Same. Index: component/interrupt/components.h =================================================================== RCS file: /cvs/src/src/sid/component/interrupt/components.h,v retrieving revision 1.6 diff -c -p -r1.6 components.h *** component/interrupt/components.h 6 Feb 2003 20:40:26 -0000 1.6 --- component/interrupt/components.h 30 Jun 2005 15:12:20 -0000 *************** private: *** 223,229 **** // functions in template class template ! IntController::IntController (host_int_4 num_irq, host_int_4 num_fiq, host_int_4 ctrlr_features): --- 223,229 ---- // functions in template class template ! IntController::IntController (host_int_4 num_irq, host_int_4 num_fiq, host_int_4 ctrlr_features): Index: component/cgen-cpu/cgen-cpu.h =================================================================== RCS file: /cvs/src/src/sid/component/cgen-cpu/cgen-cpu.h,v retrieving revision 1.13 diff -c -p -r1.13 cgen-cpu.h *** component/cgen-cpu/cgen-cpu.h 3 Jun 2005 20:25:39 -0000 1.13 --- component/cgen-cpu/cgen-cpu.h 30 Jun 2005 15:12:20 -0000 *************** public: *** 172,194 **** inline SF GETMEMSF(PCADDR pc, IADDR addr) { ! return reinterpret_cast(this->read_insn_memory_4 (pc, addr)); } inline void SETMEMSF(PCADDR pc, ADDR addr, SF value) { ! return this->write_insn_memory_4 (pc, addr, reinterpret_cast(value)); } inline DF GETMEMDF(PCADDR pc, IADDR addr) { ! return reinterpret_cast(this->read_insn_memory_8 (pc, addr)); } inline void SETMEMDF(PCADDR pc, ADDR addr, DF value) { ! return this->write_insn_memory_8 (pc, addr, reinterpret_cast(value)); } // IMEM: instruction memory calls --- 172,194 ---- inline SF GETMEMSF(PCADDR pc, IADDR addr) { ! return static_cast(this->read_insn_memory_4 (pc, addr)); } inline void SETMEMSF(PCADDR pc, ADDR addr, SF value) { ! return this->write_insn_memory_4 (pc, addr, static_cast(value)); } inline DF GETMEMDF(PCADDR pc, IADDR addr) { ! return static_cast(this->read_insn_memory_8 (pc, addr)); } inline void SETMEMDF(PCADDR pc, ADDR addr, DF value) { ! return this->write_insn_memory_8 (pc, addr, static_cast(value)); } // IMEM: instruction memory calls