[Bug fortran/83254] gfortran doesn't consider c_loc addresses c_associated

kargl at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Dec 2 01:31:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83254

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2017-12-02
                 CC|                            |kargl at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from kargl at gcc dot gnu.org ---
(In reply to Ben Woodard from comment #0)
>
> The original report targeted 7.1 and the problem appears to persist all the
> way to the current trunk.
>

How old is your current trunk?  Janne committed a patch that may
have fixed this problem on 11/08/17.  You need revision 254526
or newer.

Compiling a sightly modified version of you code and using
-fdump-tree-original with 7=branch I see

assert_true (logical(kind=4) & restrict var1)
{
  if (!*var1)
    {
      _gfortran_abort ();
    }
  L.1:;
}
...
  {
    logical(kind=1) D.3498;

    D.3498 = jvar != 0B && jvar == kvar;
    assert_true (&D.3498);
  }

That is obviously broken as the types are mismatched.  With trunk, I see

assert_true (logical(kind=4) & restrict var1)
{
  if (!*var1)
    {
      _gfortran_abort ();
    }
  L.1:;
}

  {
    logical(kind=4) D.3560;

    D.3560 = jvar != 0B && jvar == kvar;
    assert_true (&D.3560);
  }


More information about the Gcc-bugs mailing list