Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29253 ディスカッション

Optimization bug in 15.0

Neil_Carlson
ビギナー
1,463件の閲覧回数

I've attached a very short example that exposes an optimization bug in the new version 15.0 Fortran compiler.  This is not present in earlier versions.  The problem appears to be associated with a reference to the intrinsic COUNT (with DIM argument) used as an actual argument.  Details are in the files (code needs to be split across 2 source files to manifest the bug.)

0 件の賞賛
7 返答(返信)
Neil_Carlson
ビギナー
1,463件の閲覧回数

I meant to add some essential features of the example discovered while producing it:

  • I can't seem to produce the error with 32-bit reals.
  • The error disappears if the array is made slightly smaller, (2,24) for example.
  • The unused local derived type variable is essential to the error.
pbkenned1
従業員
1,463件の閲覧回数

Thank you for reporting the issue and for attaching the files.  We'll investigate and follow up.

Patrick

pbkenned1
従業員
1,463件の閲覧回数

I've confirmed it's a Linux-only bug (OK on Windows), and a regression WRT ifort Version 14.0.3.174 Build 20140422. 

The bug also appears in 14.0.4, and -O1 is a workaround, for both 14.0.4 and 15.0.0

[U533534]$ ifort -V
Intel(R) Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 14.0.4.211 Build 20140805
Copyright (C) 1985-2014 Intel Corporation.  All rights reserved.

[U533534]$ ifort -O2 intel-bug-20141014-file2.f90 intel-bug-20141014-file1.f90 && ./a.out
M=0 (expect M=2)
[U533534]$ ifort -O1 intel-bug-20141014-file2.f90 intel-bug-20141014-file1.f90 && ./a.out
M=2 (expect M=2)
[U533534]$

 

As soon as I can isolate the offending optimization, I'll report this to the developers.

Patrick

Neil_Carlson
ビギナー
1,463件の閲覧回数

Another workaround appears to be to introduce an explicit temporary array to hold the result of the COUNT reference, and then pass the temporary instead.

pbkenned1
従業員
1,463件の閲覧回数

Thanks for letting us know about that workaround.  The bug is in the code generator.  I've reported it to the developers (internal tracking ID DPD200362104).  I'll keep this thread updated with any news.

Patrick

pbkenned1
従業員
1,463件の閲覧回数

This issue is now targeted to be fixed in the 15.0 compiler.

Patrick

pbkenned1
従業員
1,463件の閲覧回数

This is fixed in Composer XE2015 update #2, so I am closing this ticket now

[DPD200362104]$ ifort -V
Intel(R) Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 15.0.2.164 Build 20150121
Copyright (C) 1985-2015 Intel Corporation.  All rights reserved.

[DPD200362104]$ ifort -c intel-bug-20141014-file2.f90
[DPD200362104]$ ifort -c intel-bug-20141014-file1.f90
[DPD200362104]$ ifort intel-bug-20141014-file1.o intel-bug-20141014-file2.o -o U533534.x
[DPD200362104]$ ./U533534.x
M=2 (expect M=2)
[DPD200362104]$

Patrick

返信