From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id B622B385840B for ; Mon, 31 Jan 2022 10:01:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B622B385840B Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-388-TObwBDHMNNCxU_sTda--GA-1; Mon, 31 Jan 2022 05:01:26 -0500 X-MC-Unique: TObwBDHMNNCxU_sTda--GA-1 Received: by mail-wr1-f72.google.com with SMTP id i25-20020adfaad9000000b001e01f5804abso1962374wrc.2 for ; Mon, 31 Jan 2022 02:01:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent :content-language:to:references:from:subject:in-reply-to :content-transfer-encoding; bh=beMyzSBdhPpdGlxTEGETotD9uDkYyUoUa2fpi5CICB0=; b=ORGVX8gCHe0/YhFNJcregmt2sHuLIrQ5/EPJBlf2URM+bvRuG57Z0IZN4+fQomoSWT 1+ICi6qdDMxxQC9SpEsWMuoxVUrag2L1QyYua+5+/LdgXPml6lpHPsbU/SEVaf9efz4A dV6v4hSivE48Av2uZnlh84VBLq2vxl5ULWcbjTk/ZPTNe0DEiADeEGhmnUrzd/t0+Scw Trm1ZRYhqZTxyVi2jbIc7wBkrZWO/RrgFhmM3QtnkBWe3CEqJICwAYDR9in8PthQoq3S M88dBn2rCejfducX8maSzsVmV8jOcqyy98BV3IVZjSHZoQr61PdclcMQoY5qGo1brgBR IGVw== X-Gm-Message-State: AOAM531q5pUcqpEK+PifkC6SAIwnG6vc2RV2rQNkB0H3sUa5gol+zcx3 quzFB46FW0y3GJXbvkfGKPhlgIv9+SSJFQC/BXML9FJPBOy6AqCZP+O88tAK79WaBe7xJj48Y+1 BcrzurVGaIUKLowODZsBLpPQ2PwbFFFEidcli9Diy7TMY/AfS7L9xmkPajD0= X-Received: by 2002:a05:600c:6010:: with SMTP id az16mr25697339wmb.137.1643623285361; Mon, 31 Jan 2022 02:01:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJxZZ2644HglH9KtBA7Jl1C+ye5RAS5M5CqLespWirgoq61Kg0Cwye3SFN+5nkeIDsvpMWQHdg== X-Received: by 2002:a05:600c:6010:: with SMTP id az16mr25697320wmb.137.1643623285117; Mon, 31 Jan 2022 02:01:25 -0800 (PST) Received: from [10.0.0.8] (cpc108959-cmbg20-2-0-cust731.5-4.cable.virginm.net. [80.0.22.220]) by smtp.gmail.com with ESMTPSA id l6sm12055774wrs.51.2022.01.31.02.01.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 31 Jan 2022 02:01:24 -0800 (PST) Message-ID: <91c5df95-d2be-11f9-68c9-2f376f7a5f3c@redhat.com> Date: Mon, 31 Jan 2022 10:01:24 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 To: gcc-help@gcc.gnu.org References: From: Andrew Haley Subject: Re: Eax zeroed before call In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Jan 2022 10:01:31 -0000 On 1/31/22 08:42, Peter McKinna via Gcc-help wrote: > Hopefully this is the correct forum. I have a > Pascal like language using gcc as the backend. > For some reason a call to a simple procedure > with no parameters generates code to initialises eax to zero before the > call. With any parameters in the proc there’s no init. > > Is there some way to prevent this init? Some > flag I can set, some arcane piece of wizardry? If your simple procedure doesn't have a prototype, EAX is initialized to the number of arguments passed in vector registers, for compatibility with old varargs functions. I suggest you provide a prototype. -- Andrew Haley (he/him) Java Platform Lead Engineer Red Hat UK Ltd. https://keybase.io/andrewhaley EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671