<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - Incorrect floating-point results on Windows"
href="https://bugs.llvm.org/show_bug.cgi?id=51597">51597</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Incorrect floating-point results on Windows
</td>
</tr>
<tr>
<th>Product</th>
<td>flang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Frontend
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>ivan.zhechev@arm.com
</td>
</tr>
<tr>
<th>CC</th>
<td>David.Truby@arm.com, jperier@nvidia.com, kirankumartp@gmail.com, llvm-bugs@lists.llvm.org, sscalpone@nvidia.com
</td>
</tr></table>
<p>
<div>
<pre>In the process of porting bash scripts to Python[1], a floating-point issue was
discovered. The issue was found in the following tests:
* modfile18.f90
* modfile20.f90
The test output from "modfile20.f90":
```
modulem
integer(4),parameter::k8=8_4
integer(8),parameter::k4=4_8
integer(4),parameter::k1=1_4
integer(8),parameter::i=2_8
real(4)::r
character(10_4,1)::c
character(10_4,1),parameter::c2="qwer"
-complex(8),parameter::z=(5.2998088236266444784153906391725161990529344138059892287851636006394637208772783967641453996063181525958722656239979776047890543641270829629146043915334305586684166625683158265441683606099408578629972437467011188159118589981813067124255388149550707943455065771947059559977423190741960894685428870986175932148517853745409614715815234172017107468757976473650165152239408070671353791432807273650558213980135882968582964172072849203872441723267613655126480721266039471603804988371712474532141626772658666340434947871745767068786652635716849759123153308685928998366968362550685343659324636947235340315503319049946260361336151613048112666687607635018113179515828019950483141531761592438363990901207165019025369101512978886603377759456634521484375e-315_8,5.304989477413180787778455537158022079990425063281850410826986829965602004084392060886104486018445540819328641250218894493943295863994264862194090808338448574854798301534658266257310265165766802005580818765026339850922525527016283551831624385644176435395697688218356694957661910783946036770076164603112820578698170306480884210067917868244918675269615631380036081709985714991932187920546886433838867166731099135858157899531045707210692113844187329701809995950774625505600812130267211526970970265415686640528385788921570427999758778003328851744096675278044114792548934824232824233347842447113293106849990098450143754644009702029449400849277636193406441429541338458386582299953457542217470838986914660750926486798562109470367431640625e-315_8)
-complex(8),parameter::zn=(-5.2998088236266444784153906391725161990529344138059892287851636006394637208772783967641453996063181525958722656239979776047890543641270829629146043915334305586684166625683158265441683606099408578629972437467011188159118589981813067124255388149550707943455065771947059559977423190741960894685428870986175932148517853745409614715815234172017107468757976473650165152239408070671353791432807273650558213980135882968582964172072849203872441723267613655126480721266039471603804988371712474532141626772658666340434947871745767068786652635716849759123153308685928998366968362550685343659324636947235340315503319049946260361336151613048112666687607635018113179515828019950483141531761592438363990901207165019025369101512978886603377759456634521484375e-315_8,5.304989477413180787778455537158022079990425063281850410826986829965602004084392060886104486018445540819328641250218894493943295863994264862194090808338448574854798301534658266257310265165766802005580818765026339850922525527016283551831624385644176435395697688218356694957661910783946036770076164603112820578698170306480884210067917868244918675269615631380036081709985714991932187920546886433838867166731099135858157899531045707210692113844187329701809995950774625505600812130267211526970970265415686640528385788921570427999758778003328851744096675278044114792548934824232824233347842447113293106849990098450143754644009702029449400849277636193406441429541338458386582299953457542217470838986914660750926486798562109470367431640625e-315_8)
+complex(8),parameter::z=(1._8,2._8)
+complex(8),parameter::zn=(-1._8,2._8)
type::t
integer(4)::a=123_4
type(t),pointer::b=>NULL()
endtype
intrinsic::null
type(t),parameter::x=t(a=456_4,b=NULL())
type(t),parameter::y=t(a=789_4,b=NULL())
end
```
The test produces plausible results when the precision is reduced from "k8" to
"k4":
```
complex*16, parameter :: z = (1.0_k4, 2.0_k4)
complex*16, parameter :: zn = (-1.0_k4, 2.0_k4)
```
[1] <a href="https://reviews.llvm.org/D107956">https://reviews.llvm.org/D107956</a></pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>