llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

Intel-specific compiler directives give hard error

Open naromero77 opened this issue 6 years ago • 3 comments

Bugzilla Link 45855
Version trunk
OS All
Attachments Test to cover ignoring vendor directices
CC @jeanPerier,@kiranktp,@sscalpone

Extended Description

Hi,

I work for Pat and Hal on the DOE ECP Flang project.

I am raising the github issue here again: https://github.com/flang-compiler/f18/issues/948

I was asked to write a test to cover this issue. I believe that the correct behavior for flang is to just ignore the Intel specific directives.

Note that I am not submitting a fix for the issue itself, but rather a test that covers the problem. This would be a test that would go in llvm-project/flang/test/Semantics

naromero77 avatar May 09 '20 04:05 naromero77

Here is another example that I encountered today in the NWChem code: ducc.F:9:15: error: expected end of line CDIR$ OPTIMIZE: 2

Could we get the Flang front-end to just ignore these types of compiler directives for now?

naromero77 avatar Sep 19 '20 05:09 naromero77

I have created a small subroutine:

SUBROUTINE f(a)
    IMPLICIT NONE
    REAL :: a(:)
    INTEGER i

    !DIR$ ASSUME_ALIGNED a:16
    DO i = 1, SIZE(a)
      a(i) = 2.0*a(i)
    END DO
END SUBROUTINE f

Compiling with latest flang-new appears to work, and there is an explicit warning that the directive is ignored:

$ flang-new -c flang-issue-45200.f90 
./flang-issue-45200.f90:6:11: warning: Unrecognized compiler directive was ignored
      !DIR$ ASSUME_ALIGNED a:16
            ^^^^^^^^^^^^^^^^^^^^
$ echo $?
0

This was tested with a recent version from the main Github branch:

$ flang-new --version
flang-new version 20.0.0git (https://github.com/llvm/llvm-project.git a9006bffa994d5afe9ad0b661b69d655658ab5e8)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/llvm/llvm-project/install/bin

So this issue seems to have been solved...

hakostra avatar Sep 04 '24 05:09 hakostra

Closing this old issue. If there are specific directives the flang still chokes on, please re-open with new info.

eugeneepshteyn avatar Mar 11 '25 01:03 eugeneepshteyn