From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25116 invoked by alias); 15 Oct 2004 21:30:41 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 25095 invoked from network); 15 Oct 2004 21:30:40 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 15 Oct 2004 21:30:40 -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.10) with ESMTP id i9FLUeJG000328 for ; Fri, 15 Oct 2004 17:30:40 -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 i9FLUer25198 for ; Fri, 15 Oct 2004 17:30:40 -0400 Received: from coqui.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 i9FLUdir010834 for ; Fri, 15 Oct 2004 17:30:40 -0400 Received: by coqui.quesejoda.com (Postfix, from userid 500) id D1CD56E851A; Fri, 15 Oct 2004 17:30:39 -0400 (AST) Date: Fri, 15 Oct 2004 21:45:00 -0000 From: Aldy Hernandez To: gcc@gcc.gnu.org Subject: rfc: constant pool and floats Message-ID: <20041015213039.GA7011@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i X-SW-Source: 2004-10/txt/msg00631.txt.bz2 Hi folks. The following testcase is failing on powerpc-linux as well as the embedded variants. FAIL: tmpdir-gcc.dg-struct-layout-1/t001 c_compat_x_tst.o compile I have narrowed the problem down to: typedef float Tal1float __attribute__ ((aligned (2))); struct S38 { Tal1float a; }; struct S38 s38; void test38 (void) { s38.a = 91611.765625; } Where 2 would be an unaligned access to a float. store_bit_field() changes the floating constant to a const_int because of the unalignment: /* If VALUE is a floating-point mode, access it as an integer of the corresponding size. This can occur on a machine with 64 bit registers that uses SFmode for float. This can also occur for unaligned float structure fields. */ All this eventually creates a REG_EQUAL note with a const_int, instead of a const_double: (insn 11 10 0 (set (reg:SF 120) (mem/u/i:SF (lo_sum:SI (reg:SI 121) (symbol_ref/u:SI ("*.LC0") [flags 0x2])) [0 S4 A32])) -1 (nil) (expr_list:REG_EQUAL (const_int 1202908642 [0x47b2ede2]) (nil))) The constant pool will contain a value of (const_int 1202908642) with a mode of SF. This will cause output_constant_pool_2() to abort because we have a MODE_FLOAT, but an integer as a constant. Is the REG_EQUAL note correct being a const_int? If so, is the constant pool correct having SFmode, but a const_int? If so, then we need to change output_constant_pool_2() to allow const_int's for MODE_FLOATS. However...I'm not sure if this is all sane (rtl, and all). Thoughts? Aldy