Giter Site home page Giter Site logo

Comments (7)

degawa avatar degawa commented on September 21, 2024 1

Thank you, @PierUgit, for comment on argument aliasing. I asked for help in Fortran Discourse because the issue was beyond my knowledge and may provide important insights for other Fortran users.

from stdlib.

jvdp1 avatar jvdp1 commented on September 21, 2024

Thank you.
I can reproduce the error on my Linux machine.
I will open a PR to replicate this issue and to test different compiler versions.

The error may be due to the deallocation of the component blocks of set2 caused by the intent(out) attribute for set1 >since set1 and set2 are the same variable.

It seems to be indeed the case.

Intel ifort compilers do not seem to have this issue (see #727 ). Therefore, is it a compiler issue or a code issue?

@milancurcic @awvwgk any idea?

Note: since the derived type bitset_large does not contain pointers, I would suggest to remove the user-defined assignment procedure in favor of the intrinsic assignment operation

from stdlib.

degawa avatar degawa commented on September 21, 2024

Thank you for working on reproducing this issue on your Linux machine.

I don't know why the intel compiler does not reproduce the issue, but I suspect it is the compiler implementation.

The gfortran's behavior may be compiler-dependent, but the code does not seem to violate the Fortran standard, so I would like to fix the assignment procedure for bitset_large to solve the issue.

from stdlib.

PierUgit avatar PierUgit commented on September 21, 2024

the code does not seem to violate the Fortran standard

I'm not sure... When assigning an object to itself, the routine assign_large is called with the same actual object in the two arguments. Argument aliasing is normally not authorized... unless there are some exceptions?

from stdlib.

FortranFan avatar FortranFan commented on September 21, 2024
bitsetl(0) = bitsetl(0)

To make the program conform, my read is you can change the assignment to explicitly reference an expression on the right-hand side:

bitsetl(0) = ( bitsetl(0) )

And then file another report with GCC Bugzilla for that processor.

This might satisfy the principle of least change for stdlib while enhancing that one processor if the support request gets worked on promptly.

from stdlib.

degawa avatar degawa commented on September 21, 2024

Thank you, @FortranFan, for the information from a different perspective from what we have been considering.

The modification you suggested would require changes in several places in the sorting procedures for fixing the issue occurring only with the bitset_large type. We will also need to investigate the impact of the changes on the already supported types.
As @jvdp1 and @PierUgit said, the bitset_large type has no pointer component, so removing the user-defined assignment operator for bitset_large type is the easiest way to fix the issue.

from stdlib.

jvdp1 avatar jvdp1 commented on September 21, 2024

The modification you suggested would require changes in several places in the sorting procedures for fixing the issue occurring only with the bitset_large type. We will also need to investigate the impact of the changes on the already supported types.

As the sorting procedures are most likely used for sorting arrays of integers or reals, I am not in favour of such a solution, as it could impact the performances of these procedures. But it questions the versatility of the sorting procedures too.

from stdlib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.