From MAILER-DAEMON Thu Aug 01 02:01:45 2019 Received: from list by lists.gnu.org with archive (Exim 4.86_2) id 1ht49p-0005b8-Tk for mharc-tinycc-devel@gnu.org; Thu, 01 Aug 2019 02:01:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52162) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1ht49m-0005as-RD for tinycc-devel@nongnu.org; Thu, 01 Aug 2019 02:01:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ht49l-00013S-70 for tinycc-devel@nongnu.org; Thu, 01 Aug 2019 02:01:42 -0400 Received: from smtp08.smtpout.orange.fr ([80.12.242.130]:40024 helo=smtp.smtpout.orange.fr) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ht49k-00011k-Hl for tinycc-devel@nongnu.org; Thu, 01 Aug 2019 02:01:41 -0400 Received: from wwinf1v18 ([10.223.71.62]) by mwinf5d31 with ME id ji1Y2000D1LdVK603i1Zls; Thu, 01 Aug 2019 08:01:35 +0200 X-ME-Helo: wwinf1v18 X-ME-Auth: ZWxpZ2lzQG9yYW5nZS5mcg== X-ME-Date: Thu, 01 Aug 2019 08:01:35 +0200 X-ME-IP: 92.184.116.23 Date: Thu, 1 Aug 2019 08:01:32 +0200 (CEST) From: Christian JULLIEN Reply-To: Christian JULLIEN To: avih , "tinycc-devel@nongnu.org" , Michael Matz Message-ID: <694784340.782.1564639292193.JavaMail.www@wwinf1v18> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_781_576298330.1564639292189" X-Country-Code: X-me-spamlevel: not-spam X-Cache-ID: Message-Context: email-message X-WUM-SignatureAdded: X-Message-Size: X-SAVECOPY: true X-National-Code: X-Cache-Entry: X-Wum-ChannelType: X-Originating-IP: 92.184.116.23 X-Wum-Nature: EMAIL-NATURE X-WUM-FROM: |~| X-WUM-TO: |~||~||~| X-WUM-REPLYTO: |~| X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.12.242.130 Subject: Re: [Tinycc-devel] [PATCH] win32: add include/getopt.h with static implementation X-BeenThere: tinycc-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Aug 2019 06:01:44 -0000 ------=_Part_781_576298330.1564639292189 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable You're right! After defining what tcc is, it will be easier to decide how i= t evolves.Let me start a definition: Tcc is a C compiler implementing a large subset of C90.It add some gcc and = VisualC extensions to ease port from those compilersIt supports different 3= 2 and 64bit processor architectures (mainly x86, x86_64, ARM, Aarch64) It currently supports mainstream Linux distributions and most recent versio= n of Windows.On Linux, it uses system includes and libraries that generally= come pre-installed. The windows port comes with its own ssubset of include= s and libraries to provide a standalone C compiler. A more complete Windows= subset is provided by external package shared with migw64. So, I think we can add without problems:- C90 missing features- gcc or Visu= alC extensions- more? processor backend- fixes to support more Linux distri= bs-  Le : 31 juillet 2019 =C3=A0 20:58 (GMT +02:00) De : "avih" <avihpit@yahoo.com> =C3=80 : "tinycc-devel@nongnu.org" <tinycc-devel@nongnu.org>, "M= ichael Matz" <matz.tcc@frakked.de>, "Christian JULLIEN" <eligis@or= ange.fr> Objet : Re: RE : Re: [Tinycc-devel] [PATCH] win32: add include/getopt.= h with static implementation > On Wednesday, July 31, 2019, 8:55:18 PM GMT+3, Christi= an JULLIEN <eligis@orange.fr> wrote: >=20 > This my THIRD attempt to reply to this thread since Jul, 26. The > two prev. attempts never reached the list. Hope this one will work > and go to the list! It did, at least to me (but I was addressed). FWIW, I don't recall seeing prior replies from you, though I also don't see my reply from today at: https://lists.nongnu.org/archive/html/tinycc-devel/2019-07/index.html But the fact that you got it probably means it got through. Not sure what's up with the list manager... > As I said previously (basically the same as Michael): ... > As I'm aware of, the win32 port is not targeted to support POSIX > applications. While getopt is great, it introduces a third category > and the gap from POSIX is huge. For example, among others, I would > love to have mmap. Indeed. Though when I now think about it again, I'd say the definition of tcc on Windows would be "like MinGW, but smaller, and extensible to some extent with additional MinGW headers". FWIW, MinGW does include getopt.h at its root include dir (I assume implemented at glibc). > That said, if the group decides that's a good idea, I will not protest > but, in this case put getopt.h in a new directory like include/posix > to make it clear. Hmm... and make it a default include path? otherwise `#include <getopt.h>` would not work out of the box, which kind of defeats its purpose and usefullness IMO. But anyway, indeed the main question to answer first and foremost is what's the desirable scope of tcc on windows, and once it's answered clearly, then hopefully the rest would be easy to derive. Avi ------=_Part_781_576298330.1564639292189 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable You're right! After defining what tcc is, it will be easier to decide how i= t evolves.
Let me start a definition:

Tcc is a= C compiler implementing a large subset of C90.
It add some gcc a= nd VisualC extensions to ease port from those compilers
It suppor= ts different 32 and 64bit processor architectures (mainly x86, x86_64, ARM,= Aarch64)
It currently supports mainstream Linux distributions and most = recent version of Windows.
On Linux, it uses system includes and = libraries that generally come pre-installed. The windows port comes with it= s own ssubset of includes and libraries to provide a standalone C compiler.= A more complete Windows subset is provided by external package shared with= migw64.

So, I think we can add without problems:<= /div>
- C90 missing features
- gcc or VisualC extensions
- more? processor backend
- fixes to support more Linux dis= tribs



Le : 31 juillet 2= 019 =C3=A0 20:58 (GMT +02:00)
De : "avih"<= /span> <avihpit@yahoo.com>
=C3=80 :&nb= sp;"tinycc-devel@nongnu.org" <tinycc-dev= el@nongnu.org>, "Michael Matz" <matz.tcc@frakked.de>, "Christian JULLIEN" <= span dir=3D"lrt"><eligis@orange.fr>

Objet : = Re: RE : Re: [Tinycc-devel] [PATCH] win32: add include/getopt.h with static implementation


> On Wednesd= ay, July 31, 2019, 8:55:18 PM GMT+3, Christian JULLIEN <eligis@orange.fr= > wrote:
>
> This my THIRD attempt to reply to this thread = since Jul, 26. The
> two prev. attempts never reached the list. Hope = this one will work
> and go to the list!

It did, at least to m= e (but I was addressed). FWIW, I don't recall seeing
prior replies from = you, though I also don't see my reply from today at:
https://lists.nongn= u.org/archive/html/tinycc-devel/2019-07/index.html
But the fact that you= got it probably means it got through. Not sure
what's up with the list = manager...

> As I said previously (basically the same as Michael)= : ...

> As I'm aware of, the win32 port is not targeted to suppor= t POSIX
> applications. While getopt is great, it introduces a third = category
> and the gap from POSIX is huge. For example, among others,= I would
> love to have mmap.

Indeed. Though when I now think = about it again, I'd say the definition
of tcc on Windows would be "like = MinGW, but smaller, and extensible to
some extent with additional MinGW = headers".

FWIW, MinGW does include getopt.h at its root include dir = (I assume
implemented at glibc).

> That said, if the group dec= ides that's a good idea, I will not protest
> but, in this case put g= etopt.h in a new directory like include/posix
> to make it clear.
=
Hmm... and make it a default include path? otherwise
`#include <g= etopt.h>` would not work out of the box, which kind of
defeats its pu= rpose and usefullness IMO.

But anyway, indeed the main question to a= nswer first and foremost is
what's the desirable scope of tcc on windows= , and once it's answered
clearly, then hopefully the rest would be easy = to derive.

