[llvm-bugs] [Bug 51597] New: Incorrect floating-point results on Windows

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Aug 24 02:05:03 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=51597

            Bug ID: 51597
           Summary: Incorrect floating-point results on Windows
           Product: flang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedbugs at nondot.org
          Reporter: ivan.zhechev at arm.com
                CC: David.Truby at arm.com, jperier at nvidia.com,
                    kirankumartp at gmail.com, llvm-bugs at lists.llvm.org,
                    sscalpone at nvidia.com

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] https://reviews.llvm.org/D107956

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210824/2153d029/attachment-0001.html>


More information about the llvm-bugs mailing list