-
Notifications
You must be signed in to change notification settings - Fork 347
[gfortran] Fixed cray_pointers_2.f90 aliasing issues. #252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thanks Slava. We don't allow modifying these tests. For now, this test should be disabled instead by adding it to the "skipped" tests in If this test is useful, you could consider adding it with your modifications to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please disable the test instead.
Thanks for the explanation @tarunprabhu! As you said Slava, this test appears to break the rules for cray pointers that the HPE docs lay out. Our own docs on aliasing explain this to our users and how they can get around the issues that come from their misuse of the feature. It may be a useful standalone test demonstrating that the workaround we recommend to our users really does allow their code to work as they intend. I don't like gfortran's approach of simply disabling some optimizations to get the test to pass. +1 for disabling the test and adding our own modified test. |
The test started failing after llvm/llvm-project#140803 The issue is that the Cray pointee and the underlying storage are both accessed in subroutines violating Fortran aliasing rules for the dummy arguments. GCC tried to "solve" that by using `-fno-inline` option, but it should be better to make the aliasing explicit with proper `TARGET` attribute placement.
! { dg-do run } | ||
! { dg-options "-O3 -fcray-pointer -fbounds-check -fno-inline" } | ||
! { dg-timeout-factor 4 } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These DejaGNU directives are not necessary. We may want to retain a comment with the command line options though. If any are ever supported in flang
, we may need to update the flags with which this test is built. Perhaps something like
! { dg-do run } | |
! { dg-options "-O3 -fcray-pointer -fbounds-check -fno-inline" } | |
! { dg-timeout-factor 4 } | |
! The original gfortran test on which this is based is compiled with | |
! -fcray-pointer -fbounds-check -fno-inline. Of these, we may want to compile | |
! with -fbounds-check (or its equivalent) if it is ever supported in flang |
! Note: Some of the test cases violate Fortran's alias rules; | ||
! the "-fno-inline option" for now prevents failures. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of this, could we have a comment indicating what the original source of this test was and what changes were made to it? It may be a useful reference in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes, Slava. LGTM.
Thank you for the review, Tarun! |
The test started failing after llvm/llvm-project#140803
The issue is that the Cray pointee and the underlying storage
are both accessed in subroutines violating Fortran aliasing rules
for the dummy arguments.
GCC tried to "solve" that by using
-fno-inline
option, butit should be better to make the aliasing explicit with proper
TARGET
attribute placement.