From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (wildebeest.demon.nl [212.238.236.112]) by sourceware.org (Postfix) with ESMTPS id 5916B398080D for ; Wed, 2 Jun 2021 21:14:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5916B398080D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org Received: from reform (deer0x0c.wildebeest.org [172.31.17.142]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 12F603000731; Wed, 2 Jun 2021 23:14:25 +0200 (CEST) Received: by reform (Postfix, from userid 1000) id 6F4152E808FD; Wed, 2 Jun 2021 23:14:25 +0200 (CEST) Date: Wed, 2 Jun 2021 23:14:25 +0200 From: Mark Wielaard To: Philip Herron Cc: gcc-rust@gcc.gnu.org Subject: Re: debian-i386 target (Was: ppc64le added to buildbot) Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-rust@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: gcc-rust mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 21:14:30 -0000 Hi Philip, On Wed, Jun 02, 2021 at 11:22:43AM +0100, Philip Herron wrote: > > Analyzing compilation unit > > /home/mark/gccrs/gcc/testsuite/rust.test/compile/methods1.rs: In function > > ‘Rectangle_sum_x’: > > /home/mark/gccrs/gcc/testsuite/rust.test/compile/methods1.rs:26:5: error: > > type mismatch in binary expression > > 26 | fn sum_x(self) -> f64 { > > | ^ > > f64 > > > > > > > > > > > > D.227 = _2 + _4; > > /home/mark/gccrs/gcc/testsuite/rust.test/compile/methods1.rs:26:5: > > internal compiler error: ‘verify_gimple’ failed > > 0x8b114e4 verify_gimple_in_seq(gimple*) > > ../../gccrs/gcc/tree-cfg.c:5157 > > 0x881a9e3 gimplify_body(tree_node*, bool) > > ../../gccrs/gcc/gimplify.c:15401 > > 0x881abb2 gimplify_function_tree(tree_node*) > > ../../gccrs/gcc/gimplify.c:15472 > > 0x8675c88 cgraph_node::analyze() > > ../../gccrs/gcc/cgraphunit.c:670 > > 0x8678a58 analyze_functions > > ../../gccrs/gcc/cgraphunit.c:1236 > > 0x8679641 symbol_table::finalize_compilation_unit() > > ../../gccrs/gcc/cgraphunit.c:2514 > > This is a good find I will open an issue to track this, I have a local > Debian 32 bit machine at home so I can try this on later in the week. Off > the top of my head I am wondering if there is something wrong with how we > are building up the integer tree nodes. The relevant code starts in > gcc/rust/backend/rust-compile-tyty.h inside ``` void visit (TyTy::IntType > &type) override```. > > Let me know if you get anywhere with this before Friday since I will should > be able to look into this issue then. I looked a bit but am still struggling with how to debug the gimple generation. The following is a simpler variant that shows the issue: fn sum(x: f64, y: f64) -> f64 { x + y } fn main() { let _sum = sum(3.0, 4.0); } Interestingly the following, using an mutable temporary variable to hold the result does pass: fn sum(x: f64, y: f64) -> f64 { let mut z:f64 = x; z += y; z } fn main() { let _sum = sum(3.0, 4.0); } As far as I can tell the second variant still uses float:80 for the temporaries, but because z is f64 it gets cast to (f64) when returning, making the gimple check pass. So I assumed it was because the arguments got the wrong type somehow. But the following also doesn't pass: fn sum(x: f64, y: f64) -> f64 { let a:f64 = x; let b:f64 = y; a + b } fn main() { let _sum = sum(3.0, 4.0); } So it is as if the plus expression gets its variable types wrong. I don't know where that is generated though, or why it is using float:80. Cheers, Mark