Avi
------=_Part_781_576298330.1564639292189-- From MAILER-DAEMON Fri Aug 02 14:50:00 2019 Received: from list by lists.gnu.org with archive (Exim 4.86_2) id 1htccq-0003FP-RQ for mharc-tinycc-devel@gnu.org; Fri, 02 Aug 2019 14:50:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39430) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1htccl-0003BX-Pp for tinycc-devel@nongnu.org; Fri, 02 Aug 2019 14:49:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1htccj-00074z-Qq for tinycc-devel@nongnu.org; Fri, 02 Aug 2019 14:49:55 -0400 Received: from mail-eopbgr10130.outbound.protection.outlook.com ([40.107.1.130]:18822 helo=EUR02-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1htcch-00071o-VY for tinycc-devel@nongnu.org; Fri, 02 Aug 2019 14:49:53 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G69Sgm/mQxelV/Hn/ACAxM8aDRPaaNo5geWIOP2tp2xaogj9zGjhdYAMwnuHGrzE5K5mQA02hatbnERwhpPyQf9t5bGrbNKp0MICQRU6xIa92BZtejE+xWucyAf9g/RUbUH2Wds8D2GAa8KRmwfWMtH6XvKhp9RUCiC7qhCriU2+kVWLwzAf4Ztxfwk28ZYFkmdrWmC/wKlJmgdk9DnFDx0KHewcLXw8GXZIvv2A4b+eeoh1+1eFtjnmEILg7xgGMyaxrO7quyV7c+PYHOl9E6/v4cjSDpvTw4rx6D2NcVSpmkiRHjrjW4nKXE0xVs5McyenWnCWGKcSSCYGXUaznw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=18jIgR/vyVjMsed0Bn9073x8k0CpNLsSBbbWxSCHl+E=; b=OKWEyDqg8KvD2ua3H/qaFb5fdza71RldwE15OtZ03XwqPYJ5ovKYYfT8Znx5h3TXtkt0pjaxG6efsgo7tXAUahVDu4+kcvQ9uBg0WjUrasbyIAVSSZfdC+6xaTdjjviJww5K2guuVNlsbiSIz1graeksnmQ8ELQq0XrbcgDInM2dF4DDy/y39nnvkIrs0h+xdXgda1ppYeSdpubt1WxxrCnurQWriC6Cub73W/kpleUe2px1J/a2AVeFUxVPfO1bzLIaYVGy9UYXkeMDl4AxgfEh79IeTyLfZkAXQDhLKEZPa2vQ525JyT/krbQGvVfyPsUX8aTriHAE+Z7yl0ObIA== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=pass (sender ip is 192.38.125.76) smtp.rcpttodomain=nongnu.org smtp.mailfrom=di.ku.dk;dmarc=bestguesspass action=none header.from=di.ku.dk;dkim=none (message not signed);arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alumni.onmicrosoft.com; s=selector2-alumni-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=18jIgR/vyVjMsed0Bn9073x8k0CpNLsSBbbWxSCHl+E=; b=ZyaI3APiIli5UCaRLUEv6RfeRwRMlGCpnOpogZUufRppLP5wofuHWButVkSF6hE+ja1qOTCqprwBOokfVg9AGHMMcnD9hI90bpl/UsZPY1PsQnnbElJnf5TWnVT6oRGiLl63ss6mz+bCCvrfc5E6oizWeJFv4hEwZ/yekpZ1c7I= Received: from AM5PR04CA0026.eurprd04.prod.outlook.com (2603:10a6:206:1::39) by VI1PR04MB4174.eurprd04.prod.outlook.com (2603:10a6:803:3d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2136.16; Fri, 2 Aug 2019 18:49:44 +0000 Received: from HE1EUR02FT028.eop-EUR02.prod.protection.outlook.com (2a01:111:f400:7e05::208) by AM5PR04CA0026.outlook.office365.com (2603:10a6:206:1::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2136.16 via Frontend Transport; Fri, 2 Aug 2019 18:49:44 +0000 Authentication-Results: spf=pass (sender IP is 192.38.125.76) smtp.mailfrom=di.ku.dk; nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=bestguesspass action=none header.from=di.ku.dk; Received-SPF: Pass (protection.outlook.com: domain of di.ku.dk designates 192.38.125.76 as permitted sender) receiver=protection.outlook.com; client-ip=192.38.125.76; helo=sepo4.ku.dk; Received: from sepo4.ku.dk (192.38.125.76) by HE1EUR02FT028.mail.protection.outlook.com (10.152.10.102) with Microsoft SMTP Server id 15.20.2136.14 via Frontend Transport; Fri, 2 Aug 2019 18:49:43 +0000 Received: from 10.78.0.165 ([10.78.0.165]) by sepo4.ku.dk (JAMES SMTP Server 2.3.2-1) with SMTP ID 547 for ; Fri, 2 Aug 2019 20:49:43 +0200 (CEST) Received: from P1KITMBX03WC02.unicph.domain ([fe80::4e4:28c5:cdcb:3fb2]) by P2KITHUB08W.unicph.domain ([::1]) with mapi id 14.03.0468.000; Fri, 2 Aug 2019 20:49:42 +0200 From: Klaus Ebbe Grue To: "tinycc-devel@nongnu.org" Thread-Topic: Duplicate double Thread-Index: AdVJXiEqHF+vTvVOR4WNfZ4eTOWQSA== Date: Fri, 2 Aug 2019 18:49:41 +0000 Message-ID: Accept-Language: da-DK, en-US Content-Language: da-DK X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.77.128.237] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.38.125.76; IPV:NLI; CTRY:DK; EFV:NLI; SFV:NSPM; SFS:(10019020)(4636009)(346002)(39860400002)(376002)(136003)(396003)(2980300002)(189003)(199004)(2351001)(53936002)(336012)(40036005)(86362001)(5640700003)(9686003)(55016002)(7116003)(7696005)(2906002)(221733001)(55846006)(102836004)(46406003)(26005)(97756001)(6916009)(3846002)(23726003)(6116002)(70586007)(6306002)(47776003)(2501003)(81166006)(33656002)(5660300002)(68736007)(186003)(81156014)(50466002)(70206006)(126002)(786003)(7736002)(316002)(486006)(478600001)(106002)(8676002)(69596002)(8746002)(356004)(3480700005)(966005)(476003)(305945005)(8936002)(37786003)(19623455009); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR04MB4174; H:sepo4.ku.dk; FPR:; SPF:Pass; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1f8a5cf6-be81-46f4-990c-08d7177a2efd X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(4709080)(1401327)(2017052603328)(7193020); SRVR:VI1PR04MB4174; X-MS-TrafficTypeDiagnostic: VI1PR04MB4174: X-MS-Exchange-PUrlCount: 1 X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-Forefront-PRVS: 011787B9DD X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: QhHHqjgS3pKctGYcehJWA7Fd4DJIPIhgeao/W6ld2j6MNGk70qCojf6zh5hyE1iojEXfcjTHw316AScFCAO5m/QX88e5olsjw70RWvi8oY3W1A/zVlrusxWTPpd+TbAg1L8g5LxBu4NzFd1pGYMWlT4CPlwlM+xZJOiXfG5IgiG830jleYN7uqJxBK2+Bp4+9jMXf2YrV1GZHOJA3hCFGaUbRNF2dP75Hcx1WKx2rChiRCnfsbux91BlV2Ejl7vI6YnOp1BY9Qv6bcpM+22x/u3gvhWcAssAsjYJUDXV1c433oXC0gwuveS9QjARokUodVE4sGTr6XfgYRlvxyrVJxbyTp+DQbhk68Wb7B1Gz4kT4F30xYvlOhN8KQ9PihaJ9jMH8pDC3B3Qxku1d+uCj1DeQaSBbwzRWszSM9C1fAM= X-OriginatorOrg: di.ku.dk X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2019 18:49:43.7054 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1f8a5cf6-be81-46f4-990c-08d7177a2efd X-MS-Exchange-CrossTenant-Id: a3927f91-cda1-4696-af89-8c9f1ceffa91 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=a3927f91-cda1-4696-af89-8c9f1ceffa91; Ip=[192.38.125.76]; Helo=[sepo4.ku.dk] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4174 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.1.130 Subject: [Tinycc-devel] Duplicate double X-BeenThere: tinycc-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Aug 2019 18:49:57 -0000 Hi tinycc-devel, Under MSYS2/MinGW I have a problem with tcc. I define this functions: void f(double x,double y,double z){printf("f(%4.1f,%4.1f,%4.1f)\n",x,y,z);} As an example, f(1,2,3) prints f( 1.0, 2.0, 3.0). Then I call f from main in a slightly confusing way: int main(int argc,char **argv){double u=3D0.0;f(u*1.0,7.0,8.0);return 0;} I would expect to get f( 0.0, 7.0, 8.0) but I do get f( 7.0, 7.0, 8.0). The first argument of f becomes a duplicate of the second argument of f. If I remove "*1.0" then everything works as expected. Is this a known bug? By the way, if I make the same program using integers, then there is no pro= blem. I have included a reproduction scenario below. Cheers, Klaus --- Install MSYS2/MinGW Start MSYS2 shell > mkdir experiment > cd experiment > wget http://download.savannah.gnu.org/releases/tinycc/tcc-0.9.27-win64-bi= n.zip > pacman -S unzip > unzip tcc-0.9.27-win64-bin.zip > tcc/tcc -v tcc version 0.9.27 (x86_64 Windows) > cat>test.c #include void f(double x,double y,double z){printf("f(%4.1f,%4.1f,%4.1f)\n",x,y,z);} int main(int argc,char **argv){double u=3D0.0;f(u*1.0,7.0,8.0);return 0;} > tcc/tcc -o test test.c > ./test f( 7.0, 7.0, 8.0)= From MAILER-DAEMON Sat Aug 03 01:24:31 2019 Received: from list by lists.gnu.org with archive (Exim 4.86_2) id 1htmWt-0005Zp-E0 for mharc-tinycc-devel@gnu.org; Sat, 03 Aug 2019 01:24:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42744) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1htmWr-0005Z9-0y for tinycc-devel@nongnu.org; Sat, 03 Aug 2019 01:24:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1htmWp-0001AK-Cc for tinycc-devel@nongnu.org; Sat, 03 Aug 2019 01:24:28 -0400 Received: from smtp04.smtpout.orange.fr ([80.12.242.126]:27633 helo=smtp.smtpout.orange.fr) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1htmWp-00019T-0R for tinycc-devel@nongnu.org; Sat, 03 Aug 2019 01:24:27 -0400 Received: from wwinf1z13 ([10.223.68.57]) by mwinf5d80 with ME id kVQP2000H1E8D0y03VQPum; Sat, 03 Aug 2019 07:24:23 +0200 X-ME-Helo: wwinf1z13 X-ME-Auth: ZWxpZ2lzQG9yYW5nZS5mcg== X-ME-Date: Sat, 03 Aug 2019 07:24:23 +0200 X-ME-IP: 80.12.34.66 Date: Sat, 3 Aug 2019 07:24:23 +0200 (CEST) From: Christian JULLIEN Reply-To: Christian JULLIEN To: "tinycc-devel@nongnu.org" Message-ID: <1162133812.106.1564809863743.JavaMail.www@wwinf1z13> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_105_2025018324.1564809863739" X-Country-Code: X-me-spamlevel: not-spam X-Cache-ID: Message-Context: email-message X-Message-Size: X-WUM-SignatureAdded: X-SAVECOPY: true X-National-Code: X-Cache-Entry: X-Wum-ChannelType: X-Originating-IP: 80.12.34.66 X-Wum-Nature: EMAIL-NATURE X-WUM-FROM: |~| X-WUM-TO: |~| X-WUM-REPLYTO: |~| X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.12.242.126 Subject: Re: [Tinycc-devel] Duplicate double X-BeenThere: tinycc-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Aug 2019 05:24:30 -0000 ------=_Part_105_2025018324.1564809863739 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 16.0px Menlo; color: #000000; = background-color: #ffffff} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 16.0px Menlo; color: #000000; = background-color: #ffffff; min-height: 19.0px} span.s1 {font-variant-ligatures: no-common-ligatures} I tried to compile your sample to give more feedbacks to maintainers: #include <stdio.h> void f(double x,double y,double z){printf("f(%4.1f,%4.1f,%4.1f)\n",x,y,z);} int main(int argc,char **argv){double u=3D0.0;f(u*1.0,7.0,8.0);return 0;} On Linux x86_64, Linux Aarch64, Windows 32 and 64. They all with give the r= ight expected result. Is it the mod version? How do you compile tcc with MinGW? Looks this bug is= more related to MinGW and its libs (or the calling protocol used by them).= FYI, the tcc version I use on Windows is tcc compiled by tcc boostrapped b= y Cygwin gcc. This one works like a charm. Le : 02 ao=C3=BBt 2019 =C3=A0 20:50 (GMT +02:00) De : "Klaus Ebbe Grue" <grue@di.ku.dk> =C3=80 : "tinycc-devel@nongnu.org" <tinycc-devel@nongnu.org> Objet : [Tinycc-devel] Duplicate double Hi tinycc-devel, Under MSYS2/MinGW I have a problem with tcc. I define this functions: void f(double x,double y,double z){printf("f(%4.1f,%4.1f,%4.1f)\n",x,y,z);} As an example, f(1,2,3) prints f( 1.0, 2.0, 3.0). Then I call f from main in a slightly confusing way: int main(int argc,char **argv){double u=3D0.0;f(u*1.0,7.0,8.0);return 0;} I would expect to get f( 0.0, 7.0, 8.0) but I do get f( 7.0, 7.0, 8.0). The first argument of f becomes a duplicate of the second argument of f. If I remove "*1.0" then everything works as expected. Is this a known bug? By the way, if I make the same program using integers, then there is no pro= blem. I have included a reproduction scenario below. Cheers, Klaus --- Install MSYS2/MinGW Start MSYS2 shell > mkdir experiment > cd experiment > wget http://download.savannah.gnu.org/releases/tinycc/tcc-0.9.27-win64= -bin.zip > pacman -S unzip > unzip tcc-0.9.27-win64-bin.zip > tcc/tcc -v tcc version 0.9.27 (x86_64 Windows) > cat>test.c #include <stdio.h> void f(double x,double y,double z){printf("f(%4.1f,%4.1f,%4.1f)\n",x,y,z);} int main(int argc,char **argv){double u=3D0.0;f(u*1.0,7.0,8.0);return 0;} > tcc/tcc -o test test.c > ./test f( 7.0, 7.0, 8.0) _______________________________________________ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel ------=_Part_105_2025018324.1564809863739 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

I tried to compile your sample to give m= ore feedbacks to maintainers:

=

#include <stdio.h><= /span>


void f(double x,double y,double z){print= f("f(%4.1f,%4.1f,%4.1f)\n",x,y,z);}


int main(int argc,char **argv){double u= =3D0.0;f(u*1.0,7.0,8.0);return 0;}


On Linux x86_64, Lin= ux Aarch64, Windows 32 and 64. They all with give the right expected result= .


Is it the mod version? How do you compile tcc with Mi= nGW? Looks this bug is more related to MinGW and its libs (or the calling p= rotocol used by them). FYI, the tcc version I use on Windows is tcc compile= d by tcc boostrapped by Cygwin gcc. This one works like a charm.

=



Le : 02 ao=C3=BBt 2019 =C3=A0 20:50 (GMT +02:00)
De= : "Klaus Ebbe Grue" &l= t;grue@di.ku.dk>
=C3=80 : "tinycc-devel@nongnu.= org" <tinycc-devel@nongnu.org>=
Objet : [Tinycc-devel] Duplicate double


Hi tinyc= c-devel,

Under MSYS2/MinGW I have a problem with tcc.

I defin= e this functions:

void f(double x,double y,double z){printf("f(%4.1f= ,%4.1f,%4.1f)\n",x,y,z);}

As an example, f(1,2,3) prints f( 1.0, 2.0= , 3.0).

Then I call f from main in a slightly confusing way:

= int main(int argc,char **argv){double u=3D0.0;f(u*1.0,7.0,8.0);return 0;}
I would expect to get f( 0.0, 7.0, 8.0) but I do get f( 7.0, 7.0, 8.0= ).

The first argument of f becomes a duplicate of the second argumen= t of f.

If I remove "*1.0" then everything works as expected.
Is this a known bug?

By the way, if I make the same program using i= ntegers, then there is no problem.

I have included a reproduction sc= enario below.

Cheers,
Klaus

---

Install MSYS2/MinGW=
Start MSYS2 shell

> mkdir experiment
> cd experiment> wget http://download.savannah.gnu.org/releases/tinycc/tcc-0.9.27-win6= 4-bin.zip
> pacman -S unzip
> unzip tcc-0.9.27-win64-bin.zip> tcc/tcc -v
tcc version 0.9.27 (x86_64 Windows)
> cat>test= .c
#include <stdio.h>
void f(double x,double y,double z){printf= ("f(%4.1f,%4.1f,%4.1f)\n",x,y,z);}
int main(int argc,char **argv){double= u=3D0.0;f(u*1.0,7.0,8.0);return 0;}
> tcc/tcc -o test test.c
>= ./test
f( 7.0, 7.0, 8.0)
___________________________________________= ____
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lis= ts.nongnu.org/mailman/listinfo/tinycc-devel
------=_Part_105_2025018324.1564809863739-- From MAILER-DAEMON Sat Aug 03 04:31:53 2019 Received: from list by lists.gnu.org with archive (Exim 4.86_2) id 1htpSD-0002cE-Hs for mharc-tinycc-devel@gnu.org; Sat, 03 Aug 2019 04:31:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42390) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1htpSA-0002b3-Tb for tinycc-devel@nongnu.org; Sat, 03 Aug 2019 04:31:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1htpS9-0001mO-FE for tinycc-devel@nongnu.org; Sat, 03 Aug 2019 04:31:50 -0400 Received: from sonic309-13.consmr.mail.bf2.yahoo.com ([74.6.129.123]:39226) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1htpS8-0001lz-Go for tinycc-devel@nongnu.org; Sat, 03 Aug 2019 04:31:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1564821107; bh=WTxJY9cvfrEgMsqOel0pGq09WcPaKLRnmD+olY83DFA=; h=Date:From:To:In-Reply-To:References:Subject:From:Subject; b=dXkmdJPCOV8WO8RnQwecxm3pTlI/q7S6bYiX/FJVKWg9EjupDpoDvqEgQu2Vo5QoHsjrAgTHQR0Aj7XzszHStlK3YZk6R6fxDbJD4YbZbFuc2QGMfh+6cpw0Mtf31kAFfZewR9U6B8n0pwlVZ7QtpGXXfvIbruqlQjDjrvWn6zavm+8r0CpU2Qod5RDsqZWjkIRrKo4pefnw9KFdgw3hKj9IDnLrCMgPDTBBxnwFl6rFODsx9RIxSIxnYtWqssrTs/aNPGfhY8IeBBH204puTBiVFIQVJTSsUu+WcEmW0uyGJP0JGjy7OJyIjrGzwo3YnX52YznoALfIfKLhFWGoCA== X-YMail-OSG: z4tToh8VM1kLAuk1_Nn7B8vvyNVr8uJkAWFct5J9UiMPQb69q.ac0Vh9LSNIYj5 GNqfKYZvbhD9EncHP3RRDAAoo.j3ODEw9AMmB6qM6VwiXj3rHPJV0XZn7WaeqsLCXnWh_ClHKD9P 2QiZWNFdGJul69.kR9ASjD0ShwP_.jjvuWgMs3XRcruktwkABl_bjo6118KgdI.O7LYct0GbCMuS buP0vCb4f6PtYq9l8GoOY0dycf6aWIkR779HkdByPuDoV1HTTaOu2Ito5WAytwX05mg_qaTjeEg5 .nSBDhtfU5CbkokkaKJuzsT1513Ams4Folf5D7QW88AlTYpFkqioo7M.slCyOkbQ7xyekngCn07o k5kJyVkXgrg_dpYGcHKlL2Jt.tfD1QoCq4LYLD5v4ZbC8lbgJi3DtH2kH96rTicx.SFvef0P22BB f48iJ4KtO7y6Ivtf2Py1WyTu0IHhfTHNSQ6x0WCFRaSTksmcWd33hL1J0YVbmawKGSuF7pyOPxbO AX7zs7puxcN6IlJSIB0ZE1kC7fto29tgc9vcB1RLYPR9wBRwTRwUFFVk_E8n.hiW49abJi9qHfIB 3NnfUQ7XRdk3kn1c0dyHJQHPQP3wkXKwF_kVVlTEBK9pUid0ekVqSCX4LfnuVCneJOZXJF4jTOah k4EkW2tHDjl159Kbh3CA2L1YJ6A6vqOW7xdLSP1qY_6f1QCmLx56KeooAegyQwAROcRL9JMXKOpB OJtCvcxLQM0rNyjVRUc5gggngk_tkkPbkoMpv2scalEVPI47crQ1EOS4FHvmMEbu1clOX.SYbcuh r24LbY9_aywqWYlie728Nvv5lfWBRWyhvbNa9ODvrlTDGzPvcu.LvJOKyKLapV1b05rIn0ETNil8 ss8wkzEViD7JM0ieCRuOzJL.sOQe0ZVRxFwj3Wk.DKgcGMpxhJUJM_0s9Fxbc2gMqMyatqxiZywg g8lGCuzTVrTtmt8UwxBQTWegJXAUShKYKrClye60nrSNyFPo.Xj9Pd.0XvaxaUrxztDAh_98wMpN EGNJwZTUeAHKMnB4OD3Ifj.fE_ru3U_zZRtn.xokHWSKTDhMEVGfwbrDet_9PswVvBVofzJYoNPp 6f91jQuDFKIrDf1gfK5vVSM4DmbJiGeAep45.XHKkmM9WoAz8va3al4NAyiCRqKDDDS_gZQx3KgL Y2KmEIzlwY_vMGm30YVMR47q5qTx7BBvfaVpV0l8pCZEbdv0ixr92Qmq5OGpj6pC04_G4CppIaCW 8HJEqCQrmvFiqyJcahCGPIHiX Received: from sonic.gate.mail.ne1.yahoo.com by sonic309.consmr.mail.bf2.yahoo.com with HTTP; Sat, 3 Aug 2019 08:31:47 +0000 Date: Sat, 3 Aug 2019 08:31:43 +0000 (UTC) From: avih To: tinycc-devel@nongnu.org Message-ID: <127088284.657651.1564821103112@mail.yahoo.com> In-Reply-To: References: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_657650_1949668080.1564821103110" Content-Length: 8358 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 74.6.129.123 Subject: Re: [Tinycc-devel] Duplicate double X-BeenThere: tinycc-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Aug 2019 08:31:52 -0000 ------=_Part_657650_1949668080.1564821103110 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit You're right, and I can confirm that the win64 version downloaded the same as you exhibits the same issue, and the issue also exists if I build 0.27 for win64 myself (git d348a9a). However, it was apparently fixed shortly after tcc 0.27 was released, at the following commit: commit 8f6fcb709ae7b2379866c292ce478ab95dc75b48 Author: grischka Date: Thu May 31 23:51:51 2018 +0200 misc fixes misc fixes including: - tcc.c: fix "tcc -vv" for libtcc1.a on win32/PE - tccelf.c: fix a crash when GOT has no relocs (witn -nostdlib) - tccelf.c: fix stab linkage for zero n_strx - tccgen.c: fix stdcall decoration for array parameters int __stdcall func(char buf[10]) is _func@4 (was _func@12) - tccgen.c: fix static variables with nocode/nodata_wanted see tests2/96_nodata_wanted.c - tccrun.c: align sections using sh_addralign (for reliable function_alignment) - tests2/Makefile sort 100 after 99 - win32/include/sys/stat.h fix _stat and _wstat - x86_64-gen.c: win64/gfunc_call: fix a bug with xmmN register args previously overwrote valid other xmmN registers eventually Not sure which of the fixes did it, but I'd guess it's at x86_64-gen.c . If you want, I've built tcc for win32 and win64 from the latest git version (mob, 9e429db), and uploaded it here: https://0x0.st/zOsg.7z Cheers, Avi On Friday, August 2, 2019, 9:51:22 PM GMT+3, Klaus Ebbe Grue wrote: Hi tinycc-devel, Under MSYS2/MinGW I have a problem with tcc. I define this functions: void f(double x,double y,double z){printf("f(%4.1f,%4.1f,%4.1f)\n",x,y,z);} As an example, f(1,2,3) prints f( 1.0, 2.0, 3.0). Then I call f from main in a slightly confusing way: int main(int argc,char **argv){double u=0.0;f(u*1.0,7.0,8.0);return 0;} I would expect to get f( 0.0, 7.0, 8.0) but I do get f( 7.0, 7.0, 8.0). The first argument of f becomes a duplicate of the second argument of f. If I remove "*1.0" then everything works as expected. Is this a known bug? By the way, if I make the same program using integers, then there is no problem. I have included a reproduction scenario below. Cheers, Klaus --- Install MSYS2/MinGW Start MSYS2 shell > mkdir experiment > cd experiment > wget http://download.savannah.gnu.org/releases/tinycc/tcc-0.9.27-win64-bin.zip > pacman -S unzip > unzip tcc-0.9.27-win64-bin.zip > tcc/tcc -v tcc version 0.9.27 (x86_64 Windows) > cat>test.c #include void f(double x,double y,double z){printf("f(%4.1f,%4.1f,%4.1f)\n",x,y,z);} int main(int argc,char **argv){double u=0.0;f(u*1.0,7.0,8.0);return 0;} > tcc/tcc -o test test.c > ./test f( 7.0, 7.0, 8.0) _______________________________________________ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel ------=_Part_657650_1949668080.1564821103110 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
You're right, and I can confirm that the win64 ver= sion downloaded the
same as you exhibits the same issue, and the issue a= lso exists if
I build 0.27 for win64 myself (git d348a9a).

Howeve= r, it was apparently fixed shortly after tcc 0.27 was released,
at the f= ollowing commit:

commit 8f6fcb709ae7b2379866c292ce478ab95dc75b48
= Author: grischka <grischka>
Date: Thu May 31 23:51:51 2018 +0200=

misc fixes

misc fixes including:
- tcc.c: fix= "tcc -vv" for libtcc1.a on win32/PE
- tccelf.c: fix a cra= sh when GOT has no relocs (witn -nostdlib)
- tccelf.c: fix stab link= age for zero n_strx
- tccgen.c: fix stdcall decoration for array par= ameters
int __stdcall func(char buf[10]) is _func@4 (was _func@1= 2)
- tccgen.c: fix static variables with nocode/nodata_wanted
= see tests2/96_nodata_wanted.c
- tccrun.c: align sections using = sh_addralign (for reliable function_alignment)
- tests2/Makefile sor= t 100 after 99
- win32/include/sys/stat.h fix _stat and _wstat
= - x86_64-gen.c: win64/gfunc_call: fix a bug with xmmN register args
= previously overwrote valid other xmmN registers eventually

Not sure which of the fixes did it, but I'd guess it's at x86_64-g= en.c .

If you want, I've built tcc for win32 and win64 from the = latest git
version (mob, 9e429db), and uploaded it here: https://0x0.st/= zOsg.7z

Cheers,
Avi



=
On Fri= day, August 2, 2019, 9:51:22 PM GMT+3, Klaus Ebbe Grue <grue@di.ku.dk>= ; wrote:

=

Hi tinycc-devel,
=

Under MSYS2/MinGW I have = a problem with tcc.

I = define this functions:

void f(double x,double y,double z){printf("f(%4.1f,%4.1f,%4.1f)\n",x,y,z);= }

As an example, f(1,2= ,3) prints f( 1.0, 2.0, 3.0).

Then I call f from main in a slightly confusing way:

int main(int argc,char **argv){doub= le u=3D0.0;f(u*1.0,7.0,8.0);return 0;}

=
I would expect to get f( 0.0, 7.0, 8.0) but I do get f( 7.= 0, 7.0, 8.0).

The firs= t argument of f becomes a duplicate of the second argument of f.
<= div dir=3D"ltr">
If I remove "*1.0" then everythi= ng works as expected.

= Is this a known bug?

B= y the way, if I make the same program using integers, then there is no prob= lem.

I have included a= reproduction scenario below.

Cheers,
Klaus
=
---

Install MSYS2/MinGW
Start MSYS2 shell

> mkdir experiment
> cd experiment
> pacman -= S unzip
> unzip tcc-0.9.27-win64-bin.zip
> tcc/tcc -v
tcc version = 0.9.27 (x86_64 Windows)
> cat>test.c
#include <stdio.h>
void= f(double x,double y,double z){printf("f(%4.1f,%4.1f,%4.1f)\n",x,y,z);}
=
int main(int argc,char **argv){double u=3D0.0;f(u*1.= 0,7.0,8.0);return 0;}
> tcc/tcc -o test test.c=
> ./test
f( 7.0, 7.= 0, 8.0)
_________________________________________= ______
Tinycc-devel mailing list
------=_Part_657650_1949668080.1564821103110-- From MAILER-DAEMON Sat Aug 03 10:15:00 2019 Received: from list by lists.gnu.org with archive (Exim 4.86_2) id 1htuoF-0005TJ-HC for mharc-tinycc-devel@gnu.org; Sat, 03 Aug 2019 10:15:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46293) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1htuo9-0005SN-FL for tinycc-devel@nongnu.org; Sat, 03 Aug 2019 10:14:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1htuo7-0002VY-5K for tinycc-devel@nongnu.org; Sat, 03 Aug 2019 10:14:53 -0400 Received: from mail-eopbgr140098.outbound.protection.outlook.com ([40.107.14.98]:35808 helo=EUR01-VE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1htuo4-0002QS-T9 for tinycc-devel@nongnu.org; Sat, 03 Aug 2019 10:14:49 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d6taF/Q8/4qLIBhgIJ89PAJugMVs/k85rGvwEPYHl/9cHDoFvOlRTkVLxS4RbwKL3qoxYMcO1FoUyJ3apI3PuD1kQF8RIjI3y+OAaBNaozh2MBBWc6kJhYLnu0DEzl2VirkmZYx1dZnMlVo8RUX9CXlAogqm37L0hsIOOVRVJgxavsCcw2UtscKGWPfxQxn+IveELBkdcRAXgqGdRqsZl7WZXyGTcJnlTVuoco30hWpTh6fneevWo2L7K+pvArsgru1v08v0Q62G9cHHur1A7Lxi3tFu86xy5qIN0WleO5lcpSWHeziGXpnSoJP6NP6OoKS08ngX2ugdlcCMvAhpdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IT2q6DIl7azcSYTmVI1bNC/JcoZK/DNL7ji/BV0jVp4=; b=TLvFP49y98W6Ga2MR1hEEceQDfaJig5q+AWaR4PiS8tXQ+I9LeaLcSLQxuAq3GNTdJidSu81UFloDVZrazLozOPQIZxHNNsPZ4w+Ar/YLkq0/NRGZ4OWQhB43F7osxCMQQ8Aly1oXjzEJajteg6+gsnlwXITxowiFLljteGpqKrDEA8K1Tj+rdmOUoSY9OR4qWpUMBS5yXT4vPU5BDbIKMurdMDk6PrLTI10mT0WWTj/DrQ27sCqFfibdvyVfy6NhC/Dnep3VtLVBm6LyD8N2UqqgYODj1gQQ5SxKplh0+E7Bse7GpaUHots/k7mh5IFyqnSVQ+VW4A6cJ78RxFzFg== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=pass (sender ip is 192.38.125.76) smtp.rcpttodomain=nongnu.org smtp.mailfrom=di.ku.dk;dmarc=bestguesspass action=none header.from=di.ku.dk;dkim=none (message not signed);arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alumni.onmicrosoft.com; s=selector2-alumni-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IT2q6DIl7azcSYTmVI1bNC/JcoZK/DNL7ji/BV0jVp4=; b=GiLJZekAEUWOYL48QK9chBFodsh8oCAYistSJW8PwQG848m7DOFZzxq98okmhMD8MV2ZLrX7RHM0zP3OAPHCE1nMu/CeSI6DCvRg4mx5RQ8L1Bn/yrJEuLpTLlHsedNRIKYsg8oux1f3ICCTZEw/4hy67q4EqKW8RVFfn+MJDpU= Received: from VI1PR04CA0086.eurprd04.prod.outlook.com (2603:10a6:803:64::21) by AM6PR04MB4168.eurprd04.prod.outlook.com (2603:10a6:209:43::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2136.17; Sat, 3 Aug 2019 14:14:46 +0000 Received: from AM5EUR02FT046.eop-EUR02.prod.protection.outlook.com (2a01:111:f400:7e1e::204) by VI1PR04CA0086.outlook.office365.com (2603:10a6:803:64::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2136.17 via Frontend Transport; Sat, 3 Aug 2019 14:14:45 +0000 Authentication-Results: spf=pass (sender IP is 192.38.125.76) smtp.mailfrom=di.ku.dk; nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=bestguesspass action=none header.from=di.ku.dk; Received-SPF: Pass (protection.outlook.com: domain of di.ku.dk designates 192.38.125.76 as permitted sender) receiver=protection.outlook.com; client-ip=192.38.125.76; helo=sepo4.ku.dk; Received: from sepo4.ku.dk (192.38.125.76) by AM5EUR02FT046.mail.protection.outlook.com (10.152.8.221) with Microsoft SMTP Server id 15.20.2136.14 via Frontend Transport; Sat, 3 Aug 2019 14:14:45 +0000 Received: from 10.78.0.165 ([10.78.0.165]) by sepo4.ku.dk (JAMES SMTP Server 2.3.2-1) with SMTP ID 703; Sat, 3 Aug 2019 16:14:44 +0200 (CEST) Received: from P1KITMBX03WC02.unicph.domain ([fe80::4e4:28c5:cdcb:3fb2]) by P1KITHUB01W.unicph.domain ([::1]) with mapi id 14.03.0468.000; Sat, 3 Aug 2019 16:14:44 +0200 From: Klaus Ebbe Grue To: "tinycc-devel@nongnu.org" Thread-Topic: [Tinycc-devel] Duplicate double Thread-Index: AdVJXiEqHF+vTvVOR4WNfZ4eTOWQSAAZvxaAAA5zVCU= Date: Sat, 3 Aug 2019 14:14:43 +0000 Message-ID: References: , <127088284.657651.1564821103112@mail.yahoo.com> In-Reply-To: <127088284.657651.1564821103112@mail.yahoo.com> Accept-Language: da-DK, en-US Content-Language: da-DK X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.77.128.238] Content-Type: multipart/alternative; boundary="_000_B6DE68AC3CC96743A7E10D152B184D4701370DAF05P1KITMBX03WC0_" MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.38.125.76; IPV:NLI; CTRY:DK; EFV:NLI; SFV:NSPM; SFS:(10019020)(4636009)(136003)(396003)(39850400004)(346002)(376002)(2980300002)(199004)(189003)(606006)(11346002)(476003)(446003)(106002)(186003)(40036005)(336012)(69596002)(7696005)(478600001)(70206006)(33656002)(5660300002)(70586007)(2501003)(3846002)(6116002)(37786003)(966005)(81166006)(8676002)(8936002)(81156014)(2906002)(14444005)(7736002)(53936002)(316002)(786003)(9686003)(236005)(5640700003)(2351001)(16586007)(71190400001)(26005)(102836004)(86362001)(76176011)(126002)(486006)(54896002)(6306002)(55016002)(55846006)(356004)(6916009)(4326008)(68736007)(19623455009)(460985005)(2480315003)(19477635001); DIR:OUT; SFP:1102; SCL:1; SRVR:AM6PR04MB4168; H:sepo4.ku.dk; FPR:; SPF:Pass; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fdf6f6b3-2df5-4f61-e58f-08d7181cef8a X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(4709080)(1401327)(2017052603328)(7193020); SRVR:AM6PR04MB4168; X-MS-TrafficTypeDiagnostic: AM6PR04MB4168: X-MS-Exchange-PUrlCount: 4 X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-Forefront-PRVS: 0118CD8765 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: 9e7QZU3i/5p84N0hl/bcbfgq0BNVf3xKIPUevZ8WhrKqgm4WSql3FOauZVOobcrWae3L5ylYXiM7BA1pWhJplXh1noVEP9Qtut4fpHSXs3PVsMvryxCJyj5BfZcL8U9xxiUE4KWm1qMWyYDMpI6YMk925prt4XD74PLBb3cF+q+w4gg8r06kt9FkOfNtGNIm2eoF/+IkIvQCK4QJjyXj0v1iet6AUwOsAolWQyvgRlsekAF2ApJrWy3Nr43h1BTlafAG5VGDCWUNArPBuVBr/AhS2fWn/Df3Xg9OacM8sBkxbMEbNHLGuq47omBQL62aDbzGrlfgfXOXPIJrwlJ296oxmBnRV6OlIzMFNl5QJtUTpYYYkYEVIps8vz9S295yIt1mm/r66aupAJtQG1X7AyGaY1mX5QQdpFyGjslItho= X-OriginatorOrg: di.ku.dk X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Aug 2019 14:14:45.2091 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fdf6f6b3-2df5-4f61-e58f-08d7181cef8a X-MS-Exchange-CrossTenant-Id: a3927f91-cda1-4696-af89-8c9f1ceffa91 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=a3927f91-cda1-4696-af89-8c9f1ceffa91; Ip=[192.38.125.76]; Helo=[sepo4.ku.dk] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB4168 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.14.98 Subject: Re: [Tinycc-devel] Duplicate double X-BeenThere: tinycc-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Aug 2019 14:14:55 -0000 --_000_B6DE68AC3CC96743A7E10D152B184D4701370DAF05P1KITMBX03WC0_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi Avi, Great! Thanks! https://0x0.st/zOsg.7z worked. Just to test, I made a fresh msys2 install, cloned git://repo.or.cz/tinycc.= git and compiled. That also works. For completeness, I have included the steps. The only surprise was that whe= n using .configure --prefix=3D/usr I had to add --bindir=3D/usr/bin since o= therwise tcc ends up in /usr/tcc.exe Cheers, Klaus --- Remove C:\msys64 if present Go to https://www.msys2.org/ Click msys2-x86_64-20190524.exe Install msys2 using defaults In MSYS2 shell: > pacman -Syu As instructed, kill and restart MSYS2 shell > pacman -Syu > pacman -S gcc git make texinfo > git clone git://repo.or.cz/tinycc.git > cd tinycc > ./configure --prefix=3D/usr --bindir=3D/usr/bin > make > make install > cd > tcc -v tcc version 0.9.27 (x86_64 Windows) > mkdir experiment > cd experiment > cat>test.c #include void f(double x,double y,double z){printf("f(%4.1f,%4.1f,%4.1f)\n",x,y,z);} int main(int argc,char **argv){double u=3D0.0;f(u*1.0,7.0,8.0);return 0;} > tcc -o test test.c > ./test f( 0.0, 7.0, 8.0) ________________________________ Fra: Tinycc-devel [tinycc-devel-bounces+grue=3Ddi.ku.dk@nongnu.org] p=E5 ve= gne af avih via Tinycc-devel [tinycc-devel@nongnu.org] Sendt: 3. august 2019 10:31 Til: tinycc-devel@nongnu.org Cc: avih Emne: Re: [Tinycc-devel] Duplicate double You're right, and I can confirm that the win64 version downloaded the same as you exhibits the same issue, and the issue also exists if I build 0.27 for win64 myself (git d348a9a). However, it was apparently fixed shortly after tcc 0.27 was released, at the following commit: commit 8f6fcb709ae7b2379866c292ce478ab95dc75b48 Author: grischka Date: Thu May 31 23:51:51 2018 +0200 misc fixes misc fixes including: - tcc.c: fix "tcc -vv" for libtcc1.a on win32/PE - tccelf.c: fix a crash when GOT has no relocs (witn -nostdlib) - tccelf.c: fix stab linkage for zero n_strx - tccgen.c: fix stdcall decoration for array parameters int __stdcall func(char buf[10]) is _func@4 (was _func@12) - tccgen.c: fix static variables with nocode/nodata_wanted see tests2/96_nodata_wanted.c - tccrun.c: align sections using sh_addralign (for reliable function_alignm= ent) - tests2/Makefile sort 100 after 99 - win32/include/sys/stat.h fix _stat and _wstat - x86_64-gen.c: win64/gfunc_call: fix a bug with xmmN register args previously overwrote valid other xmmN registers eventually Not sure which of the fixes did it, but I'd guess it's at x86_64-gen.c . If you want, I've built tcc for win32 and win64 from the latest git version (mob, 9e429db), and uploaded it here: https://0x0.st/zOsg.7z Cheers, Avi On Friday, August 2, 2019, 9:51:22 PM GMT+3, Klaus Ebbe Grue wrote: Hi tinycc-devel, Under MSYS2/MinGW I have a problem with tcc. I define this functions: void f(double x,double y,double z){printf("f(%4.1f,%4.1f,%4.1f)\n",x,y,z);} As an example, f(1,2,3) prints f( 1.0, 2.0, 3.0). Then I call f from main in a slightly confusing way: int main(int argc,char **argv){double u=3D0.0;f(u*1.0,7.0,8.0);return 0;} I would expect to get f( 0.0, 7.0, 8.0) but I do get f( 7.0, 7.0, 8.0). The first argument of f becomes a duplicate of the second argument of f. If I remove "*1.0" then everything works as expected. Is this a known bug? By the way, if I make the same program using integers, then there is no pro= blem. I have included a reproduction scenario below. Cheers, Klaus --- Install MSYS2/MinGW Start MSYS2 shell > mkdir experiment > cd experiment > wget http://download.savannah.gnu.org/releases/tinycc/tcc-0.9.27-win64-bi= n.zip > pacman -S unzip > unzip tcc-0.9.27-win64-bin.zip > tcc/tcc -v tcc version 0.9.27 (x86_64 Windows) > cat>test.c #include void f(double x,double y,double z){printf("f(%4.1f,%4.1f,%4.1f)\n",x,y,z);} int main(int argc,char **argv){double u=3D0.0;f(u*1.0,7.0,8.0);return 0;} > tcc/tcc -o test test.c > ./test f( 7.0, 7.0, 8.0) _______________________________________________ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel --_000_B6DE68AC3CC96743A7E10D152B184D4701370DAF05P1KITMBX03WC0_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

Hi Avi,

 

Great! Thanks!

 

https://0x0.st/zOsg.7z worked.

 

Just to test, I made a fresh msys2 install, cloned git://repo.or.cz/tiny= cc.git and compiled. That also works.

 

For completeness, I have included the steps. The only surprise was that = when using .configure --prefix=3D/usr I had to add --bindir=3D/usr/bin= since otherwise tcc ends up in /usr/tcc.exe

 

Cheers,

Klaus

 

---

 

Remove C:\msys64 if present

Go to https://www.msys2.org/
Click msys2-x86_64-20190524.exe
Install msys2 using defaults

 

In MSYS2 shell:
> pacman -Syu
As instructed, kill and restart MSYS2 shell
> pacman -Syu
> pacman -S gcc git make texinfo
> git clone git://repo.or.cz/tinycc.git
> cd tinycc
> ./configure --prefix=3D/usr --bindir=3D/usr/bin
> make
> make install
> cd
> tcc -v
tcc version 0.9.27 (x86_64 Windows)
> mkdir experiment
> cd experiment
> cat>test.c
#include <stdio.h>
void f(double x,double y,double z){printf("f(%4.1f,%4.1f,%4.1f)\n"= ;,x,y,z);}
int main(int argc,char **argv){double u=3D0.0;f(u*1.0,7.0,8.0);return 0;} > tcc -o test test.c
> ./test
f( 0.0, 7.0, 8.0)

 

 

Fra: Tinycc-devel [tinycc-devel-bounces= 3;grue=3Ddi.ku.dk@nongnu.org] p=E5 vegne af avih via Tinycc-devel [tinycc-d= evel@nongnu.org]
Sendt: 3. august 2019 10:31
Til: tinycc-devel@nongnu.org
Cc: avih
Emne: Re: [Tinycc-devel] Duplicate double

You're right, and I can confirm that the win64 version downloaded the<= br> same as you exhibits the same issue, and the issue also exists if
I build 0.27 for win64 myself (git d348a9a).

However, it was apparently fixed shortly after tcc 0.27 was released,
at the following commit:

commit 8f6fcb709ae7b2379866c292ce478ab95dc75b48
Author: grischka <grischka>
Date: Thu May 31 23:51:51 2018 +0200

misc fixes

misc fixes including:
- tcc.c: fix "tcc -vv" for libtcc1.a on win32/PE
- tccelf.c: fix a crash when GOT has no relocs (witn -nostdlib)
- tccelf.c: fix stab linkage for zero n_strx
- tccgen.c: fix stdcall decoration for array parameters
int __stdcall func(char buf[10]) is _func@4 (was _func@12)
- tccgen.c: fix static variables with nocode/nodata_wanted
see tests2/96_nodata_wanted.c
- tccrun.c: align sections using sh_addralign (for reliable function_alignm= ent)
- tests2/Makefile sort 100 after 99
- win32/include/sys/stat.h fix _stat and _wstat
- x86_64-gen.c: win64/gfunc_call: fix a bug with xmmN register args
previously overwrote valid other xmmN registers eventually


Not sure which of the fixes did it, but I'd guess it's at x86_64-gen.c .
If you want, I've built tcc for win32 and win64 from the latest git
version (mob, 9e429db), and uploaded it here: https://0x0.st/zOsg.7z

Cheers,
Avi



On Friday, August 2, 2019, 9:51:22 PM GMT+3, Klaus Ebbe Grue <g= rue@di.ku.dk> wrote:


Hi tinycc-devel,

Under MSYS2/MinGW I have a problem with tcc.

I define this functions:

void f(double x,double y,double z){printf("f(%4.1f,%4= .1f,%4.1f)\n",x,y,z);}

As an example, f(1,2,3) prints f( 1.0, 2.0, 3.0).

Then I call f from main in a slightly confusing way:

int main(int argc,char **argv){double u=3D0.0;f(u*1.0,7.0,= 8.0);return 0;}

I would expect to get f( 0.0, 7.0, 8.0) but I do get f( 7.= 0, 7.0, 8.0).

The first argument of f becomes a duplicate of the second = argument of f.

If I remove "*1.0" then everything works as expe= cted.

Is this a known bug?

By the way, if I make the same program using integers, the= n there is no problem.

I have included a reproduction scenario below.

Cheers,
Klaus

---

Install MSYS2/MinGW
Start MSYS2 shell

> mkdir experiment
> cd experiment
> pacman -S unzip
> unzip tcc-0.9.27-win64-bin.zip
> tcc/tcc -v
tcc version 0.9.27 (x86_64 Windows)
> cat>test.c
#include <stdio.h>
void f(double x,double y,double z){printf("f(%4.1f,%4= .1f,%4.1f)\n",x,y,z);}
int main(int argc,char **argv){double u=3D0.0;f(u*1.0,7.0,= 8.0);return 0;}
> tcc/tcc -o test test.c
> ./test
f( 7.0, 7.0, 8.0)
_______________________________________________
Tinycc-devel mailing list
--_000_B6DE68AC3CC96743A7E10D152B184D4701370DAF05P1KITMBX03WC0_-- From MAILER-DAEMON Sun Aug 04 07:08:02 2019 Received: from list by lists.gnu.org with archive (Exim 4.86_2) id 1huEMr-00038F-W0 for mharc-tinycc-devel@gnu.org; Sun, 04 Aug 2019 07:08:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34561) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1huEMp-00037z-57 for tinycc-devel@nongnu.org; Sun, 04 Aug 2019 07:08:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1huEMn-0007BW-5j for tinycc-devel@nongnu.org; Sun, 04 Aug 2019 07:07:59 -0400 Received: from mail-eopbgr40119.outbound.protection.outlook.com ([40.107.4.119]:15191 helo=EUR03-DB5-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1huEMm-0007Ar-Mo for tinycc-devel@nongnu.org; Sun, 04 Aug 2019 07:07:57 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=my9PYvdet1izsWvwi9p/ZLoXSNPvJ42o1WOIxV7X5q/bcrm9eI+pdt/cxvY03876PR3+34iQxFUYdSQfejeaNsVDn1UOeksxKgaROjpWXL1Dp/a8bseUpLXbHOe3iYYIlizc9YP/e4XalTnwJSd4nDR+NpiEX+A779o2gmPp/0NyX9B4iE4dFVMMrkUWQ5TnTED8uy5kxA9pNjCIqkrLNP6jSG4T/MJDZlfzpZMKEjJj1wyI6wHTGX7jONp62J0Y0bLV8cZKHod2maljV7PlgZ82Saatv/fycorz8hHaIGlEjYeLue66xaUFOjqVqUWE6qwPSonP0TKkMo9XxWvk0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wWkHmi6TQuFyiHzBxRsoXQxpyfcdZ6EU3M57Q+Wul7A=; b=gYiHABcXUR7+SVc/dC2oPutUb8USG14gHb2x12W/KhZTmuAoU1SSTD43rYo0Bm2EpjhAfgmn1UQJ66zn9NRM0AQiqX05/J3b+G0SNQj+7w4BiSAoVEdQLGxy04nwmlbPDnx/FhglqXWE3Pm03U0rYg8dzhytYo+Vf0KoR78FzV+5Lk94kB9TbaafVgaOoC2bOLqT2cAAtWSoYbdFNS+OPiiEK51otg0JJtG7s2TouLvvuGhc7gLQQ16OPWqs/cfHnIUq+sK3ZlZFitUPzRKC9/nsDmSRKjk+J5K2rEK2BVKqQ6Oy7OTLFViHD5Ss4kgsP46U8xjPbW6SRua5LLwUIg== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=pass (sender ip is 192.38.124.76) smtp.rcpttodomain=nongnu.org smtp.mailfrom=di.ku.dk;dmarc=bestguesspass action=none header.from=di.ku.dk;dkim=none (message not signed);arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alumni.onmicrosoft.com; s=selector2-alumni-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wWkHmi6TQuFyiHzBxRsoXQxpyfcdZ6EU3M57Q+Wul7A=; b=IiQkZ/6LvpE8tX6Q1+L+0k+G7ObwnutC2/aBXs1WVUAvtwJfU8ghwJlTmuoojcMNnt0zbLzLJmOPEb/DQzJk+Ntlod92KIyfyZ+Bf7wbnRbvx4h8aNuHSf2mFhPx5Ph9Jyod6gMKL3wTrJ9xqgtYUSeuDtiK9dsSnIZlvg7HxKE= Received: from AM3PR04CA0139.eurprd04.prod.outlook.com (2603:10a6:207::23) by HE1PR0402MB2873.eurprd04.prod.outlook.com (2603:10a6:3:dc::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2136.17; Sun, 4 Aug 2019 11:07:53 +0000 Received: from AM5EUR02FT006.eop-EUR02.prod.protection.outlook.com (2a01:111:f400:7e1e::201) by AM3PR04CA0139.outlook.office365.com (2603:10a6:207::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2136.16 via Frontend Transport; Sun, 4 Aug 2019 11:07:52 +0000 Authentication-Results: spf=pass (sender IP is 192.38.124.76) smtp.mailfrom=di.ku.dk; nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=bestguesspass action=none header.from=di.ku.dk; Received-SPF: Pass (protection.outlook.com: domain of di.ku.dk designates 192.38.124.76 as permitted sender) receiver=protection.outlook.com; client-ip=192.38.124.76; helo=sepo3.ku.dk; Received: from sepo3.ku.dk (192.38.124.76) by AM5EUR02FT006.mail.protection.outlook.com (10.152.8.77) with Microsoft SMTP Server id 15.20.2136.14 via Frontend Transport; Sun, 4 Aug 2019 11:07:52 +0000 Received: from 10.78.0.165 ([10.78.0.165]) by sepo3.ku.dk (JAMES SMTP Server 2.3.2-1) with SMTP ID 146 for ; Sun, 4 Aug 2019 13:07:50 +0200 (CEST) Received: from P1KITMBX03WC02.unicph.domain ([fe80::4e4:28c5:cdcb:3fb2]) by P2KITHUB04W.unicph.domain ([::1]) with mapi id 14.03.0468.000; Sun, 4 Aug 2019 13:07:49 +0200 From: Klaus Ebbe Grue To: "tinycc-devel@nongnu.org" Thread-Topic: [Tinycc-devel] Duplicate double Thread-Index: AdVJXiEqHF+vTvVOR4WNfZ4eTOWQSAAZvxaAAA5zVCUALJBGwg== Date: Sun, 4 Aug 2019 11:07:48 +0000 Message-ID: References: , <127088284.657651.1564821103112@mail.yahoo.com>, In-Reply-To: Accept-Language: da-DK, en-US Content-Language: da-DK X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.77.0.238] Content-Type: multipart/alternative; boundary="_000_B6DE68AC3CC96743A7E10D152B184D4701370DB4B2P1KITMBX03WC0_" MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.38.124.76; IPV:NLI; CTRY:DK; EFV:NLI; SFV:NSPM; SFS:(10019020)(4636009)(376002)(346002)(39840400004)(136003)(396003)(2980300002)(189003)(199004)(7736002)(14444005)(2351001)(316002)(16586007)(786003)(3846002)(6116002)(8936002)(68736007)(11346002)(71190400001)(86362001)(81166006)(81156014)(33656002)(356004)(8676002)(70206006)(6246003)(606006)(336012)(446003)(7696005)(102836004)(53936002)(236005)(9686003)(70586007)(76176011)(40036005)(55016002)(476003)(126002)(6306002)(966005)(106002)(5640700003)(54896002)(186003)(2501003)(55846006)(37786003)(486006)(478600001)(229853002)(26005)(6916009)(69596002)(2906002)(5660300002)(19623455009)(460985005)(2480315003)(19477635001); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR0402MB2873; H:sepo3.ku.dk; FPR:; SPF:Pass; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 09d2c982-0d9a-4f66-2f21-08d718cbfe96 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(4709080)(1401327)(2017052603328)(7193020); SRVR:HE1PR0402MB2873; X-MS-TrafficTypeDiagnostic: HE1PR0402MB2873: X-MS-Exchange-PUrlCount: 4 X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-Forefront-PRVS: 0119DC3B5E X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: Eh1+6HVoxmBJpCAuhxW42+4bWgoLXFQPxJTS0b75W6uxhvVZcJ/7JKRiWxa5R6mnVqiocetU/ijE6dbDP/kLiCsZwdIts2CbYhTluxBsV7D75Ly/xLrhMwsNPqjEV8rlxW6gA3aSpGSUhaGya6TN7UT+D4WGoMlUpEP+UQQH/QMyNNdqgZZu9c1YXPi+RIL3VpzntPeunIhRz73hAtt9HTIpjltnIUe7Guu2aJjyr7c5TYb5QXdXpZVVm4fv6U1SejrlaW2BlUfOCviZAKssbTHENd75uX6I5AfoAtyLjrjei4nSJbygfps3lOHafttt2BOhDge0FxMWUsw0icuWH2qb8Qag2hFUkiTgcT7DC8yIT3755f7jKUDeo/t/+1S9hEPKgx0Og9DWL3NCM0ZE6+9u1WVtG0DKNkvrsNSXpKI= X-OriginatorOrg: di.ku.dk X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2019 11:07:52.4136 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 09d2c982-0d9a-4f66-2f21-08d718cbfe96 X-MS-Exchange-CrossTenant-Id: a3927f91-cda1-4696-af89-8c9f1ceffa91 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=a3927f91-cda1-4696-af89-8c9f1ceffa91; Ip=[192.38.124.76]; Helo=[sepo3.ku.dk] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0402MB2873 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.4.119 Subject: Re: [Tinycc-devel] Duplicate double X-BeenThere: tinycc-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Aug 2019 11:08:01 -0000 --_000_B6DE68AC3CC96743A7E10D152B184D4701370DB4B2P1KITMBX03WC0_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi again Avi, Can I persuade you to tell how you built https://0x0.st/zOsg.7z ? In particular, how you made the lib and includes relative to the location o= f 'tcc.exe' for tcc32 and tcc64. Googling around seems to suggest that one should use the right host (MinGW?= Cygwin?) and use the right ./configure options. Cheers, Klaus ________________________________ Fra: Tinycc-devel [tinycc-devel-bounces+grue=3Ddi.ku.dk@nongnu.org] p=E5 ve= gne af Klaus Ebbe Grue [grue@di.ku.dk] Sendt: 3. august 2019 16:14 Til: tinycc-devel@nongnu.org Emne: Re: [Tinycc-devel] Duplicate double Hi Avi, Great! Thanks! https://0x0.st/zOsg.7z worked. Just to test, I made a fresh msys2 install, cloned git://repo.or.cz/tinycc.= git and compiled. That also works. For completeness, I have included the steps. The only surprise was that whe= n using .configure --prefix=3D/usr I had to add --bindir=3D/usr/bin since o= therwise tcc ends up in /usr/tcc.exe Cheers, Klaus --- Remove C:\msys64 if present Go to https://www.msys2.org/ Click msys2-x86_64-20190524.exe Install msys2 using defaults In MSYS2 shell: > pacman -Syu As instructed, kill and restart MSYS2 shell > pacman -Syu > pacman -S gcc git make texinfo > git clone git://repo.or.cz/tinycc.git > cd tinycc > ./configure --prefix=3D/usr --bindir=3D/usr/bin > make > make install > cd > tcc -v tcc version 0.9.27 (x86_64 Windows) > mkdir experiment > cd experiment > cat>test.c #include void f(double x,double y,double z){printf("f(%4.1f,%4.1f,%4.1f)\n",x,y,z);} int main(int argc,char **argv){double u=3D0.0;f(u*1.0,7.0,8.0);return 0;} > tcc -o test test.c > ./test f( 0.0, 7.0, 8.0) ________________________________ Fra: Tinycc-devel [tinycc-devel-bounces+grue=3Ddi.ku.dk@nongnu.org] p=E5 ve= gne af avih via Tinycc-devel [tinycc-devel@nongnu.org] Sendt: 3. august 2019 10:31 Til: tinycc-devel@nongnu.org Cc: avih Emne: Re: [Tinycc-devel] Duplicate double You're right, and I can confirm that the win64 version downloaded the same as you exhibits the same issue, and the issue also exists if I build 0.27 for win64 myself (git d348a9a). However, it was apparently fixed shortly after tcc 0.27 was released, at the following commit: commit 8f6fcb709ae7b2379866c292ce478ab95dc75b48 Author: grischka Date: Thu May 31 23:51:51 2018 +0200 misc fixes misc fixes including: - tcc.c: fix "tcc -vv" for libtcc1.a on win32/PE - tccelf.c: fix a crash when GOT has no relocs (witn -nostdlib) - tccelf.c: fix stab linkage for zero n_strx - tccgen.c: fix stdcall decoration for array parameters int __stdcall func(char buf[10]) is _func@4 (was _func@12) - tccgen.c: fix static variables with nocode/nodata_wanted see tests2/96_nodata_wanted.c - tccrun.c: align sections using sh_addralign (for reliable function_alignm= ent) - tests2/Makefile sort 100 after 99 - win32/include/sys/stat.h fix _stat and _wstat - x86_64-gen.c: win64/gfunc_call: fix a bug with xmmN register args previously overwrote valid other xmmN registers eventually Not sure which of the fixes did it, but I'd guess it's at x86_64-gen.c . If you want, I've built tcc for win32 and win64 from the latest git version (mob, 9e429db), and uploaded it here: https://0x0.st/zOsg.7z Cheers, Avi On Friday, August 2, 2019, 9:51:22 PM GMT+3, Klaus Ebbe Grue wrote: Hi tinycc-devel, Under MSYS2/MinGW I have a problem with tcc. I define this functions: void f(double x,double y,double z){printf("f(%4.1f,%4.1f,%4.1f)\n",x,y,z);} As an example, f(1,2,3) prints f( 1.0, 2.0, 3.0). Then I call f from main in a slightly confusing way: int main(int argc,char **argv){double u=3D0.0;f(u*1.0,7.0,8.0);return 0;} I would expect to get f( 0.0, 7.0, 8.0) but I do get f( 7.0, 7.0, 8.0). The first argument of f becomes a duplicate of the second argument of f. If I remove "*1.0" then everything works as expected. Is this a known bug? By the way, if I make the same program using integers, then there is no pro= blem. I have included a reproduction scenario below. Cheers, Klaus --- Install MSYS2/MinGW Start MSYS2 shell > mkdir experiment > cd experiment > wget http://download.savannah.gnu.org/releases/tinycc/tcc-0.9.27-win64-bi= n.zip > pacman -S unzip > unzip tcc-0.9.27-win64-bin.zip > tcc/tcc -v tcc version 0.9.27 (x86_64 Windows) > cat>test.c #include void f(double x,double y,double z){printf("f(%4.1f,%4.1f,%4.1f)\n",x,y,z);} int main(int argc,char **argv){double u=3D0.0;f(u*1.0,7.0,8.0);return 0;} > tcc/tcc -o test test.c > ./test f( 7.0, 7.0, 8.0) _______________________________________________ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel --_000_B6DE68AC3CC96743A7E10D152B184D4701370DB4B2P1KITMBX03WC0_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

Hi again Avi,

 

Can I persuade you to tell how you built https://0x0.st/zOsg.7z ?

 

In particular, how you made the lib and includes relative to the locatio= n of 'tcc.exe' for tcc32 and tcc64.

 

Googling around seems to suggest that one should use the right host (Min= GW? Cygwin?) and use the right ./configure options.

 

Cheers,
Klaus

 

 


Fra: Tinycc-devel [tinycc-devel-bounces= 3;grue=3Ddi.ku.dk@nongnu.org] p=E5 vegne af Klaus Ebbe Grue [grue@di.ku.dk]=
Sendt: 3. august 2019 16:14
Til: tinycc-devel@nongnu.org
Emne: Re: [Tinycc-devel] Duplicate double

Hi Avi,

 

Great! Thanks!

 

https://0x0.st/zOsg.7z worked.

 

Just to test, I made a fresh msys2 install, cloned git://repo.or.cz/tiny= cc.git and compiled. That also works.

 

For completeness, I have included the steps. The only surprise was that = when using .configure --prefix=3D/usr I had to add --bindir=3D/usr/bin= since otherwise tcc ends up in /usr/tcc.exe

 

Cheers,

Klaus

 

---

 

Remove C:\msys64 if present

Go to https://www.msys2.org/
Click msys2-x86_64-20190524.exe
Install msys2 using defaults

 

In MSYS2 shell:
> pacman -Syu
As instructed, kill and restart MSYS2 shell
> pacman -Syu
> pacman -S gcc git make texinfo
> git clone git://repo.or.cz/tinycc.git
> cd tinycc
> ./configure --prefix=3D/usr --bindir=3D/usr/bin
> make
> make install
> cd
> tcc -v
tcc version 0.9.27 (x86_64 Windows)
> mkdir experiment
> cd experiment
> cat>test.c
#include <stdio.h>
void f(double x,double y,double z){printf("f(%4.1f,%4.1f,%4.1f)\n"= ;,x,y,z);}
int main(int argc,char **argv){double u=3D0.0;f(u*1.0,7.0,8.0);return 0;} > tcc -o test test.c
> ./test
f( 0.0, 7.0, 8.0)

 

 

Fra: Tinycc-devel [tinycc-devel-bounces= 3;grue=3Ddi.ku.dk@nongnu.org] p=E5 vegne af avih via Tinycc-devel [tinycc-d= evel@nongnu.org]
Sendt: 3. august 2019 10:31
Til: tinycc-devel@nongnu.org
Cc: avih
Emne: Re: [Tinycc-devel] Duplicate double

You're right, and I can confirm that the win64 version downloaded the<= br> same as you exhibits the same issue, and the issue also exists if
I build 0.27 for win64 myself (git d348a9a).

However, it was apparently fixed shortly after tcc 0.27 was released,
at the following commit:

commit 8f6fcb709ae7b2379866c292ce478ab95dc75b48
Author: grischka <grischka>
Date: Thu May 31 23:51:51 2018 +0200

misc fixes

misc fixes including:
- tcc.c: fix "tcc -vv" for libtcc1.a on win32/PE
- tccelf.c: fix a crash when GOT has no relocs (witn -nostdlib)
- tccelf.c: fix stab linkage for zero n_strx
- tccgen.c: fix stdcall decoration for array parameters
int __stdcall func(char buf[10]) is _func@4 (was _func@12)
- tccgen.c: fix static variables with nocode/nodata_wanted
see tests2/96_nodata_wanted.c
- tccrun.c: align sections using sh_addralign (for reliable function_alignm= ent)
- tests2/Makefile sort 100 after 99
- win32/include/sys/stat.h fix _stat and _wstat
- x86_64-gen.c: win64/gfunc_call: fix a bug with xmmN register args
previously overwrote valid other xmmN registers eventually


Not sure which of the fixes did it, but I'd guess it's at x86_64-gen.c .
If you want, I've built tcc for win32 and win64 from the latest git
version (mob, 9e429db), and uploaded it here: https://0x0.st/zOsg.7z

Cheers,
Avi



On Friday, August 2, 2019, 9:51:22 PM GMT+3, Klaus Ebbe Grue <g= rue@di.ku.dk> wrote:


Hi tinycc-devel,

Under MSYS2/MinGW I have a problem with tcc.

I define this functions:

void f(double x,double y,double z){printf("f(%4.1f,%4= .1f,%4.1f)\n",x,y,z);}

As an example, f(1,2,3) prints f( 1.0, 2.0, 3.0).

Then I call f from main in a slightly confusing way:

int main(int argc,char **argv){double u=3D0.0;f(u*1.0,7.0,= 8.0);return 0;}

I would expect to get f( 0.0, 7.0, 8.0) but I do get f( 7.= 0, 7.0, 8.0).

The first argument of f becomes a duplicate of the second = argument of f.

If I remove "*1.0" then everything works as expe= cted.

Is this a known bug?

By the way, if I make the same program using integers, the= n there is no problem.

I have included a reproduction scenario below.

Cheers,
Klaus

---

Install MSYS2/MinGW
Start MSYS2 shell

> mkdir experiment
> cd experiment
> pacman -S unzip
> unzip tcc-0.9.27-win64-bin.zip
> tcc/tcc -v
tcc version 0.9.27 (x86_64 Windows)
> cat>test.c
#include <stdio.h>
void f(double x,double y,double z){printf("f(%4.1f,%4= .1f,%4.1f)\n",x,y,z);}
int main(int argc,char **argv){double u=3D0.0;f(u*1.0,7.0,= 8.0);return 0;}
> tcc/tcc -o test test.c
> ./test
f( 7.0, 7.0, 8.0)
_______________________________________________
Tinycc-devel mailing list
--_000_B6DE68AC3CC96743A7E10D152B184D4701370DB4B2P1KITMBX03WC0_-- From MAILER-DAEMON Sun Aug 04 07:32:37 2019 Received: from list by lists.gnu.org with archive (Exim 4.86_2) id 1huEkf-0006AA-On for mharc-tinycc-devel@gnu.org; Sun, 04 Aug 2019 07:32:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36686) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1huEkc-0006A0-7x for tinycc-devel@nongnu.org; Sun, 04 Aug 2019 07:32:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1huEka-0000jt-4z for tinycc-devel@nongnu.org; Sun, 04 Aug 2019 07:32:34 -0400 Received: from smtp03.smtpout.orange.fr ([80.12.242.125]:46208 helo=smtp.smtpout.orange.fr) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1huEkZ-0000a5-IH for tinycc-devel@nongnu.org; Sun, 04 Aug 2019 07:32:32 -0400 Received: from wwinf1z31 ([10.223.68.105]) by mwinf5d05 with ME id kzYT2000E2GGVDm03zYTKH; Sun, 04 Aug 2019 13:32:27 +0200 X-ME-Helo: wwinf1z31 X-ME-Auth: ZWxpZ2lzQG9yYW5nZS5mcg== X-ME-Date: Sun, 04 Aug 2019 13:32:27 +0200 X-ME-IP: 80.12.34.187 Date: Sun, 4 Aug 2019 13:32:27 +0200 (CEST) From: Christian JULLIEN Reply-To: Christian JULLIEN To: "tinycc-devel@nongnu.org" Message-ID: <1669472424.608.1564918347754.JavaMail.www@wwinf1z31> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_607_536235548.1564918347750" X-Country-Code: X-me-spamlevel: low X-Cache-ID: Message-Context: email-message X-Message-Size: X-WUM-SignatureAdded: X-SAVECOPY: true X-National-Code: X-Cache-Entry: X-Wum-ChannelType: X-Originating-IP: 80.12.34.187 X-Wum-Nature: EMAIL-NATURE X-WUM-FROM: |~| X-WUM-TO: |~| X-WUM-REPLYTO: |~| X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.12.242.125 Subject: Re: [Tinycc-devel] *** SPAM *** Re: Duplicate double X-BeenThere: tinycc-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Aug 2019 11:32:36 -0000 ------=_Part_607_536235548.1564918347750 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello Klaus, I don't know how Avi builds tcc on Windows but, on my side, I have made thi= s companion repository that works well with Cygwin: https://sourceforge.net/projects/wintcc/ Basically, get the cygwin/Makefile you have to drop in tcc/win32, and just = run "make" (files in includes are already integrated in tcc and you don't n= eed them)It builds a native tcc 32/64 compiler built with tcc bootstrapped = with gcc (i.e. a reproductible build).A Makefile named "tarball" produces a= standalone .zip you can use on any Windows machine.tcc compiled binary doe= s not need cygwin runtime to be present. I don't understand quite well why Grischka refused to add it on official tc= c distrib. C. Le : 04 ao=C3=BBt 2019 =C3=A0 13:08 (GMT +02:00) De : "Klaus Ebbe Grue" <grue@di.ku.dk> =C3=80 : "tinycc-devel@nongnu.org" <tinycc-devel@nongnu.org> Objet : *** SPAM *** Re: [Tinycc-devel] Duplicate double #sandBox #oo_editor_Editor_0_sandBox P _oo_editor_Editor_0_sandBox _sandB= ox { MARGIN-BOTTOM: 0px; MARGIN-TOP: 0px }#sandBox #oo_editor_Editor_0_sandBox =20 P _oo_editor_Editor_0_sandBox _sandBox { MARGIN-BOTTOM: 0px; MARGIN-TOP: 0px } Hi again Avi,   Can I persuade you to tell how you built=20 https://0x0.st/zOsg.7z ?   In particular, how you made the lib and includes relative to the location o= f 'tcc.exe' for tcc32 and tcc64.   Googling around seems to suggest that one should use the right host (MinGW?= Cygwin?) and use the right ./configure options.   Cheers, Klaus     Fra: Tinycc-devel [tinycc-devel-bounces+grue=3Ddi.ku.dk@nongnu.org] p=C3=A5= vegne af Klaus Ebbe Grue [grue@di.ku.dk] Sendt: 3. august 2019 16:14 Til: tinycc-devel@nongnu.org Emne: Re: [Tinycc-devel] Duplicate double Hi Avi,   Great! Thanks!   https://0x0.st/zOsg.7z worked.   Just to test, I made a fresh msys2 install, cloned git://repo.or.cz/tinycc.= git and compiled. That also works.   For completeness, I have included the steps. The only surprise was that whe= n using .configure --prefix=3D/usr I had to add --bindir=3D/usr/bin since o= therwise tcc ends up in /usr/tcc.exe   Cheers, Klaus   ---   Remove C:\msys64 if present Go to=20 https://www.msys2.org/ Click msys2-x86_64-20190524.exe Install msys2 using defaults   In MSYS2 shell: > pacman -Syu As instructed, kill and restart MSYS2 shell > pacman -Syu > pacman -S gcc git make texinfo > git clone git://repo.or.cz/tinycc.git > cd tinycc > ./configure --prefix=3D/usr --bindir=3D/usr/bin > make > make install > cd > tcc -v tcc version 0.9.27 (x86_64 Windows) > mkdir experiment > cd experiment > cat>test.c #include <stdio.h> void f(double x,double y,double z){printf("f(%4.1f,%4.1f,%4.1f)\n",x,y,z);} int main(int argc,char **argv){double u=3D0.0;f(u*1.0,7.0,8.0);return 0;} > tcc -o test test.c > ./test f( 0.0, 7.0, 8.0)     Fra: Tinycc-devel [tinycc-devel-bounces+grue=3Ddi.ku.dk@nongnu.org] p=C3=A5= vegne af avih via Tinycc-devel [tinycc-devel@nongnu.org] Sendt: 3. august 2019 10:31 Til: tinycc-devel@nongnu.org Cc: avih Emne: Re: [Tinycc-devel] Duplicate double You're right, and I can confirm that the win64 version downloaded the same as you exhibits the same issue, and the issue also exists if I build 0.27 for win64 myself (git d348a9a). However, it was apparently fixed shortly after tcc 0.27 was released, at the following commit: commit 8f6fcb709ae7b2379866c292ce478ab95dc75b48 Author: grischka <grischka> Date: Thu May 31 23:51:51 2018 +0200 misc fixes misc fixes including: - tcc.c: fix "tcc -vv" for libtcc1.a on win32/PE - tccelf.c: fix a crash when GOT has no relocs (witn -nostdlib) - tccelf.c: fix stab linkage for zero n_strx - tccgen.c: fix stdcall decoration for array parameters int __stdcall func(char buf[10]) is _func@4 (was _func@12) - tccgen.c: fix static variables with nocode/nodata_wanted see tests2/96_nodata_wanted.c - tccrun.c: align sections using sh_addralign (for reliable function_alignm= ent) - tests2/Makefile sort 100 after 99 - win32/include/sys/stat.h fix _stat and _wstat - x86_64-gen.c: win64/gfunc_call: fix a bug with xmmN register args previously overwrote valid other xmmN registers eventually Not sure which of the fixes did it, but I'd guess it's at x86_64-gen.c . If you want, I've built tcc for win32 and win64 from the latest git version (mob, 9e429db), and uploaded it here: https://0x0.st/zOsg.7z Cheers, Avi On Friday, August 2, 2019, 9:51:22 PM GMT+3, Klaus Ebbe Grue <grue@di.ku= .dk> wrote: Hi tinycc-devel, Under MSYS2/MinGW I have a problem with tcc. I define this functions: void f(double x,double y,double z){printf("f(%4.1f,%4.1f,%4.1f)\n",x,y,z);} As an example, f(1,2,3) prints f( 1.0, 2.0, 3.0). Then I call f from main in a slightly confusing way: int main(int argc,char **argv){double u=3D0.0;f(u*1.0,7.0,8.0);return 0;} I would expect to get f( 0.0, 7.0, 8.0) but I do get f( 7.0, 7.0, 8.0). The first argument of f becomes a duplicate of the second argument of f. If I remove "*1.0" then everything works as expected. Is this a known bug? By the way, if I make the same program using integers, then there is no pro= blem. I have included a reproduction scenario below. Cheers, Klaus --- Install MSYS2/MinGW Start MSYS2 shell > mkdir experiment > cd experiment > wget=20 http://download.savannah.gnu.org/releases/tinycc/tcc-0.9.27-win64-bin.zip > pacman -S unzip > unzip tcc-0.9.27-win64-bin.zip > tcc/tcc -v tcc version 0.9.27 (x86_64 Windows) > cat>test.c #include <stdio.h> void f(double x,double y,double z){printf("f(%4.1f,%4.1f,%4.1f)\n",x,y,z);} int main(int argc,char **argv){double u=3D0.0;f(u*1.0,7.0,8.0);return 0;} > tcc/tcc -o test test.c > ./test f( 7.0, 7.0, 8.0) _______________________________________________ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel _______________________________________________ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel ------=_Part_607_536235548.1564918347750 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello Klaus,

I don't know how Avi builds tcc on Windows = but, on my side, I have made this companion repository that works well with= Cygwin:


Basically, get the cygwin/Makefile you have to drop in tcc/win32, an= d just run "make" (files in includes are already integrated in tcc and you = don't need them)
It builds a native tcc 32/64 compiler built with= tcc bootstrapped with gcc (i.e. a reproductible build).
A Makefi= le named "tarball" produces a standalone .zip you can use on any Windows ma= chine.
tcc compiled binary does not need cygwin runtime to be pre= sent.

I don't understand quite well why Grischka r= efused to add it on official tcc distrib.

C.


Le :&nbs= p;04 ao=C3=BBt 2019 =C3=A0 13:08 (GMT +02:00)
De : "Klaus Ebbe Grue" <grue@di.ku.dk&g= t;
=C3=80 : "tinycc-devel@nongnu.org" <tinycc-devel@nongnu.org>
Objet :&nb= sp;*** SPAM *** Re: [Tinycc-devel] Duplicate double


Hi again Avi,

 

Can I persuade you to tell how you built https://0x0.st/zOsg.7z ?

 

In particular, how you made the lib and includes relative to the locatio= n of 'tcc.exe' for tcc32 and tcc64.

 

Googling around seems to suggest that one should use the right host (Min= GW? Cygwin?) and use the right ./configure options.

 

Cheers,
Klaus

 

 


Fra: Tinycc-de= vel [tinycc-devel-bounces+grue=3Ddi.ku.dk@nongnu.org] p=C3=A5 vegne af Klau= s Ebbe Grue [grue@di.ku.dk]
Sendt: 3. august 2019 16:14
Til: tinycc-devel@nongnu.org
Emne: Re: [Tinycc-devel] Duplicate double

Hi Avi,

 

Great! Thanks!

 

https://0x0.st/zOsg.7z worked.

 

Just to test, I made a fresh msys2 install, cloned git://repo.or.cz/tiny= cc.git and compiled. That also works.

 

For completeness, I have included the steps. The only surprise was that = when using .configure --prefix=3D/usr I had to add --bindir=3D/usr/bin sinc= e otherwise tcc ends up in /usr/tcc.exe

 

Cheers,

Klaus

 

---

 

Remove C:\msys64 if present

Go to https://www.msys2.org/
Click msys2-x86_64-20190524.exe
Install msys2 using defaults

 

In MSYS2 shell:
> pacman -Syu
As instructed, kill and restart MSYS2 shell
> pacman -Syu
> pacman -S gcc git make texinfo
> git clone git://repo.or.cz/tinycc.git
> cd tinycc
> ./configure --prefix=3D/usr --bindir=3D/usr/bin
> make
> make install
> cd
> tcc -v
tcc version 0.9.27 (x86_64 Windows)
> mkdir experiment
> cd experiment
> cat>test.c
#include <stdio.h>
void f(double x,double y,double z){printf("f(%4.1f,%4.1f,%4.1f)\n",x,y,z);}=
int main(int argc,char **argv){double u=3D0.0;f(u*1.0,7.0,8.0);return 0;} > tcc -o test test.c
> ./test
f( 0.0, 7.0, 8.0)

 

 

Fra: Tinycc-de= vel [tinycc-devel-bounces+grue=3Ddi.ku.dk@nongnu.org] p=C3=A5 vegne af avih= via Tinycc-devel [tinycc-devel@nongnu.org]
Sendt: 3. august 2019 10:31
Til: tinycc-devel@nongnu.org
Cc: avih
Emne: Re: [Tinycc-devel] Duplicate double

You're right, and I can confirm that the win64 version downloaded the<= br> same as you exhibits the same issue, and the issue also exists if
I build 0.27 for win64 myself (git d348a9a).

However, it was apparently fixed shortly after tcc 0.27 was released,
at the following commit:

commit 8f6fcb709ae7b2379866c292ce478ab95dc75b48
Author: grischka <grischka>
Date: Thu May 31 23:51:51 2018 +0200

misc fixes

misc fixes including:
- tcc.c: fix "tcc -vv" for libtcc1.a on win32/PE
- tccelf.c: fix a crash when GOT has no relocs (witn -nostdlib)
- tccelf.c: fix stab linkage for zero n_strx
- tccgen.c: fix stdcall decoration for array parameters
int __stdcall func(char buf[10]) is _func@4 (was _func@12)
- tccgen.c: fix static variables with nocode/nodata_wanted
see tests2/96_nodata_wanted.c
- tccrun.c: align sections using sh_addralign (for reliable function_alignm= ent)
- tests2/Makefile sort 100 after 99
- win32/include/sys/stat.h fix _stat and _wstat
- x86_64-gen.c: win64/gfunc_call: fix a bug with xmmN register args
previously overwrote valid other xmmN registers eventually


Not sure which of the fixes did it, but I'd guess it's at x86_64-gen.c .
If you want, I've built tcc for win32 and win64 from the latest git
version (mob, 9e429db), and uploaded it here: https://0x0.st/zOsg.7z

Cheers,
Avi



On Friday, August 2, 2019, 9:51:22 PM GMT+3, Klaus Ebbe Grue <grue@= di.ku.dk> wrote:


Hi tinycc-devel,

Under MSYS2/MinGW I have a problem with tcc.

I define this functions:

void f(double x,double y,double z){printf("f(%4.1f,%4.1f,%= 4.1f)\n",x,y,z);}

As an example, f(1,2,3) prints f( 1.0, 2.0, 3.0).

Then I call f from main in a slightly confusing way:

int main(int argc,char **argv){double u=3D0.0;f(u*1.0,7.0,= 8.0);return 0;}

I would expect to get f( 0.0, 7.0, 8.0) but I do get f( 7.= 0, 7.0, 8.0).

The first argument of f becomes a duplicate of the second = argument of f.

If I remove "*1.0" then everything works as expected.

Is this a known bug?

By the way, if I make the same program using integers, the= n there is no problem.

I have included a reproduction scenario below.

Cheers,
Klaus

---

Install MSYS2/MinGW
Start MSYS2 shell

> mkdir experiment
> cd experiment
> pacman -S unzip
> unzip tcc-0.9.27-win64-bin.zip
> tcc/tcc -v
tcc version 0.9.27 (x86_64 Windows)
> cat>test.c
#include <stdio.h>
void f(double x,double y,double z){printf("f(%4.1f,%4.1f,%= 4.1f)\n",x,y,z);}
int main(int argc,char **argv){double u=3D0.0;f(u*1.0,7.0,= 8.0);return 0;}
> tcc/tcc -o test test.c
> ./test
f( 7.0, 7.0, 8.0)
_______________________________________________
Tinycc-devel mailing list



________________________________________= _______
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://= lists.nongnu.org/mailman/listinfo/tinycc-devel
------=_Part_607_536235548.1564918347750-- From MAILER-DAEMON Sun Aug 04 08:48:06 2019 Received: from list by lists.gnu.org with archive (Exim 4.86_2) id 1huFvi-0007F7-B9 for mharc-tinycc-devel@gnu.org; Sun, 04 Aug 2019 08:48:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45567) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1huFvf-0007F0-7r for tinycc-devel@nongnu.org; Sun, 04 Aug 2019 08:48:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1huFvd-0003P5-17 for tinycc-devel@nongnu.org; Sun, 04 Aug 2019 08:48:03 -0400 Received: from mail-eopbgr40090.outbound.protection.outlook.com ([40.107.4.90]:22758 helo=EUR03-DB5-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1huFvc-0003K6-IZ for tinycc-devel@nongnu.org; Sun, 04 Aug 2019 08:48:00 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YomSAVvdesFxJvoolGwmnN7nIbppUCT7RGYznH1nB+wTN179cyvGhmHQ3sqxbfI0fwwa0Gdk7uQ3Ko6bxJU+v3SHGs32DWDL/t6SzRVLyoOdOeJANMf3SoxDykyucNLMmUktsRyu1wBi1AJbJgbYZe8KHjnqKjMyERlZuzpNO1jYdcyh/uP+yUVQkoRzGOGv7o0tLZ6BI8S1Ng2lUI0NKmXaeIkPhm/EafCYL5EmE8/slNqVLiCbK1aiCnYFFbKK53Ot8fXLw9O77eo7XtpM1pAHvgv/lmn0rrO9qzir3ysCTa4MKR8UOMxCrCtcVtKA55MeeKDUE9hyc+Kt7myt9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=P9/en+Mq63Hir8i0nTO89WFDYSkRIEEvM0iz/Eu/i5w=; b=ZwWWMA4PYwKnymsxdZVDSG+IVsUTTfmcG6qp8bz6nmjUC8OG+NiNrgmrlG8KXFFBm8e2rz4rWLNsk5/Q5Gjrcsw8+on+eXWFrA+uMJ1E3IX//OZsdsrNo7uF9JEuaGa3ieGgK3q/9zuyOsA5Si93qdeGb3Z3CV+vUPgtjBKNZ0uu125yC4AFNDyoHFNzMKD1O3p+JuUFS2majWkRfph8Tr2ahx4h1kPldVOn/QV1xDtI4YbtTxE8ifUHslhr50c62WyLCs/ZbVYFgy1fgL/hC/+er4WZNHVLEe2uUrCsI0P8s0ynu9gcqDTQcZTl+RRMBQYkFX8tQbHTthXudYo01w== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=pass (sender ip is 192.38.125.76) smtp.rcpttodomain=orange.fr smtp.mailfrom=di.ku.dk;dmarc=bestguesspass action=none header.from=di.ku.dk;dkim=none (message not signed);arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alumni.onmicrosoft.com; s=selector2-alumni-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=P9/en+Mq63Hir8i0nTO89WFDYSkRIEEvM0iz/Eu/i5w=; b=jkqJwtb/VmSxSSB4nePPD764389TykgwByXm8i+Wx2s3/HxcRZHxlIBEjFcLn4H3iw7Hhp/markejjZ0SMbepZNpL0/i8QMWAFrvNlCsQfbUffKaGPS971SjAfZemtTdjY+HvLbbSGuazNN1gZWIrRF6m+YAP24pizAV+s0Lbpk= Received: from DB8PR04CA0002.eurprd04.prod.outlook.com (2603:10a6:10:110::12) by HE1PR04MB3289.eurprd04.prod.outlook.com (2603:10a6:7:1f::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2136.17; Sun, 4 Aug 2019 12:47:57 +0000 Received: from HE1EUR02FT033.eop-EUR02.prod.protection.outlook.com (2a01:111:f400:7e05::202) by DB8PR04CA0002.outlook.office365.com (2603:10a6:10:110::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2136.17 via Frontend Transport; Sun, 4 Aug 2019 12:47:56 +0000 Authentication-Results: spf=pass (sender IP is 192.38.125.76) smtp.mailfrom=di.ku.dk; orange.fr; dkim=none (message not signed) header.d=none;orange.fr; dmarc=bestguesspass action=none header.from=di.ku.dk; Received-SPF: Pass (protection.outlook.com: domain of di.ku.dk designates 192.38.125.76 as permitted sender) receiver=protection.outlook.com; client-ip=192.38.125.76; helo=sepo4.ku.dk; Received: from sepo4.ku.dk (192.38.125.76) by HE1EUR02FT033.mail.protection.outlook.com (10.152.10.152) with Microsoft SMTP Server id 15.20.2136.14 via Frontend Transport; Sun, 4 Aug 2019 12:47:56 +0000 Received: from 10.78.0.165 ([10.78.0.165]) by sepo4.ku.dk (JAMES SMTP Server 2.3.2-1) with SMTP ID 428; Sun, 4 Aug 2019 14:47:55 +0200 (CEST) Received: from P1KITMBX03WC02.unicph.domain ([fe80::4e4:28c5:cdcb:3fb2]) by P1KITHUB03W.unicph.domain ([::1]) with mapi id 14.03.0468.000; Sun, 4 Aug 2019 14:47:55 +0200 From: Klaus Ebbe Grue To: Christian JULLIEN , "tinycc-devel@nongnu.org" Thread-Topic: [Tinycc-devel] Duplicate double Thread-Index: AQHVSsLVYS8ySdD+hUqqH/yJy+YecA== Date: Sun, 4 Aug 2019 12:47:54 +0000 Message-ID: Accept-Language: da-DK, en-US Content-Language: da-DK X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.77.128.234] Content-Type: multipart/alternative; boundary="_000_B6DE68AC3CC96743A7E10D152B184D4701370DB4E0P1KITMBX03WC0_" MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.38.125.76; IPV:NLI; CTRY:DK; EFV:NLI; SFV:NSPM; SFS:(10019020)(4636009)(346002)(376002)(136003)(39850400004)(396003)(2980300002)(199004)(189003)(966005)(2906002)(476003)(126002)(229853002)(7736002)(8676002)(486006)(81166006)(81156014)(26005)(30864003)(186003)(2501003)(8936002)(66574012)(69596002)(336012)(6116002)(3846002)(68736007)(6246003)(53936002)(6306002)(54896002)(33656002)(55016002)(9686003)(236005)(478600001)(55846006)(86362001)(70206006)(37786003)(606006)(110136005)(71190400001)(70586007)(356004)(16586007)(316002)(786003)(106002)(19627235002)(40036005)(7696005)(14444005)(5660300002)(102836004)(19623455009)(460985005)(2480315003)(19477635001); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR04MB3289; H:sepo4.ku.dk; FPR:; SPF:Pass; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 65a05866-7ac1-46ad-2fea-08d718d9f92d X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(4709080)(1401327)(2017052603328)(7193020); SRVR:HE1PR04MB3289; X-MS-TrafficTypeDiagnostic: HE1PR04MB3289: X-MS-Exchange-PUrlCount: 5 X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-Forefront-PRVS: 0119DC3B5E X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: ImbpuwWVqzhzYcQnFDFWCFZ/ig1ulgEh/K/Tyn/I3i/UhrO1GdK9oGRWHVt7qdOxo0ZxVfiAX5ECwHHyULQl0HSyO8UHTyUcieAEBqMCNmbbIuAiDI46IlKAum5HNN94wzrkB7Z25hyw5kvYIDzdK0MNtnqfG34MhnjesyXPg1GGm9QhK/2eoPr9yhT3aL1xE41TWmkxZPp12oSpcuoOjoh3E10+5AUb9BDrYXHaUDZeNP38ojuPPVmZ/wPUTjD/9DbGCo1EssKw0DklSI88Lf1b83k9+OGfcNr9oFie1fLikYJhoDMzHnM+jiDIhgGbTtT4wB/VIA8ytKmSwSBlQPNJTwQvMqWuyzNylvv3q88VDfYfA54ELOO+gvSmoJbgMASUOv11fV2Xo1Tv88A2cyrxlciRFttrEs6w7xeM/L8= X-OriginatorOrg: di.ku.dk X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2019 12:47:56.2071 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 65a05866-7ac1-46ad-2fea-08d718d9f92d X-MS-Exchange-CrossTenant-Id: a3927f91-cda1-4696-af89-8c9f1ceffa91 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=a3927f91-cda1-4696-af89-8c9f1ceffa91; Ip=[192.38.125.76]; Helo=[sepo4.ku.dk] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR04MB3289 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.4.90 Subject: Re: [Tinycc-devel] Duplicate double X-BeenThere: tinycc-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Aug 2019 12:48:05 -0000 --_000_B6DE68AC3CC96743A7E10D152B184D4701370DB4E0P1KITMBX03WC0_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi Christian, Perfect! Thanks a lot. Cheers, Klaus ________________________________ Fra: Tinycc-devel [tinycc-devel-bounces+grue=3Ddi.ku.dk@nongnu.org] p=E5 ve= gne af Christian JULLIEN [eligis@orange.fr] Sendt: 4. august 2019 13:32 Til: tinycc-devel@nongnu.org Emne: Re: [Tinycc-devel] *** SPAM *** Re: Duplicate double Hello Klaus, I don't know how Avi builds tcc on Windows but, on my side, I have made thi= s companion repository that works well with Cygwin: https://sourceforge.net/projects/wintcc/ Basically, get the cygwin/Makefile you have to drop in tcc/win32, and just = run "make" (files in includes are already integrated in tcc and you don't n= eed them) It builds a native tcc 32/64 compiler built with tcc bootstrapped with gcc = (i.e. a reproductible build). A Makefile named "tarball" produces a standalone .zip you can use on any Wi= ndows machine. tcc compiled binary does not need cygwin runtime to be present. I don't understand quite well why Grischka refused to add it on official tc= c distrib. C. Le : 04 ao=FBt 2019 =E0 13:08 (GMT +02:00) De : "Klaus Ebbe Grue" =C0 : "tinycc-devel@nongnu.org" Objet : *** SPAM *** Re: [Tinycc-devel] Duplicate double Hi again Avi, Can I persuade you to tell how you built https://0x0.st/zOsg.7z ? In particular, how you made the lib and includes relative to the location o= f 'tcc.exe' for tcc32 and tcc64. Googling around seems to suggest that one should use the right host (MinGW?= Cygwin?) and use the right ./configure options. Cheers, Klaus ________________________________ Fra: Tinycc-devel [tinycc-devel-bounces+grue=3Ddi.ku.dk@nongnu.org] p=E5 ve= gne af Klaus Ebbe Grue [grue@di.ku.dk] Sendt: 3. august 2019 16:14 Til: tinycc-devel@nongnu.org Emne: Re: [Tinycc-devel] Duplicate double Hi Avi, Great! Thanks! https://0x0.st/zOsg.7z worked. Just to test, I made a fresh msys2 install, cloned git://repo.or.cz/tinycc.= git and compiled. That also works. For completeness, I have included the steps. The only surprise was that whe= n using .configure --prefix=3D/usr I had to add --bindir=3D/usr/bin since o= therwise tcc ends up in /usr/tcc.exe Cheers, Klaus --- Remove C:\msys64 if present Go to https://www.msys2.org/ Click msys2-x86_64-20190524.exe Install msys2 using defaults In MSYS2 shell: > pacman -Syu As instructed, kill and restart MSYS2 shell > pacman -Syu > pacman -S gcc git make texinfo > git clone git://repo.or.cz/tinycc.git > cd tinycc > ./configure --prefix=3D/usr --bindir=3D/usr/bin > make > make install > cd > tcc -v tcc version 0.9.27 (x86_64 Windows) > mkdir experiment > cd experiment > cat>test.c #include void f(double x,double y,double z){printf("f(%4.1f,%4.1f,%4.1f)\n",x,y,z);} int main(int argc,char **argv){double u=3D0.0;f(u*1.0,7.0,8.0);return 0;} > tcc -o test test.c > ./test f( 0.0, 7.0, 8.0) ________________________________ Fra: Tinycc-devel [tinycc-devel-bounces+grue=3Ddi.ku.dk@nongnu.org] p=E5 ve= gne af avih via Tinycc-devel [tinycc-devel@nongnu.org] Sendt: 3. august 2019 10:31 Til: tinycc-devel@nongnu.org Cc: avih Emne: Re: [Tinycc-devel] Duplicate double You're right, and I can confirm that the win64 version downloaded the same as you exhibits the same issue, and the issue also exists if I build 0.27 for win64 myself (git d348a9a). However, it was apparently fixed shortly after tcc 0.27 was released, at the following commit: commit 8f6fcb709ae7b2379866c292ce478ab95dc75b48 Author: grischka Date: Thu May 31 23:51:51 2018 +0200 misc fixes misc fixes including: - tcc.c: fix "tcc -vv" for libtcc1.a on win32/PE - tccelf.c: fix a crash when GOT has no relocs (witn -nostdlib) - tccelf.c: fix stab linkage for zero n_strx - tccgen.c: fix stdcall decoration for array parameters int __stdcall func(char buf[10]) is _func@4 (was _func@12) - tccgen.c: fix static variables with nocode/nodata_wanted see tests2/96_nodata_wanted.c - tccrun.c: align sections using sh_addralign (for reliable function_alignm= ent) - tests2/Makefile sort 100 after 99 - win32/include/sys/stat.h fix _stat and _wstat - x86_64-gen.c: win64/gfunc_call: fix a bug with xmmN register args previously overwrote valid other xmmN registers eventually Not sure which of the fixes did it, but I'd guess it's at x86_64-gen.c . If you want, I've built tcc for win32 and win64 from the latest git version (mob, 9e429db), and uploaded it here: https://0x0.st/zOsg.7z Cheers, Avi On Friday, August 2, 2019, 9:51:22 PM GMT+3, Klaus Ebbe Grue wrote: Hi tinycc-devel, Under MSYS2/MinGW I have a problem with tcc. I define this functions: void f(double x,double y,double z){printf("f(%4.1f,%4.1f,%4.1f)\n",x,y,z);} As an example, f(1,2,3) prints f( 1.0, 2.0, 3.0). Then I call f from main in a slightly confusing way: int main(int argc,char **argv){double u=3D0.0;f(u*1.0,7.0,8.0);return 0;} I would expect to get f( 0.0, 7.0, 8.0) but I do get f( 7.0, 7.0, 8.0). The first argument of f becomes a duplicate of the second argument of f. If I remove "*1.0" then everything works as expected. Is this a known bug? By the way, if I make the same program using integers, then there is no pro= blem. I have included a reproduction scenario below. Cheers, Klaus --- Install MSYS2/MinGW Start MSYS2 shell > mkdir experiment > cd experiment > wget http://download.savannah.gnu.org/releases/tinycc/tcc-0.9.27-win64-bi= n.zip > pacman -S unzip > unzip tcc-0.9.27-win64-bin.zip > tcc/tcc -v tcc version 0.9.27 (x86_64 Windows) > cat>test.c #include void f(double x,double y,double z){printf("f(%4.1f,%4.1f,%4.1f)\n",x,y,z);} int main(int argc,char **argv){double u=3D0.0;f(u*1.0,7.0,8.0);return 0;} > tcc/tcc -o test test.c > ./test f( 7.0, 7.0, 8.0) _______________________________________________ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel _______________________________________________ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel --_000_B6DE68AC3CC96743A7E10D152B184D4701370DB4E0P1KITMBX03WC0_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi Christian,

Perfect! Thanks a lot.

Cheers,
Klaus
Fra: Tinycc-devel [tinycc-devel-bounces&#= 43;grue=3Ddi.ku.dk@nongnu.org] p=E5 vegne af Christian JULLIEN [eligis@oran= ge.fr]
Sendt: 4. august 2019 13:32
Til: tinycc-devel@nongnu.org
Emne: Re: [Tinycc-devel] *** SPAM *** Re: Duplicate double

Hello Klaus,

I don't know how Avi builds tcc on Windows but, on my side, I have mad= e this companion repository that works well with Cygwin:

https://sourceforge.net/projects/wintcc/

Basically, get the cygwin/Makefile you have to drop in tcc/win32, and = just run "make" (files in includes are already integrated in tcc = and you don't need them)
It builds a native tcc 32/64 compiler built with tcc bootstrapped with= gcc (i.e. a reproductible build).
A Makefile named "tarball" produces a standalone .zip you ca= n use on any Windows machine.
tcc compiled binary does not need cygwin runtime to be present.

I don't understand quite well why Grischka refused to add it on offici= al tcc distrib.

C.


Le : 04 ao=FBt 2019 =E0 13:08 (GMT +02:00)
De : "Klaus Ebbe Grue" <grue@di.ku.dk>
=C0 : = "tinycc-devel@nongnu.org" <tinycc-devel@nongnu.org>
Objet : *** SPAM *** Re: [Tinycc-devel] Duplicate double


Hi again Avi,

 

Can I persuade you to tell how you built https://0x0.st/zOsg.7z ?

 

In particular, how you made the lib and includes relative to the locatio= n of 'tcc.exe' for tcc32 and tcc64.

 

Googling around seems to suggest that one should use the right host (Min= GW? Cygwin?) and use the right ./configure options.

 

Cheers,
Klaus

 

 


Fra: Tinycc-dev= el [tinycc-devel-bounces+grue=3Ddi.ku.dk@nongnu.org] p=E5 vegne af Klau= s Ebbe Grue [grue@di.ku.dk]
Sendt: 3. august 2019 16:14
Til: tinycc-devel@nongnu.org
Emne: Re: [Tinycc-devel] Duplicate double

Hi Avi,

 

Great! Thanks!

 

https://0x0.st/zOsg.7z worked.

 

Just to test, I made a fresh msys2 install, cloned git://repo.or.cz/tiny= cc.git and compiled. That also works.

 

For completeness, I have included the steps. The only surprise was that = when using .configure --prefix=3D/usr I had to add --bindir=3D/usr/bin sinc= e otherwise tcc ends up in /usr/tcc.exe

 

Cheers,

Klaus

 

---

 

Remove C:\msys64 if present

Go to https://www.msys2.org/
Click msys2-x86_64-20190524.exe
Install msys2 using defaults

 

In MSYS2 shell:
> pacman -Syu
As instructed, kill and restart MSYS2 shell
> pacman -Syu
> pacman -S gcc git make texinfo
> git clone git://repo.or.cz/tinycc.git
> cd tinycc
> ./configure --prefix=3D/usr --bindir=3D/usr/bin
> make
> make install
> cd
> tcc -v
tcc version 0.9.27 (x86_64 Windows)
> mkdir experiment
> cd experiment
> cat>test.c
#include <stdio.h>
void f(double x,double y,double z){printf("f(%4.1f,%4.1f,%4.1f)\n"= ;,x,y,z);}
int main(int argc,char **argv){double u=3D0.0;f(u*1.0,7.0,8.0);return 0;} > tcc -o test test.c
> ./test
f( 0.0, 7.0, 8.0)

 

 


Fra: Tinycc-dev= el [tinycc-devel-bounces+grue=3Ddi.ku.dk@nongnu.org] p=E5 vegne af avih= via Tinycc-devel [tinycc-devel@nongnu.org]
Sendt: 3. august 2019 10:31
Til: tinycc-devel@nongnu.org
Cc: avih
Emne: Re: [Tinycc-devel] Duplicate double

You're right, and I can confirm that the win64 version downloaded the<= br> same as you exhibits the same issue, and the issue also exists if
I build 0.27 for win64 myself (git d348a9a).

However, it was apparently fixed shortly after tcc 0.27 was released,
at the following commit:

commit 8f6fcb709ae7b2379866c292ce478ab95dc75b48
Author: grischka <grischka>
Date: Thu May 31 23:51:51 2018 +0200

misc fixes

misc fixes including:
- tcc.c: fix "tcc -vv" for libtcc1.a on win32/PE
- tccelf.c: fix a crash when GOT has no relocs (witn -nostdlib)
- tccelf.c: fix stab linkage for zero n_strx
- tccgen.c: fix stdcall decoration for array parameters
int __stdcall func(char buf[10]) is _func@4 (was _func@12)
- tccgen.c: fix static variables with nocode/nodata_wanted
see tests2/96_nodata_wanted.c
- tccrun.c: align sections using sh_addralign (for reliable function_alignm= ent)
- tests2/Makefile sort 100 after 99
- win32/include/sys/stat.h fix _stat and _wstat
- x86_64-gen.c: win64/gfunc_call: fix a bug with xmmN register args
previously overwrote valid other xmmN registers eventually


Not sure which of the fixes did it, but I'd guess it's at x86_64-gen.c .
If you want, I've built tcc for win32 and win64 from the latest git
version (mob, 9e429db), and uploaded it here: https://0x0.st/zOsg.7z

Cheers,
Avi



On Friday, August 2, 2019, 9:51:22 PM GMT+3, Klaus Ebbe Grue <g= rue@di.ku.dk> wrote:


Hi tinycc-devel,

Under MSYS2/MinGW I have a problem with tcc.

I define this functions:

void f(double x,double y,double z){printf("f(%4.1f,%4= .1f,%4.1f)\n",x,y,z);}

As an example, f(1,2,3) prints f( 1.0, 2.0, 3.0).

Then I call f from main in a slightly confusing way:

int main(int argc,char **argv){double u=3D0.0;f(u*1.0,7.0,= 8.0);return 0;}

I would expect to get f( 0.0, 7.0, 8.0) but I do get f( 7.= 0, 7.0, 8.0).

The first argument of f becomes a duplicate of the second = argument of f.

If I remove "*1.0" then everything works as expe= cted.

Is this a known bug?

By the way, if I make the same program using integers, the= n there is no problem.

I have included a reproduction scenario below.

Cheers,
Klaus

---

Install MSYS2/MinGW
Start MSYS2 shell

> mkdir experiment
> cd experiment
> pacman -S unzip
> unzip tcc-0.9.27-win64-bin.zip
> tcc/tcc -v
tcc version 0.9.27 (x86_64 Windows)
> cat>test.c
#include <stdio.h>
void f(double x,double y,double z){printf("f(%4.1f,%4= .1f,%4.1f)\n",x,y,z);}
int main(int argc,char **argv){double u=3D0.0;f(u*1.0,7.0,= 8.0);return 0;}
> tcc/tcc -o test test.c
> ./test
f( 7.0, 7.0, 8.0)
_______________________________________________
Tinycc-devel mailing list



_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel
--_000_B6DE68AC3CC96743A7E10D152B184D4701370DB4E0P1KITMBX03WC0_-- From MAILER-DAEMON Sun Aug 04 08:52:48 2019 Received: from list by lists.gnu.org with archive (Exim 4.86_2) id 1huG0G-0007wa-Rq for mharc-tinycc-devel@gnu.org; Sun, 04 Aug 2019 08:52:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45854) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1huG0B-0007v9-1J for tinycc-devel@nongnu.org; Sun, 04 Aug 2019 08:52:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1huG08-0001PU-Qu for tinycc-devel@nongnu.org; Sun, 04 Aug 2019 08:52:42 -0400 Received: from sonic306-1.consmr.mail.bf2.yahoo.com ([74.6.132.40]:33624) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1huG08-0001Kj-Ky for tinycc-devel@nongnu.org; Sun, 04 Aug 2019 08:52:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1564923158; bh=mDPWziICRbiTtCwI1yjKpCAgcWmR7vWG8sZ+iBoAX78=; h=Date:From:To:In-Reply-To:References:Subject:From:Subject; b=XcPQhAp22U6lhGaFeAlegAsOyYcDDqC0h/rwp6cosfDTj41MH+5iCTy1UHTXiGG4gIKgHg4onrUZYnarjftue5Cw+qcIpgBkbv4K1IpxvhRRRbRH+IftzqTILUc1/npCNZN02vRULI2lfVzM4zRDSBXlcbi/i3EA7HdcZ4nJyjmmxl9gq4TT9ut1OQjmFBXqbgOE1+yC85mk52KkVlRedR3zPdyLGNnqSnzoVm1AziBgg32VMO6/teqm1HE2ZFIJVTQSDs+Ps8KJhQTZ81muQOJ8fFr5+4aehuIRbK30s5OwwkSZqJ/MXWR5izQ27U4rX5yKtOeQpANnzxSZbJQg7g== X-YMail-OSG: zVTp9jcVM1npoKgWuLjMK2WMTIUayph0fdnD.dTuCrFcPf2vbZXuYhJ2VXjW3d8 ZulTT7u0Um_oNLvENaA2ErV4jqKK7UmWNi8TiYT7_D5gtYhSHKnu9w8tolSMZwqRQDEQFfmMNQdj 3RopWkCOEfCW88VkVK23QCSP7uXYcwM393rERhWlPAQTie7.MEJZzSUXr115zsIYW71yJTO4mcV4 Dlg8VVm1v76Wktb.lZm0ExSU6o7Kp5jofMhbwmpi2FDYJMxd3asMvWBHAg3VAV0n.xM77t.4stXk qRyFZTIwS17WrhH1nzK.x96VA49Lez1aQFpW_xUQ_TaM6pjS8.iNJkW.buFMJ6yQ4MUDidYPp_qn Lsx.9H4M_rufhdOV0jCNG5lMTqjAUbQXTrdIGSm4cb2MySNzoz21o319D0b5vRdWohiarfOJGDAP 8yuHeSIWgKopm2gwgTTkq5.Upf52pyIxn1Q.WzirW3lYH.ChutYFU9q84ST8_C3zmWqP1X5lVC8P _d6UIpgXZ0VxnUcS9q.DSeuzkc2it49cTsl3sqNfsuQkuPHrke61MfXrCExut20qZVXgTX8i0v8W 8r_XY88gFvlg.UDQw94vonSv69DA_lB5gTOoibaS8EEHcbMjj9p122ikbLiEhEzRMVm4kV_9i8Iy nduJ22AnRQIwYwR1E3jYQnVyVuoEaQ7BJsCy9HEcp32M7jr2QRInG8OdffnomitNmYsRPrE2yqVD k10HK2U7UP0qbFsLGxtqJ8jhbJcyXW8.86FN5xVnG8NFIdotHe73zWoiGwWiC0na4yJ3snqI3fAJ LpRu5Q9oz8CjmTooNpezkCPPo_Dczw.wKeykClMMkCnHSyjGOj3ZQMbH4I4jNJbAIXNJf.Xh_3fb WoquvcNhzLRFVPlYUB0pFwTU1yZO38y4SxHION.sR8S1HSv5XBHift74v0FO5XYyRvHA22dFdjIA xx_3tP5VstdC5F3SYCYE.u82_ogD1mJTc5pQtsokbahc44UJA7X4tSnhMkiVpE7svbuSHV6wuTCZ u83hhzGWEq7emPMvSHGSMzrqdM7TIxTbKGWfgQ.1ClMSFq8mzwMM9Ak4Qqdjs9n07MTQPO8_.3Ly oQ79VwMfSlaPKdgOGnOANb1eGXDT418fH9Hy4FFQU..AQYPEc4fke9Rp3JX6QCsN3N.vISMfGl3z SkX0_NovXKa2IMn4HoDjutXFjwAKT8w2jKYQCBpH5vl5o1pi6_DZKmmncGbCZ.gkMTYZajf6lzMS CoVsqddpiMM9lyaZxV8pek3tPrn.M4BdgWwwLcw-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.bf2.yahoo.com with HTTP; Sun, 4 Aug 2019 12:52:38 +0000 Date: Sun, 4 Aug 2019 12:52:38 +0000 (UTC) From: avih To: tinycc-devel@nongnu.org Message-ID: <1525241407.852156.1564923158088@mail.yahoo.com> In-Reply-To: References: <127088284.657651.1564821103112@mail.yahoo.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_852155_427548162.1564923158085" Content-Length: 20693 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 74.6.132.40 Subject: Re: [Tinycc-devel] Duplicate double X-BeenThere: tinycc-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Aug 2019 12:52:46 -0000 ------=_Part_852155_427548162.1564923158085 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, The simple answer, with MSYS2, to build tcc win64: - Start MSYS2 shortcut "mingw64", ensure you have mingw gcc x86-64 installe= d. - Clone tinycc and cd to the root source dir. - Run `mkdir build64 && cd build64 && ../configure --cpu=3Dx86-64 --prefix= =3D$(pwd)/dist && make && make install` - Now the `./dist/` dir will have a working portable tcc win64 package/file= s. To build tcc win32, use the same steps but instead start the "mingw32" MSYS= 2 shortcut, ensure you have mingw gcc i686 installed, and use --cpu=3Di386 (a= nd optionally different build/install dirs). The resulting tcc will use relative lib/include files. However, like Christian, I also use a reproducible build script which I wro= te. It can use any compiler (gcc/clang/tcc/etc) on most systems (cygwin, linux, macOS, freeBSD, etc) to create a reproducible windows tcc compilers with identical binaries regardless of the system on which it was created. Like Christian's script, it first builds (possibly) cross compilers tcc for windows (which target win32 and win64), then uses them to build 32 and 64 t= cc as well as 2 cross compilers (win64 tcc which targets win32, and win32 tcc which targets win64). Overall 4 distributions. The dirs I put at the 7z file are the plain 32/64 builds of tcc (not cross)= . To use it: - Get this file: https://github.com/avih/tinycc/blob/mob-win32-repro/win32/= build-tcc-reproducible.sh - Place it at the /win32/ dir and cd into that dir. - Run `rm -rf ./reprobuild; ./build-tcc-reproducible.sh` - Too see more options, run it with `-h` Cheers, Avi On Sunday, August 4, 2019, 2:08:17 PM GMT+3, Klaus Ebbe Grue wrote: =20 =20 #yiv3347465128 P {MARGIN-BOTTOM:0px;MARGIN-TOP:0px;}#yiv3347465128 P {MARG= IN-BOTTOM:0px;MARGIN-TOP:0px;} Hi again Avi, =C2=A0 Can I persuade you to tell how you built https://0x0.st/zOsg.7z ? =C2=A0 In particular, how you made the lib and includes relative to the location o= f 'tcc.exe' for tcc32 and tcc64. =C2=A0 Googling around seems to suggest that one should use the right host (MinGW?= Cygwin?) and use the right ./configure options. =C2=A0 Cheers, Klaus =C2=A0 =C2=A0 Fra: Tinycc-devel [tinycc-devel-bounces+grue=3Ddi.ku.dk@nongnu.org] p=C3=A5= vegne af Klaus Ebbe Grue [grue@di.ku.dk] Sendt: 3. august 2019 16:14 Til: tinycc-devel@nongnu.org Emne: Re: [Tinycc-devel] Duplicate double Hi Avi, =C2=A0 Great! Thanks! =C2=A0 https://0x0.st/zOsg.7z worked. =C2=A0 Just to test, I made a fresh msys2 install, cloned git://repo.or.cz/tinycc.= git and compiled. That also works. =C2=A0 For completeness, I have included the steps. The only surprise was that whe= n using .configure --prefix=3D/usr=C2=A0I had to add --bindir=3D/usr/bin si= nce otherwise tcc ends up in /usr/tcc.exe =C2=A0 Cheers, Klaus =C2=A0 --- =C2=A0 Remove C:\msys64 if present Go to https://www.msys2.org/ Click msys2-x86_64-20190524.exe Install msys2 using defaults =C2=A0 In MSYS2 shell: > pacman -Syu As instructed, kill and restart MSYS2 shell > pacman -Syu > pacman -S gcc git make texinfo > git clone git://repo.or.cz/tinycc.git > cd tinycc > ./configure --prefix=3D/usr --bindir=3D/usr/bin > make > make install > cd > tcc -v tcc version 0.9.27 (x86_64 Windows) > mkdir experiment > cd experiment > cat>test.c #include void f(double x,double y,double z){printf("f(%4.1f,%4.1f,%4.1f)\n",x,y,z);} int main(int argc,char **argv){double u=3D0.0;f(u*1.0,7.0,8.0);return 0;} > tcc -o test test.c > ./test f( 0.0, 7.0, 8.0) =C2=A0 =C2=A0 Fra: Tinycc-devel [tinycc-devel-bounces+grue=3Ddi.ku.dk@nongnu.org] p=C3=A5= vegne af avih via Tinycc-devel [tinycc-devel@nongnu.org] Sendt: 3. august 2019 10:31 Til: tinycc-devel@nongnu.org Cc: avih Emne: Re: [Tinycc-devel] Duplicate double You're right, and I can confirm that the win64 version downloaded the same as you exhibits the same issue, and the issue also exists if I build 0.27 for win64 myself (git d348a9a). However, it was apparently fixed shortly after tcc 0.27 was released, at the following commit: commit 8f6fcb709ae7b2379866c292ce478ab95dc75b48 Author: grischka Date: Thu May 31 23:51:51 2018 +0200 misc fixes misc fixes including: - tcc.c: fix "tcc -vv" for libtcc1.a on win32/PE - tccelf.c: fix a crash when GOT has no relocs (witn -nostdlib) - tccelf.c: fix stab linkage for zero n_strx - tccgen.c: fix stdcall decoration for array parameters int __stdcall func(char buf[10]) is _func@4 (was _func@12) - tccgen.c: fix static variables with nocode/nodata_wanted see tests2/96_nodata_wanted.c - tccrun.c: align sections using sh_addralign (for reliable function_alignm= ent) - tests2/Makefile sort 100 after 99 - win32/include/sys/stat.h fix _stat and _wstat - x86_64-gen.c: win64/gfunc_call: fix a bug with xmmN register args previously overwrote valid other xmmN registers eventually Not sure which of the fixes did it, but I'd guess it's at x86_64-gen.c . If you want, I've built tcc for win32 and win64 from the latest git version (mob, 9e429db), and uploaded it here: https://0x0.st/zOsg.7z Cheers, Avi On Friday, August 2, 2019, 9:51:22 PM GMT+3, Klaus Ebbe Grue wrote: Hi tinycc-devel, Under MSYS2/MinGW I have a problem with tcc. I define this functions: void f(double x,double y,double z){printf("f(%4.1f,%4.1f,%4.1f)\n",x,y,z);} As an example, f(1,2,3) prints f( 1.0, 2.0, 3.0). Then I call f from main in a slightly confusing way: int main(int argc,char **argv){double u=3D0.0;f(u*1.0,7.0,8.0);return 0;} I would expect to get f( 0.0, 7.0, 8.0) but I do get f( 7.0, 7.0, 8.0). The first argument of f becomes a duplicate of the second argument of f. If I remove "*1.0" then everything works as expected. Is this a known bug? By the way, if I make the same program using integers, then there is no pro= blem. I have included a reproduction scenario below. Cheers, Klaus --- Install MSYS2/MinGW Start MSYS2 shell > mkdir experiment > cd experiment > wget http://download.savannah.gnu.org/releases/tinycc/tcc-0.9.27-win64-bi= n.zip > pacman -S unzip > unzip tcc-0.9.27-win64-bin.zip > tcc/tcc -v tcc version 0.9.27 (x86_64 Windows) > cat>test.c #include void f(double x,double y,double z){printf("f(%4.1f,%4.1f,%4.1f)\n",x,y,z);} int main(int argc,char **argv){double u=3D0.0;f(u*1.0,7.0,8.0);return 0;} > tcc/tcc -o test test.c > ./test f( 7.0, 7.0, 8.0) _______________________________________________ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel _______________________________________________ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel =20 ------=_Part_852155_427548162.1564923158085 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,

The simple answer, with MSYS2, to build tcc= win64:
- Start MSYS2 shortcut "mingw64", ensure you have ming= w gcc x86-64 installed.
- Clone tinycc and cd to the root source dir.- Run `mkdir build64 && cd build64 && ../configure --cpu= =3Dx86-64 --prefix=3D$(pwd)/dist && make && make install`- Now the `./dist/` dir will have a working portable tcc win64 package/fi= les.

To build tcc win32, use the same steps but instead start the &q= uot;mingw32" MSYS2
shortcut, ensure you have mingw gcc i686 install= ed, and use --cpu=3Di386 (and
optionally different build/install dirs).<= br>
The resulting tcc will use relative lib/include files.

Howeve= r, like Christian, I also use a reproducible build script which I wrote.It can use any compiler (gcc/clang/tcc/etc) on most systems (cygwin, linux= ,
macOS, freeBSD, etc) to create a reproducible windows tcc compilers wi= th
identical binaries regardless of the system on which it was created.<= br>
Like Christian's script, it first builds (possibly) cross compil= ers tcc for
windows (which target win32 and win64), then uses them to bu= ild 32 and 64 tcc
as well as 2 cross compilers (win64 tcc which targets = win32, and win32 tcc
which targets win64). Overall 4 distributions.
<= br>The dirs I put at the 7z file are the plain 32/64 builds of tcc (not cro= ss).

To use it:
- Get this file: https://github.com/avih/tinycc/b= lob/mob-win32-repro/win32/build-tcc-reproducible.sh
- Place it at the &l= t;tcc-source>/win32/ dir and cd into that dir.
- Run `rm -rf ./reprob= uild; ./build-tcc-reproducible.sh`
- Too see more options, run it with `= -h`


Cheers,
Avi

On Sunday, Aug= ust 4, 2019, 2:08:17 PM GMT+3, Klaus Ebbe Grue <grue@di.ku.dk> wrote:=

<= br>

Hi again Avi,

 

Can I = persuade you to tell how you built https://0x0.st/zOsg.7z ?

 

In particular, how you made the lib and includes relative= to the location of 'tcc.exe' for tcc32 and tcc64.

 

Googl= ing around seems to suggest that one should use the right host (MinGW? Cygw= in?) and use the right ./configure options.

 

Cheers,
Klaus

 

 


Fra: Tinycc-devel [tinycc-d= evel-bounces+grue=3Ddi.ku.dk@nongnu.org] p=C3=A5 vegne af Klaus Ebbe Grue [= grue@di.ku.dk]
Sendt: 3. august 2019 16:14
Til: tinycc-devel@nongnu.org
Emne: Re: [Tinycc-devel] Duplicate double

Hi Avi,

 

Great! Tha= nks!

 

https://0x0.st/zOsg.7z worked.

=  

Just to test, I made a fresh msys2 install, cloned git://repo.= or.cz/tinycc.git and compiled. That also works.

 

For comp= leteness, I have included the steps. The only surprise was that when using = .configure --prefix=3D/usr I had to add --bindir=3D/usr/bin since othe= rwise tcc ends up in /usr/tcc.exe

 

Cheers,

Klaus

 

---

 

Remove C:\msys64 if present

G= o to https://www.msys2.org/
Click msys2-x86= _64-20190524.exe
Install msys2 using defaults

 = ;

In MSYS2 shell:
> p= acman -Syu
As instructed, kill and restart MSYS2 s= hell
> pacman -Syu
> pacman -S gcc git make texinfo
> git cl= one git://repo.or.cz/tinycc.git
> cd tinycc
> ./configure --prefix=3D/usr --bindir=3D/usr/bin
> make
> make install
> = cd
> tcc -v
tcc version 0.9.27 (x86_= 64 Windows)
> mkdir experiment
> = cd experiment
> cat>test.c
#inclu= de <stdio.h>
void f(double x,double y,double z){pri= ntf("f(%4.1f,%4.1f,%4.1f)\n",x,y,z);}
int main(int argc,c= har **argv){double u=3D0.0;f(u*1.0,7.0,8.0);return 0;}
&g= t; tcc -o test test.c
> ./test
f( 0.= 0, 7.0, 8.0)

 

 


<= font color=3D"#000000" size=3D"2" face=3D"Tahoma">Fra: Tinycc-devel = [tinycc-devel-bounces+grue=3Ddi.ku.dk@nongnu.org] p=C3=A5 vegne af avih via= Tinycc-devel [tinycc-devel@nongnu.org]
Sendt: 3. = august 2019 10:31
Til: tinycc-devel@nongnu.org
Cc: avih
Emne: Re: [Tinycc-d= evel] Duplicate double

You're right, and I can confirm that the win64 version d= ownloaded the
same as you exhibits the same issue, and th= e issue also exists if
I build 0.27 for win64 myself (git= d348a9a).

However, it was apparently = fixed shortly after tcc 0.27 was released,
at the followi= ng commit:

commit 8f6fcb709ae7b2379866= c292ce478ab95dc75b48
Author: grischka <grischka>Date: Thu May 31 23:51:51 2018 +0200

misc fixes

misc fixes i= ncluding:
- tcc.c: fix "tcc -vv" for libtcc1.a on win32/P= E
- tccelf.c: fix a crash when GOT has no relocs (witn -n= ostdlib)
- tccelf.c: fix stab linkage for zero n_strx
- tccgen.c: fix stdcall decoration for array parameters
int __stdcall func(char buf[10]) is _func@4 (was _func@12)- tccgen.c: fix static variables with nocode/nodata_wanted<= br clear=3D"none">see tests2/96_nodata_wanted.c
- tccrun.= c: align sections using sh_addralign (for reliable function_alignment)
- tests2/Makefile sort 100 after 99
- win32= /include/sys/stat.h fix _stat and _wstat
- x86_64-gen.c: = win64/gfunc_call: fix a bug with xmmN register args
previ= ously overwrote valid other xmmN registers eventually

Not sure which of the fixes did it, but = I'd guess it's at x86_64-gen.c .

If yo= u want, I've built tcc for win32 and win64 from the latest git
version (mob, 9e429db), and uploaded it here: https://0x0.st/zOsg.7z<= br clear=3D"none">
Cheers,
Avi



<= div>On Friday, August 2, 2019, 9:51:22 PM GMT+3, Klaus Ebbe Grue <grue@d= i.ku.dk> wrote:


Hi tinycc-devel,

Under MSYS2/MinGW I= have a problem with tcc.

I define this functions:

void f(d= ouble x,double y,double z){printf("f(%4.1f,%4.1f,%4.1f)\n",x,y,z);}

As an example, f(1,2,3) prints f( 1.0, 2.0, 3.0).
=

Then I call f fr= om main in a slightly confusing way:

int main(int argc,char **argv)= {double u=3D0.0;f(u*1.0,7.0,8.0);return 0;}

I would expect to get f= ( 0.0, 7.0, 8.0) but I do get f( 7.0, 7.0, 8.0).

The first argument= of f becomes a duplicate of the second argument of f.

If I remove = "*1.0" then everything works as expected.

Is this a known bug?

By the way, if I make the same program using integers, then there is n= o problem.

I have included a reproduction scenario below.

= Cheers,
Klaus

---

= Install MSYS2/MinGW
Start MSYS2 sh= ell

> mkdir experiment
= > cd experiment
> pacman -S unzip
> unzip tcc-0.9.27-win64-bin.zip
> tcc/tcc -v
tcc = version 0.9.27 (x86_64 Windows)
&g= t; cat>test.c
#include <stdi= o.h>
void f(double x,double y,d= ouble z){printf("f(%4.1f,%4.1f,%4.1f)\n",x,y,z);}
<= div dir=3D"ltr">int main(int argc,char **argv){double u=3D0.0;f(u*1.0,7.0,8= .0);return 0;}
> tcc/tcc -o tes= t test.c
> ./test
f( 7.0, 7.0, 8.0)
_______________________________________________
Tinycc-devel mailing list
https://lists.nongnu.org/mailman/li= stinfo/tinycc-devel
_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
htt= ps://lists.nongnu.org/mailman/listinfo/tinycc-devel
<= /div>
------=_Part_852155_427548162.1564923158085-- From MAILER-DAEMON Sun Aug 04 09:20:22 2019 Received: from list by lists.gnu.org with archive (Exim 4.86_2) id 1huGQv-0004wF-Vv for mharc-tinycc-devel@gnu.org; Sun, 04 Aug 2019 09:20:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48680) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1huGQs-0004w4-LH for tinycc-devel@nongnu.org; Sun, 04 Aug 2019 09:20:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1huGQq-0000oh-9B for tinycc-devel@nongnu.org; Sun, 04 Aug 2019 09:20:18 -0400 Received: from mail-eopbgr20098.outbound.protection.outlook.com ([40.107.2.98]:60999 helo=EUR02-VE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1huGQp-0000my-Dj for tinycc-devel@nongnu.org; Sun, 04 Aug 2019 09:20:16 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A5fBMhl7G91ZmS45xWz+pE6ZZcn63IMx+eRdfr755iX587htZna9pnJVJjEfKQ8yqZQZ2ukj03pNBvpxfhirgnN9mlowN/ayewMTw1zFl4jftWNTp8UZfpWldNFd99mgo+fU1SeLP2IOeAk/U5tsXV7HPyUplxOsOve/WZLEzoGYak6EaOWesbQhBWm3o0++WCifsRtoVODEkxpgjM+dCA+qb0Gzv7xb+5KSBOwlW2OCicmtJua3WhVnUn9VhLg1wofpVglHOSTBkHrpzM8ZTXUe0VX8JnvoGaPa7O7ix9BdmNJH8XnQKSGVm2lFco6z8K3EGy4wglnI4V2WEboe0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=R+0e7rWvxLivhIKOx4YLPtoJst2XR/1LhDPXrgUHSMQ=; b=bqFts+KC54hU6DmrlzL+tQxlrtJvp9DaMDV0ea1FckZof5dKQKALbIM9K3W5YmvDmtNVcma1F1HLADN/dXR5m7E4rCDmFE8Vh9ONm6NAK9B5upmP1PjDtfH/HxFR7B9YgUUkh8sibXgv62qwSBzg3EDtYHJV16IaB0jnLhP/RyxwKMka3EEfsTaRSYaSvOX3Tq/PDPsg2J7Br4YdiGOxiuJ5wDTnYq0tZkaGhWCZAwmE29bSTrdj0i8oBTbpRLvdZ3vOPO1qoOxiACiZNHHVm1V/N8drbrRLylARFNm77Nb0Me1eqnv+hdwASuxD0+k9+8gXlm/Hg+PkKiI/B9OkoA== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=pass (sender ip is 192.38.124.76) smtp.rcpttodomain=nongnu.org smtp.mailfrom=di.ku.dk;dmarc=bestguesspass action=none header.from=di.ku.dk;dkim=none (message not signed);arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alumni.onmicrosoft.com; s=selector2-alumni-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=R+0e7rWvxLivhIKOx4YLPtoJst2XR/1LhDPXrgUHSMQ=; b=byk1qaQxPFICQTG2Yd8Rt8OpHErAfXxBxWtw52E4Uf3xYgQnMJ5cZ/ApgrXRVDKdhVhwCs7uloxLTmoqHI+IvhgSsN19dz0p1BFxueWp+IKSnVMrHh9LnKAebnsIWrXndgwYlxdok5CtC+zmbtPgI2WfmeUxoBOlWWlCKS/wP6c= Received: from AM7PR04CA0010.eurprd04.prod.outlook.com (2603:10a6:20b:110::20) by AM5PR04MB3283.eurprd04.prod.outlook.com (2603:10a6:206:d::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2136.17; Sun, 4 Aug 2019 13:20:12 +0000 Received: from HE1EUR02FT010.eop-EUR02.prod.protection.outlook.com (2a01:111:f400:7e05::207) by AM7PR04CA0010.outlook.office365.com (2603:10a6:20b:110::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2136.17 via Frontend Transport; Sun, 4 Aug 2019 13:20:12 +0000 Authentication-Results: spf=pass (sender IP is 192.38.124.76) smtp.mailfrom=di.ku.dk; nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=bestguesspass action=none header.from=di.ku.dk; Received-SPF: Pass (protection.outlook.com: domain of di.ku.dk designates 192.38.124.76 as permitted sender) receiver=protection.outlook.com; client-ip=192.38.124.76; helo=sepo3.ku.dk; Received: from sepo3.ku.dk (192.38.124.76) by HE1EUR02FT010.mail.protection.outlook.com (10.152.10.249) with Microsoft SMTP Server id 15.20.2136.14 via Frontend Transport; Sun, 4 Aug 2019 13:20:11 +0000 Received: from 10.78.0.165 ([10.78.0.165]) by sepo3.ku.dk (JAMES SMTP Server 2.3.2-1) with SMTP ID 620; Sun, 4 Aug 2019 15:20:08 +0200 (CEST) Received: from P1KITMBX03WC02.unicph.domain ([fe80::4e4:28c5:cdcb:3fb2]) by P2KITHUB04W.unicph.domain ([::1]) with mapi id 14.03.0468.000; Sun, 4 Aug 2019 15:20:07 +0200 From: Klaus Ebbe Grue To: "tinycc-devel@nongnu.org" Thread-Topic: [Tinycc-devel] Duplicate double Thread-Index: AdVJXiEqHF+vTvVOR4WNfZ4eTOWQSAAZvxaAAA5zVCUALJBGwgAAY8gAAAUdroo= Date: Sun, 4 Aug 2019 13:20:07 +0000 Message-ID: References: <127088284.657651.1564821103112@mail.yahoo.com> , <1525241407.852156.1564923158088@mail.yahoo.com> In-Reply-To: <1525241407.852156.1564923158088@mail.yahoo.com> Accept-Language: da-DK, en-US Content-Language: da-DK X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.77.128.234] Content-Type: multipart/alternative; boundary="_000_B6DE68AC3CC96743A7E10D152B184D4701370DB504P1KITMBX03WC0_" MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.38.124.76; IPV:NLI; CTRY:DK; EFV:NLI; SFV:NSPM; SFS:(10019020)(4636009)(39860400002)(346002)(376002)(136003)(396003)(2980300002)(189003)(199004)(5660300002)(53936002)(54896002)(6306002)(70586007)(9686003)(86362001)(55016002)(70206006)(69596002)(8936002)(236005)(81166006)(5640700003)(30864003)(26005)(81156014)(8676002)(16586007)(6116002)(3846002)(68736007)(2501003)(786003)(6916009)(33656002)(2906002)(40036005)(316002)(106002)(37786003)(966005)(11346002)(446003)(356004)(606006)(2351001)(71190400001)(478600001)(14444005)(476003)(126002)(102836004)(186003)(486006)(7696005)(76176011)(7736002)(336012)(4326008)(55846006)(19623455009)(460985005)(2480315003)(19477635001); DIR:OUT; SFP:1102; SCL:1; SRVR:AM5PR04MB3283; H:sepo3.ku.dk; FPR:; SPF:Pass; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6b4517b6-f073-4c24-204a-08d718de7a93 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(4709080)(1401327)(2017052603328)(7193020); SRVR:AM5PR04MB3283; X-MS-TrafficTypeDiagnostic: AM5PR04MB3283: X-MS-Exchange-PUrlCount: 5 X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5236; X-Forefront-PRVS: 0119DC3B5E X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: hLz+HUR3sDmEFRItowgjoxHD4oIIkKOIHfsyRvCGXRz53aHonze2Kas4xzPRCL+eU1v8MAK/xLJ2Ips6Q2nyPQAuvpo+o8kFinsCof+XFfSvNJTN8XGjZMmtxC3edKdopzCa7d8amsRP5QM+E44hVsKALx0zmJLsIypENtggxU9FHdba8df+2Q8Tr8ef06/xTJ1FjXSk88rDRmLHIotHk7o3a6Iz3xLqZPuUi5yaXCp8MRm5ucAeVek7N8GOZCWwIY7z0ZJB4frcZBG6AXceZNn3SJWnkmCGiHx1TAiDSF3mXilXGd8IUTg5jOXVuWpx8YVuiOXMvsC+tBcNKT1V0A69goMbFBlYl6lyybnthcxd5YamBN5EP+zJEjUdP6toEa8+ADjIxhpCQySZO/MkE6jhiK1f/YqD10rKtENjuso= X-OriginatorOrg: di.ku.dk X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2019 13:20:11.2901 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6b4517b6-f073-4c24-204a-08d718de7a93 X-MS-Exchange-CrossTenant-Id: a3927f91-cda1-4696-af89-8c9f1ceffa91 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=a3927f91-cda1-4696-af89-8c9f1ceffa91; Ip=[192.38.124.76]; Helo=[sepo3.ku.dk] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR04MB3283 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.2.98 Subject: Re: [Tinycc-devel] Duplicate double X-BeenThere: tinycc-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Aug 2019 13:20:21 -0000 --_000_B6DE68AC3CC96743A7E10D152B184D4701370DB504P1KITMBX03WC0_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi Avi, Once again: Thanks a lot. Cheers, Klaus ________________________________ Fra: Tinycc-devel [tinycc-devel-bounces+grue=3Ddi.ku.dk@nongnu.org] p=E5 ve= gne af avih via Tinycc-devel [tinycc-devel@nongnu.org] Sendt: 4. august 2019 14:52 Til: tinycc-devel@nongnu.org Cc: avih Emne: Re: [Tinycc-devel] Duplicate double Hi, The simple answer, with MSYS2, to build tcc win64: - Start MSYS2 shortcut "mingw64", ensure you have mingw gcc x86-64 installe= d. - Clone tinycc and cd to the root source dir. - Run `mkdir build64 && cd build64 && ../configure --cpu=3Dx86-64 --prefix= =3D$(pwd)/dist && make && make install` - Now the `./dist/` dir will have a working portable tcc win64 package/file= s. To build tcc win32, use the same steps but instead start the "mingw32" MSYS= 2 shortcut, ensure you have mingw gcc i686 installed, and use --cpu=3Di386 (a= nd optionally different build/install dirs). The resulting tcc will use relative lib/include files. However, like Christian, I also use a reproducible build script which I wro= te. It can use any compiler (gcc/clang/tcc/etc) on most systems (cygwin, linux, macOS, freeBSD, etc) to create a reproducible windows tcc compilers with identical binaries regardless of the system on which it was created. Like Christian's script, it first builds (possibly) cross compilers tcc for windows (which target win32 and win64), then uses them to build 32 and 64 t= cc as well as 2 cross compilers (win64 tcc which targets win32, and win32 tcc which targets win64). Overall 4 distributions. The dirs I put at the 7z file are the plain 32/64 builds of tcc (not cross)= . To use it: - Get this file: https://github.com/avih/tinycc/blob/mob-win32-repro/win32/= build-tcc-reproducible.sh - Place it at the /win32/ dir and cd into that dir. - Run `rm -rf ./reprobuild; ./build-tcc-reproducible.sh` - Too see more options, run it with `-h` Cheers, Avi On Sunday, August 4, 2019, 2:08:17 PM GMT+3, Klaus Ebbe Grue wrote: Hi again Avi, Can I persuade you to tell how you built https://0x0.st/zOsg.7z ? In particular, how you made the lib and includes relative to the location o= f 'tcc.exe' for tcc32 and tcc64. Googling around seems to suggest that one should use the right host (MinGW?= Cygwin?) and use the right ./configure options. Cheers, Klaus ________________________________ Fra: Tinycc-devel [tinycc-devel-bounces+grue=3Ddi.ku.dk@nongnu.org] p=E5 ve= gne af Klaus Ebbe Grue [grue@di.ku.dk] Sendt: 3. august 2019 16:14 Til: tinycc-devel@nongnu.org Emne: Re: [Tinycc-devel] Duplicate double Hi Avi, Great! Thanks! https://0x0.st/zOsg.7z worked. Just to test, I made a fresh msys2 install, cloned git://repo.or.cz/tinycc.= git and compiled. That also works. For completeness, I have included the steps. The only surprise was that whe= n using .configure --prefix=3D/usr I had to add --bindir=3D/usr/bin since o= therwise tcc ends up in /usr/tcc.exe Cheers, Klaus --- Remove C:\msys64 if present Go to https://www.msys2.org/ Click msys2-x86_64-20190524.exe Install msys2 using defaults In MSYS2 shell: > pacman -Syu As instructed, kill and restart MSYS2 shell > pacman -Syu > pacman -S gcc git make texinfo > git clone git://repo.or.cz/tinycc.git > cd tinycc > ./configure --prefix=3D/usr --bindir=3D/usr/bin > make > make install > cd > tcc -v tcc version 0.9.27 (x86_64 Windows) > mkdir experiment > cd experiment > cat>test.c #include void f(double x,double y,double z){printf("f(%4.1f,%4.1f,%4.1f)\n",x,y,z);} int main(int argc,char **argv){double u=3D0.0;f(u*1.0,7.0,8.0);return 0;} > tcc -o test test.c > ./test f( 0.0, 7.0, 8.0) ________________________________ Fra: Tinycc-devel [tinycc-devel-bounces+grue=3Ddi.ku.dk@nongnu.org] p=E5 ve= gne af avih via Tinycc-devel [tinycc-devel@nongnu.org] Sendt: 3. august 2019 10:31 Til: tinycc-devel@nongnu.org Cc: avih Emne: Re: [Tinycc-devel] Duplicate double You're right, and I can confirm that the win64 version downloaded the same as you exhibits the same issue, and the issue also exists if I build 0.27 for win64 myself (git d348a9a). However, it was apparently fixed shortly after tcc 0.27 was released, at the following commit: commit 8f6fcb709ae7b2379866c292ce478ab95dc75b48 Author: grischka Date: Thu May 31 23:51:51 2018 +0200 misc fixes misc fixes including: - tcc.c: fix "tcc -vv" for libtcc1.a on win32/PE - tccelf.c: fix a crash when GOT has no relocs (witn -nostdlib) - tccelf.c: fix stab linkage for zero n_strx - tccgen.c: fix stdcall decoration for array parameters int __stdcall func(char buf[10]) is _func@4 (was _func@12) - tccgen.c: fix static variables with nocode/nodata_wanted see tests2/96_nodata_wanted.c - tccrun.c: align sections using sh_addralign (for reliable function_alignm= ent) - tests2/Makefile sort 100 after 99 - win32/include/sys/stat.h fix _stat and _wstat - x86_64-gen.c: win64/gfunc_call: fix a bug with xmmN register args previously overwrote valid other xmmN registers eventually Not sure which of the fixes did it, but I'd guess it's at x86_64-gen.c . If you want, I've built tcc for win32 and win64 from the latest git version (mob, 9e429db), and uploaded it here: https://0x0.st/zOsg.7z Cheers, Avi On Friday, August 2, 2019, 9:51:22 PM GMT+3, Klaus Ebbe Grue wrote: Hi tinycc-devel, Under MSYS2/MinGW I have a problem with tcc. I define this functions: void f(double x,double y,double z){printf("f(%4.1f,%4.1f,%4.1f)\n",x,y,z);} As an example, f(1,2,3) prints f( 1.0, 2.0, 3.0). Then I call f from main in a slightly confusing way: int main(int argc,char **argv){double u=3D0.0;f(u*1.0,7.0,8.0);return 0;} I would expect to get f( 0.0, 7.0, 8.0) but I do get f( 7.0, 7.0, 8.0). The first argument of f becomes a duplicate of the second argument of f. If I remove "*1.0" then everything works as expected. Is this a known bug? By the way, if I make the same program using integers, then there is no pro= blem. I have included a reproduction scenario below. Cheers, Klaus --- Install MSYS2/MinGW Start MSYS2 shell > mkdir experiment > cd experiment > wget http://download.savannah.gnu.org/releases/tinycc/tcc-0.9.27-win64-bi= n.zip > pacman -S unzip > unzip tcc-0.9.27-win64-bin.zip > tcc/tcc -v tcc version 0.9.27 (x86_64 Windows) > cat>test.c #include void f(double x,double y,double z){printf("f(%4.1f,%4.1f,%4.1f)\n",x,y,z);} int main(int argc,char **argv){double u=3D0.0;f(u*1.0,7.0,8.0);return 0;} > tcc/tcc -o test test.c > ./test f( 7.0, 7.0, 8.0) _______________________________________________ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel _______________________________________________ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel --_000_B6DE68AC3CC96743A7E10D152B184D4701370DB504P1KITMBX03WC0_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi Avi,

Once again: Thanks a lot.

Cheers,
Klaus

Fra: Tinycc-devel [tinycc-devel-bounces&#= 43;grue=3Ddi.ku.dk@nongnu.org] p=E5 vegne af avih via Tinycc-devel [tinycc-= devel@nongnu.org]
Sendt: 4. august 2019 14:52
Til: tinycc-devel@nongnu.org
Cc: avih
Emne: Re: [Tinycc-devel] Duplicate double

Hi,

The simple answer, with MSYS2, to build tcc win64:
- Start MSYS2 shortcut "mingw64", ensure you have mingw gcc x86-6= 4 installed.
- Clone tinycc and cd to the root source dir.
- Run `mkdir build64 && cd build64 && ../configure --cpu=3D= x86-64 --prefix=3D$(pwd)/dist && make && make install`
- Now the `./dist/` dir will have a working portable tcc win64 package/file= s.

To build tcc win32, use the same steps but instead start the "mingw32&= quot; MSYS2
shortcut, ensure you have mingw gcc i686 installed, and use --cpu=3Di386 (a= nd
optionally different build/install dirs).

The resulting tcc will use relative lib/include files.

However, like Christian, I also use a reproducible build script which I wro= te.
It can use any compiler (gcc/clang/tcc/etc) on most systems (cygwin, linux,=
macOS, freeBSD, etc) to create a reproducible windows tcc compilers with identical binaries regardless of the system on which it was created.

Like Christian's script, it first builds (possibly) cross compilers tcc for=
windows (which target win32 and win64), then uses them to build 32 and 64 t= cc
as well as 2 cross compilers (win64 tcc which targets win32, and win32 tcc<= br> which targets win64). Overall 4 distributions.

The dirs I put at the 7z file are the plain 32/64 builds of tcc (not cross)= .

To use it:
- Get this file: https://github.com/avih/tinycc/blob/mob-win32-repro/win32/= build-tcc-reproducible.sh
- Place it at the <tcc-source>/win32/ dir and cd into that dir.
- Run `rm -rf ./reprobuild; ./build-tcc-reproducible.sh`
- Too see more options, run it with `-h`


Cheers,
Avi

On Sunday, August 4, 2019, 2:08:17 PM GMT+3, Klaus Ebbe Grue <g= rue@di.ku.dk> wrote:


Hi again Avi,

 

Can I persuade you to tell how you built https://0x0.st/zOsg.7z ?

 

In particular, how you made the lib and includes relative to the locatio= n of 'tcc.exe' for tcc32 and tcc64.

 

Googling around seems to suggest that one should use the right host (Min= GW? Cygwin?) and use the right ./configure options.

 

Cheers,
Klaus

 

 


Fra: Tinycc-devel [tinycc-deve= l-bounces+grue=3Ddi.ku.dk@nongnu.org] p=E5 vegne af Klaus Ebbe Grue [gr= ue@di.ku.dk]
Sendt: 3. august 2019 16:14
Til: tinycc-devel@nongnu.org
Emne: Re: [Tinycc-devel] Duplicate double

Hi Avi,

 

Great! Thanks!

 

https://0x0.st/zOsg.7z worked.

 

Just to test, I made a fresh msys2 install, cloned git://repo.or.cz/tiny= cc.git and compiled. That also works.

 

For completeness, I have included the steps. The only surprise was that = when using .configure --prefix=3D/usr I had to add --bindir=3D/usr/bin= since otherwise tcc ends up in /usr/tcc.exe

 

Cheers,

Klaus

 

---

 

Remove C:\msys64 if present

Go to https://www.msys2.org/
Click msys2-x86_64-20190524.exe
Install msys2 using defaults

 

In MSYS2 shell:
> pacman -Syu
As instructed, kill and restart MSYS2 shell
> pacman -Syu
> pacman -S gcc git make texinfo
> git clone git://repo.or.cz/tinycc.git
> cd tinycc
> ./configure --prefix=3D/usr --bindir=3D/usr/bin
> make
> make install
> cd
> tcc -v
tcc version 0.9.27 (x86_64 Windows)
> mkdir experiment
> cd experiment
> cat>test.c
#include <stdio.h>
void f(double x,double y,double z){printf("f(%4.1f,%4.1f,%4.1f)\n"= ;,x,y,z);}
int main(int argc,char **argv){double u=3D0.0;f(u*1.0,7.0,8.0);return 0;} > tcc -o test test.c
> ./test
f( 0.0, 7.0, 8.0)

 

 


Fra: Tinycc-devel [tinycc-deve= l-bounces+grue=3Ddi.ku.dk@nongnu.org] p=E5 vegne af avih via Tinycc-dev= el [tinycc-devel@nongnu.org]
Sendt: 3. august 2019 10:31
Til: tinycc-devel@nongnu.org
Cc: avih
Emne: Re: [Tinycc-devel] Duplicate double

You're right, and I can confirm that the win64 version downloaded the<= br clear=3D"none"> same as you exhibits the same issue, and the issue also exists if
I build 0.27 for win64 myself (git d348a9a).

However, it was apparently fixed shortly after tcc 0.27 was released,
at the following commit:

commit 8f6fcb709ae7b2379866c292ce478ab95dc75b48
Author: grischka <grischka>
Date: Thu May 31 23:51:51 2018 +0200

misc fixes

misc fixes including:
- tcc.c: fix "tcc -vv" for libtcc1.a on win32/PE
- tccelf.c: fix a crash when GOT has no relocs (witn -nostdlib)
- tccelf.c: fix stab linkage for zero n_strx
- tccgen.c: fix stdcall decoration for array parameters
int __stdcall func(char buf[10]) is _func@4 (was _func@12)
- tccgen.c: fix static variables with nocode/nodata_wanted
see tests2/96_nodata_wanted.c
- tccrun.c: align sections using sh_addralign (for reliable function_alignm= ent)
- tests2/Makefile sort 100 after 99
- win32/include/sys/stat.h fix _stat and _wstat
- x86_64-gen.c: win64/gfunc_call: fix a bug with xmmN register args
previously overwrote valid other xmmN registers eventually


Not sure which of the fixes did it, but I'd guess it's at x86_64-gen.c .
If you want, I've built tcc for win32 and win64 from the latest git
version (mob, 9e429db), and uploaded it here: https://0x0.st/zOsg.7z

Cheers,
Avi



On Friday, August 2, 2019, 9:51:22 PM GMT+3, Klaus Ebbe Grue <g= rue@di.ku.dk> wrote:


Hi tinycc-devel,

Under MSYS2/MinGW I have a problem with tcc.

I define this functions:

void f(double x,double y,double z){printf("f(%4.1f,%4= .1f,%4.1f)\n",x,y,z);}

As an example, f(1,2,3) prints f( 1.0, 2.0, 3.0).

Then I call f from main in a slightly confusing way:

int main(int argc,char **argv){double u=3D0.0;f(u*1.0,7.0,= 8.0);return 0;}

I would expect to get f( 0.0, 7.0, 8.0) but I do get f( 7.= 0, 7.0, 8.0).

The first argument of f becomes a duplicate of the second = argument of f.

If I remove "*1.0" then everything works as expe= cted.

Is this a known bug?

By the way, if I make the same program using integers, the= n there is no problem.

I have included a reproduction scenario below.

Cheers,
Klaus

---

Install MSYS2/MinGW
Start MSYS2 shell

> mkdir experiment
> cd experiment
> pacman -S unzip
> unzip tcc-0.9.27-win64-bin.zip
> tcc/tcc -v
tcc version 0.9.27 (x86_64 Windows)
> cat>test.c
#include <stdio.h>
void f(double x,double y,double z){printf("f(%4.1f,%4= .1f,%4.1f)\n",x,y,z);}
int main(int argc,char **argv){double u=3D0.0;f(u*1.0,7.0,= 8.0);return 0;}
> tcc/tcc -o test test.c
> ./test
f( 7.0, 7.0, 8.0)
_______________________________________________
Tinycc-devel mailing list
______________________________= _________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.o= rg/mailman/listinfo/tinycc-devel
--_000_B6DE68AC3CC96743A7E10D152B184D4701370DB504P1KITMBX03WC0_-- From MAILER-DAEMON Thu Aug 08 06:53:49 2019 Received: from list by lists.gnu.org with archive (Exim 4.86_2) id 1hvg3J-0006M9-0x for mharc-tinycc-devel@gnu.org; Thu, 08 Aug 2019 06:53:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38580) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hvg3F-0006Jc-Ab for tinycc-devel@nongnu.org; Thu, 08 Aug 2019 06:53:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hvg3E-00074R-FF for tinycc-devel@nongnu.org; Thu, 08 Aug 2019 06:53:45 -0400 Received: from sonic301-2.consmr.mail.bf2.yahoo.com ([74.6.129.41]:42489) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hvg3E-000722-Aj for tinycc-devel@nongnu.org; Thu, 08 Aug 2019 06:53:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1565261623; bh=bzzLGiBSuHTrTPOwEjwBpRKKn50WH5Q1JkJJF8N/BwE=; h=Date:From:To:In-Reply-To:References:Subject:From:Subject; b=qFXjM4IOQRCuHwv28OlgGEHLluPgVFTQlcKo69lav3HQpyepU/i/F6ZNjz5PciOiQGfdiCACPUmch/6m/TZ3aoBzWWQLyGHYUSImT5S+eq6WNhEYi7x0uChcPPOB6ILQPXzww9PYElmWU/15dQyItVHsfmZAvXYvOGI7itGFBcP+GXF4xw9CdWPRbzJZ0PDBjRpJ96xhtnP2i21TsHosm2Ire4vquahFrVdKE4kFYuC4R8H1oxV15mJLkf0BHuPlwpnmzHU+j23MNzwW7Cl0nIbtHFc8SMWu2bTSHjMGxtRxhjQqJR+bI6UE8VMBiSrZBxbbinTiHSrdrQG87C487Q== X-YMail-OSG: zUsYpLMVM1meP_qrHXNUPh_zBIc4ZySZ4Vd3qAZlbSRGxiiJkuO82bnUHVjKF7D Pz4k0iFD.1ttHOeFY13LQIu1RF5vHYGgSpBw6RJ_avk1cxsm.Moff.jCkWbypKpxqVhEfKTz4uag _oH.yYAM69KCeK.vWWzjW9xCd5zb.CdqgjRohe6YXnpwWJc3it910H8VkOl0wxoFvbigen12rYcY n2HxXuRaxsYEgQ_Zks8jStXMbNY_BkQj4g4b7wL6x49_BrTsvmv1uap8dj2bSCcizA9eVjDzvGX2 kj3mKro8IndeufjiBLkwtL2s2U2RvE1MIE6Au.sKe1uEnc9bsbjGRhNJ49iP05itvVgYsBrsF8Cv pGXNfxS4wCu6AcmQNFl_GEbGzfxXOphW2pbmotlCd_TvYZ4XTgP.y3l9jhrBSRGAUW3omluITrzE uRNueOS189.7IsVu36sfVKK1wfq1akXuA1ZijAsDMpsj5Z0oLowm.0CuWwFFHDwsv9jN3rKzqDHD MsF8N9d42FoIYKLNC1PofvoPfAsHE_iqU4aTcpotoSGgNsJawMiUl9bn_KuUbESrvS7z2zWxVQF5 G6wSrz2tOI9pwNMb8HxwfJpbH3Eo6hCA5xNKEdQeYxLMSEJegThDoh8t5OArurOl5U.LF_jtDm4U m2QnaSQNW99fWJAuPsoSeuxkpREgrUGkSGBtSJGltqqjB8zmngEDZFoZtr3ishUYYaHyTzjYV7yJ i0N3MPL1XGdtlZ8CaFOchOZmUZ_F20LPW_K7OJ2GR10.tWJf2LuLEbP0geZY5DDLlQ1pxdbdhWmd hcN5A8zi0egV19tabE8.TF2EAGb9o34qD9JwG_vdAknIUmCjGA14XY4tGmSQffqKLaVT55l.attn PXy19xGfZIvVe1EiFPMZgc5Oit2MkkhEKv13Bn7B6f_2WRJ07NN8jFB4FPY.16HIw3edrhpGNxnF U.3V4cvQZDbeTTeT6SdWUiPv4dukhQKrSKkq2niijdUXzn5VHGB4XZwq54tHm_wkwR2o0fhwacYC pEDbASWvQOD11DyTUf32KS_mmWSPOBuvVsQdCAf_uP3c0AkDqBo4msQ2NCTPB_oPLqV_RJp1Pgmx u2mEojvMEDGelFil3Eb5nBKxg3yh0BEk0oTb.FbUNxZ0IGTq3HBCFPnfnPe98e4NzHGz0mtWEF6P CDHtrrA4MU6MLgK8W24pdv0wf1dKFCCI_6iA0A1frfLplqoXan83NI5_L12CA2xiCz3cbm.BC6SQ uzkZfGSHVkcSKFBU6T7Ch Received: from sonic.gate.mail.ne1.yahoo.com by sonic301.consmr.mail.bf2.yahoo.com with HTTP; Thu, 8 Aug 2019 10:53:43 +0000 Date: Thu, 8 Aug 2019 10:53:35 +0000 (UTC) From: avih To: Mai Aylon Message-ID: <846269156.2094784.1565261615070@mail.yahoo.com> In-Reply-To: References: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_2094783_582343538.1565261615069" Content-Length: 2081 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 74.6.129.41 Subject: Re: [Tinycc-devel] =?utf-8?b?15fXqdeR15XXnyDXldei15Mg15HXmdeq?= X-BeenThere: tinycc-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Aug 2019 10:53:46 -0000 ------=_Part_2094783_582343538.1565261615069 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 INeq15XXk9eULiDXlteUINee15LXmdeiINec16rXmdeR16og15TXk9eV15DXqCDXqdec15o/INeQ 15Ug16nXlNedINee16nXkNeZ16jXmdedINeQ16og15bXlCDXkdee16fXldedINeb15zXnNeZINeV 15DXqiDXnNeV16fXl9eqINeQ16og15bXlD8KCgogICAgIE9uIFdlZG5lc2RheSwgQXVndXN0IDcs IDIwMTksIDEwOjE0OjI5IEFNIEdNVCszLCBNYWkgQXlsb24gPG1haWF5bG9uQGdtYWlsLmNvbT4g d3JvdGU6ICAKIAog15TXmdeZINeQ15HXmdee16bXqNek16og15zXmiDXkNeqINeU15fXqdeR15XX nyDXqdecINeV16LXkyDXlNeR15nXqteZ15XXnSDXoNei15nXndee15DXmSAg ------=_Part_2094783_582343538.1565261615069 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
=D7=AA=D7=95=D7=93=D7=94. =D7=96=D7=94 =D7=9E=D7=92=D7= =99=D7=A2 =D7=9C=D7=AA=D7=99=D7=91=D7=AA =D7=94=D7=93=D7=95=D7=90=D7=A8 =D7= =A9=D7=9C=D7=9A? =D7=90=D7=95 =D7=A9=D7=94=D7=9D =D7=9E=D7=A9=D7=90=D7=99= =D7=A8=D7=99=D7=9D =D7=90=D7=AA =D7=96=D7=94 =D7=91=D7=9E=D7=A7=D7=95=D7=9D= =D7=9B=D7=9C=D7=9C=D7=99 =D7=95=D7=90=D7=AA =D7=9C=D7=95=D7=A7=D7=97=D7=AA= =D7=90=D7=AA =D7=96=D7=94?


On Wednesday= , August 7, 2019, 10:14:29 AM GMT+3, Mai Aylon <maiaylon@gmail.com> w= rote:

<= div>
=D7=94=D7= =99=D7=99 =D7=90=D7=91=D7=99
=D7=9E=D7=A6=D7=A8=D7=A4=D7=AA =D7=9C=D7= =9A =D7=90=D7=AA =D7=94=D7=97=D7=A9=D7=91=D7=95=D7=9F =D7=A9=D7=9C =D7=95= =D7=A2=D7=93 =D7=94=D7=91=D7=99=D7=AA
=D7=99=D7=95=D7=9D =D7=A0= =D7=A2=D7=99=D7=9D
=D7=9E=D7=90=D7=99
=
------=_Part_2094783_582343538.1565261615069-- From MAILER-DAEMON Thu Aug 15 10:21:28 2019 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1hyGd6-00059b-Ho for mharc-tinycc-devel@gnu.org; Thu, 15 Aug 2019 10:21:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54112) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hyGd1-00058E-8o for tinycc-devel@nongnu.org; Thu, 15 Aug 2019 10:21:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hyGcy-0002pD-KU for tinycc-devel@nongnu.org; Thu, 15 Aug 2019 10:21:23 -0400 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]:33762) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hyGcy-0002ok-Bi for tinycc-devel@nongnu.org; Thu, 15 Aug 2019 10:21:20 -0400 Received: by mail-pl1-x634.google.com with SMTP id go14so828998plb.0 for ; Thu, 15 Aug 2019 07:21:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=8/G0ghOx1eK8ZqVk8aOWHwtWMvSFHLzoTkMy8/IThkM=; b=skLimxBaGZbMH17GIrPIfzQa/6C3LhwhBm0x8LoS/g9eYfL45kMmBfvvvwlGx4S4j3 nE52RL/UyoxKy0kGssxKYzwpE5E1MdQoPO0ctmBm9khK6mfpbo8cbsY+ms3dbg/mscM9 XkqJwtdeAAvcb51gIIx11SZUqVhkpgY+HqqQfFoJf2basHQwqNSmaGoNpLNmNjClC0yM 17JrI/mbA15qdds/7EuArr2YWZJwnYVIAUsRScZaSeMKCt4v4zUKiiumVAF1GQ0d/tZf h84aDsMU8btqZhVqfxqYZCFUnX9c5Nz5Tljp+2zKupjhnK3Kb/HNQYcMu1lU/IxWjLlO 5KPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=8/G0ghOx1eK8ZqVk8aOWHwtWMvSFHLzoTkMy8/IThkM=; b=Vw5zFh25Lu8QhQhpXgZ/LAOWNs+jfc/drIC+DouPPQhlU+AvbSz5CfztEAOAT+W1Da ems3GLO2d3oluS2LZ8RdW2pgoJGJTgln9yNf/K8Mrc8IBix9gZY4lVPz8arPo2Y2p7fP Y9B24PJNJLWEbJlW8sXJ11TQLjXZrLBVO52oTRIDCHIfxeBNz+CnO4bWyTL/91O6D81N HI63jjEPv+Q/DweDudhY2Q69WQmsaKocNFry/PjwS4GBNqiit13FZzsyoLBJUpzPMUi3 UKijOYKvxrZb3bYMtSFrShiIldgDQQO4Zmy3MnUiLjH3Uv5zq4DL3ZupH1YdHePkQWkI AifQ== X-Gm-Message-State: APjAAAUcio0SSPr5Ht5zBjdEFX97sS4VoywE9LJYpqPiQTfFUaawqxv/ hg3dDLeJlGdlI7191XkB9KWNtBe3eoQ= X-Google-Smtp-Source: APXvYqwwBmFLG5lSi6N6Mf51LcdlE5RWID3aARRyR1z8VfLB/V8K1ulorb66qCjApAJhqHKPXaqbxw== X-Received: by 2002:a17:902:f213:: with SMTP id gn19mr4576796plb.152.1565878877489; Thu, 15 Aug 2019 07:21:17 -0700 (PDT) Received: from [10.0.0.250] (96-82-249-149-static.hfc.comcastbusiness.net. [96.82.249.149]) by smtp.gmail.com with ESMTPSA id 4sm3118509pfc.92.2019.08.15.07.21.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Aug 2019 07:21:15 -0700 (PDT) To: tinycc-devel@nongnu.org From: Lance Fredrickson Message-ID: <4237df8c-dac9-8da5-a845-559765dd2331@gmail.com> Date: Thu, 15 Aug 2019 08:21:13 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::634 Subject: [Tinycc-devel] Trying to use tcc on arm router. X-BeenThere: tinycc-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Aug 2019 14:21:27 -0000 I'm trying to compile tcc to run on my arm based router.  Using my project (tomatoware) I've got gcc9 and llvm/clang8 working and can natively compile c/c++ code, and just for fun am looking at what other compilers I can get working. My  sysroot lives in /mmc. I'm using the latest uClibc-ng, which I'm not sure if tcc has supported this new branch of development.  I tried compiling from latest git at https://repo.or.cz/w/tinycc.git ./configure \ --sysroot=/mmc \ --prefix=/mmc \ --elfinterp=/mmc/lib/ld-uClibc.so.1 \ --config-uClibc make make install #simple hello world c program root@R7000:~# tcc hello.c -o hello In file included from hello.c:1: In file included from /mmc/usr/include/stdio.h:71: In file included from /mmc/usr/include/bits/uClibc_stdio.h:114: In file included from /mmc/usr/include/bits/pthreadtypes.h:21: In file included from /mmc/usr/include/endian.h:59: In file included from /mmc/usr/include/byteswap.h:22: In file included from /mmc/usr/include/bits/byteswap.h:1: /mmc/usr/include/bits/byteswap-common.h:106: error: ';' expected (got "__bswap_64") armv7a (soft float) Linux 2.6.36.4 uclibc-ng 1.0.31 gcc 9.1 Looks like tcc is still seeing some active development, so I'd thought I'd give it a try. thanks, Lance From MAILER-DAEMON Thu Aug 15 14:34:26 2019 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1hyKZu-0005EN-NC for mharc-tinycc-devel@gnu.org; Thu, 15 Aug 2019 14:34:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46315) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hyId1-0000GR-8M for tinycc-devel@nongnu.org; Thu, 15 Aug 2019 12:29:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hyIcv-0007Y4-BU for tinycc-devel@nongnu.org; Thu, 15 Aug 2019 12:29:31 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:46962) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hyIcu-0007Vz-PB for tinycc-devel@nongnu.org; Thu, 15 Aug 2019 12:29:25 -0400 Received: by mail-wr1-x430.google.com with SMTP id z1so2704601wru.13 for ; Thu, 15 Aug 2019 09:29:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=rWjCj5I8HDpyS6mKwrEYJUjOj7RP3is6u2L2P5UDl5g=; b=Y+tNFB2rDSGtTrVNzO1eN+CXXC055NyT3AZFbM1I8kXvi0vAd/c6wiNYseNQ34ebjc eosfd5cZH8Vi4/m5thmW2loeCBCWktzQLkl5fX+luSWe+XyhVdJ+lfJZL4K5b21ZX0ue rk5MKXvGu986ntfZJ6B9pNdDLs7T/rKslbJbi3zs8t8rVLQSNg9qfNKV9wRstRrBcmI3 p3LSRo/SxFJGQ1W8VUEuOBoOWy4HeHm6OWAn3Rw48wtwO1TTmmC5KMDkGDS/LVvyR/UN UOPMJv0RoX34N7H5/Cz0i9k4C43HQG6ONcx4k86NzHD+PtFug248MUq1UGh4VWR5Hu/B HTKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=rWjCj5I8HDpyS6mKwrEYJUjOj7RP3is6u2L2P5UDl5g=; b=GhSG78pAR0Easp06p1wXxZ944420OMPe4hQ+zfMuCIa1aGj/GnYQBWDQCRmsbDGdIv o2/DSASrulqEw7KGFqqHN19dfsLdsjkbdhxpvqTzPTBPHw96+5cBtKh9H6FQZ5gi6++I DcuUDUm8ptqLTjvYkonW9tDWvkNnHCMe5vnkXVT54eEhEiwWw4V9j+XljDGH4Yfb+4fS S1FGIyk3FgoYdVPZxdcQH7g4oLfkYnT63XKXclaMqxs0nwmLqZg8Pc0n3WGu8jLjT1Op P1yzrfc663VvaikPMOac/tJHtGMc33vtm4daQB+sFG8DXtjV3eVHyP4B4/NfuvD1fzix 8trw== X-Gm-Message-State: APjAAAWWSFAu0b7XstZrNpe+9klmQXOoACJzcS4dv/s/32t+58u1/sZ7 b1LJrBF1Xs+q8kT1CgFc+zrnCypyR2mzvUA87IKYk5a/ X-Google-Smtp-Source: APXvYqxbaUkbYXTqcpKzqsEBjwrC1YLeGgRfqOJDPYw/x87A2ozzaEYx4o60ZQwF6J2no0MNIWDihrLC1bqf7gLNTp8= X-Received: by 2002:a5d:4448:: with SMTP id x8mr6530835wrr.119.1565886562216; Thu, 15 Aug 2019 09:29:22 -0700 (PDT) MIME-Version: 1.0 From: "UnknownGamer40464 ." Date: Thu, 15 Aug 2019 12:29:10 -0400 Message-ID: To: tinycc-devel@nongnu.org Content-Type: multipart/alternative; boundary="0000000000004caef105902a60e6" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::430 X-Mailman-Approved-At: Thu, 15 Aug 2019 14:34:25 -0400 Subject: [Tinycc-devel] 2 long double related bugs(?) in mob [Sun, 21 Jul 2019 15:14:58 -0400 (21 21:14 +0200)] X-BeenThere: tinycc-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Aug 2019 16:29:35 -0000 --0000000000004caef105902a60e6 Content-Type: text/plain; charset="UTF-8" 1. The below example triggers "error: type match twice" even when double and long double have differing DIG: _Generic((3.14), long double: puts("ld"), double: puts("d"), default: puts("idk") ); 2. Using fabsl after including math.h results in "TCCFILEPATH/include/math.h:203: error: unknown constraint 't'" This was tested on Win10 personal Version 10.0.17134 Build 17134 System Type x64-based PC Processor Intel(R) Core(TM)2 Duo CPU T7250 @ 2.00GHz, 2000 Mhz, 2 Core(s), 2 Logical Processor(s) These exist in the mob branch, at current change: Sun, 21 Jul 2019 15:14:58 -0400 (21 21:14 +0200) on both -m64 and -m32 settings. --0000000000004caef105902a60e6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
1. The below example triggers "error: type match= twice" even when double and long double have differing DIG:

_Generic((3.14),
=C2=A0=C2=A0=C2=A0 long double: = puts("ld"),
=C2=A0=C2=A0=C2=A0 double: puts("d= "),
=C2=A0=C2=A0=C2=A0 default: puts("idk")
<= div>);

2. Using fabsl after including math.h resul= ts in "TCCFILEPATH/include/math.h:203: error: unknown constraint '= t'"

This was tested on Win10 personal Ver= sion 10.0.17134 Build 17134
System Type x64-based PC
Pr= ocessor Intel(R) Core(TM)2 Duo CPU =C2=A0 =C2=A0 T7250 =C2=A0@ 2.00GHz, 200= 0 Mhz, 2 Core(s), 2 Logical Processor(s)

These= exist in the mob branch, at current change:

Sun, 21 Jul 2019 15:14:58 -0400 (21 21:14 +0200)

on both -m64 and -m32 settings.
--0000000000004caef105902a60e6--