From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6663 invoked by alias); 30 Jun 2005 17:29:04 -0000 Mailing-List: contact cgen-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cgen-owner@sources.redhat.com Received: (qmail 6366 invoked by uid 22791); 30 Jun 2005 17:28:50 -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 17:28:50 +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 j5UHSnSI000762 for ; Thu, 30 Jun 2005 13:28:49 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j5UHSnu13938; Thu, 30 Jun 2005 13:28:49 -0400 Received: from abulafia.quesejoda.com (sebastian-int.corp.redhat.com [172.16.52.221]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id j5UHSmAV012890; Thu, 30 Jun 2005 13:28:48 -0400 Received: by abulafia.quesejoda.com (Postfix, from userid 500) id 229F4841F; Thu, 30 Jun 2005 13:28:48 -0400 (AST) Date: Thu, 30 Jun 2005 17:29:00 -0000 From: Aldy Hernandez To: cgen@sources.redhat.com, fche@redhat.com Cc: jason@redhat.com, brolley@redhat.com Subject: sid doesn't build with gcc 4.0.x Message-ID: <20050630172848.GA4491@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-SW-Source: 2005-q2/txt/msg00066.txt.bz2 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