From patchwork Thu Sep 12 07:48:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jonas Pfeil X-Patchwork-Id: 1161420 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-508936-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=uni-ulm.de Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="VzlGyG0p"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46TW9J58mYz9s00 for ; Thu, 12 Sep 2019 17:48:34 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:references:in-reply-to:subject:date:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=rZK QVb14lSCGbFFT3bpiHSUW3fO0X7KGuoU0RHNtccOHYHJnh6h3GjlOHWE+lm+/wGp +1Q/ESRPDc7XU8hOEj0ejgnmUMwL+zmi2X5DBdEGmQ9QXx3nwzNjSVdeZFItAQ7j mGn9skKvPsOyJqHh9BnVBmSV/c+6IX91Te0mhvHo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:references:in-reply-to:subject:date:message-id:mime-version :content-type:content-transfer-encoding; s=default; bh=ql4LrYVN4 cs0CsSLiXXKhokc0TE=; b=VzlGyG0p2bykJFG9p7VoHm4Y9QPfm4cMAViyGmzwM LlKHuyvXYMwNX1YluL3Ry88+vMRyaRrWUbLfeaD4RDZCWM2z1sA0jFGryYLTTvCu pwBJcoIyXiR7/WRBEI761iBUq13YlIJaXwduI9i1E0MHuiemk5pu105zEksmpAG9 Lc= Received: (qmail 11832 invoked by alias); 12 Sep 2019 07:48:26 -0000 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 Received: (qmail 11807 invoked by uid 89); 12 Sep 2019 07:48:25 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=H*UA:Outlook, H*x:Outlook, H*UA:Microsoft, H*x:Microsoft X-HELO: mail.uni-ulm.de Received: from mail.uni-ulm.de (HELO mail.uni-ulm.de) (134.60.1.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 12 Sep 2019 07:48:22 +0000 Received: from ExpPhys5404 (scanex.physik.uni-ulm.de [134.60.60.25]) (authenticated bits=0) by mail.uni-ulm.de (8.15.2/8.15.2) with ESMTPSA id x8C7mILH004158 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Sep 2019 09:48:19 +0200 (CEST) From: "Jonas Pfeil" To: "'Jeff Law'" , References: <00a801d56893$f98bd630$eca38290$@uni-ulm.de> <6a184d1e-5cb6-ba98-57ab-e75f1cfc7bb6@redhat.com> In-Reply-To: <6a184d1e-5cb6-ba98-57ab-e75f1cfc7bb6@redhat.com> Subject: AW: Fix for type confusion bug on microblaze Date: Thu, 12 Sep 2019 09:48:44 +0200 Message-ID: <00be01d5693e$817cdb70$84769250$@uni-ulm.de> MIME-Version: 1.0 X-IsSubscribed: yes Yes, you are correct. Tested it and it works as intended. Thanks, Jonas -----Ursprüngliche Nachricht----- Von: Jeff Law Gesendet: Mittwoch, 11. September 2019 19:33 An: Jonas Pfeil ; gcc-patches@gcc.gnu.org Betreff: Re: Fix for type confusion bug on microblaze On 9/11/19 5:28 AM, Jonas Pfeil wrote: > The Microblaze target confuses unsigned long with HOST_WIDE_INT. > > This works fine for many architectures, but fails on ARM > (HOST_WIDE_INT is 8 bytes, unsigned long is 4 bytes). Leading to print > a uninitialized register instead of the desired number, fix by using the correct printf-specifier. > > Tested to fix the issue and work with an ARM->MB cross compiler. > > --- a/gcc/config/microblaze/microblaze.h > +++ b/gcc/config/microblaze/microblaze.h > @@ -695,7 +695,7 @@ do { > \ > fprintf (STREAM, "\t.align\t%d\n", (LOG)) > > #define ASM_OUTPUT_SKIP(STREAM,SIZE) \ > - fprintf (STREAM, "\t.space\t%lu\n", (SIZE)) > + fprintf (STREAM, "\t.space\t" HOST_WIDE_INT_PRINT_DEC "\n", (SIZE)) I believe that we should be using HOST_WIDE_INT_PRINT_UNSIGNED, not HOST_WIDE_INT_PRINT_DEC. Can you please verify that works for your cross builds? Thanks, jeff --- a/gcc/config/microblaze/microblaze.h +++ b/gcc/config/microblaze/microblaze.h @@ -695,7 +695,7 @@ do { \ fprintf (STREAM, "\t.align\t%d\n", (LOG)) #define ASM_OUTPUT_SKIP(STREAM,SIZE) \ - fprintf (STREAM, "\t.space\t%lu\n", (SIZE)) + fprintf (STREAM, "\t.space\t" HOST_WIDE_INT_PRINT_UNSIGNED "\n", (SIZE)) #define ASCII_DATA_ASM_OP "\t.ascii\t" #define STRING_ASM_OP "\t.asciz\t"