Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
23 Views

Assumed type internal compiler error

Hi!

Code generates an internal compiler error:

C code:

#include <stdlib.h>
#include <stdio.h>

void ifb_echo(void*);

void ifb_echo(void *this){
  printf("pointer: %p\n", this);
  return;
}

Fortran code:

program ifb_p

  use, intrinsic :: iso_c_binding, only: c_null_ptr

  implicit none

  interface
    subroutine ifb_echo_aux(this) bind(c, name="ifb_echo")
      implicit none
      type(*), intent(in) :: this
    end subroutine ifb_echo_aux
  end interface

  call ifb_echo_aux(c_null_ptr)
  stop

end program ifb_p

using:

ifort (IFORT) 19.0.1.144 20181018

icc (ICC) 19.0.1.144 20181018

Best regards,

José Rui

0 Kudos
6 Replies
Highlighted
Black Belt Retired Employee
23 Views

I can't reproduce an error using 19.0.5. What command line did you use?

0 Kudos
Highlighted
23 Views

Hi Steve,

Yes, I forgot to check the compiler options... :-(

It seems to boil down to:

-assume noprotect_constants

Best regards,

José Rui

 

0 Kudos
Highlighted
Black Belt Retired Employee
23 Views

Yes - I can see that one now. If you have a license with support, I'd recommend that you report this to Intel using the orange "Bug Report" button on the main forum page. 

Why are you using that option, though? Do you know what it does?

0 Kudos
Highlighted
23 Views

I was assuming that -assume=none was invoking more strict standard conformant behaviour...

Or at least there was a time it used to be so, or maybe I am just confused...

I assume I will have to read the documentation more carefully... ;-)

I have an hobbyist license I do not think it includes support.

Thank you very much.

Best regards,

José Rui

 

0 Kudos
Highlighted
Honored Contributor I
23 Views

faustino de sousa, jose rui wrote:

I was assuming that -assume=none was invoking more strict standard conformant behaviour.....

Try -standard-semantics:

https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-standard-semantics

0 Kudos
Highlighted
Black Belt Retired Employee
23 Views

-standard-semantics changes compiler defaults that don't align with F03 and later. It doesn't, on its own, make anything "more strict". There are many -assume options you need enabled in order to match standard semantics.

0 Kudos