http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53667

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2012-09-06
         AssignedTo|unassigned at gcc dot       |rguenth at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1

--- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-09-06 
15:11:01 UTC ---
Confirmed.  Must be fortran issue, the equivalent C testcase works:

extern void abort (void);
typedef __SIZE_TYPE__ uintptr_t;
void foo (uintptr_t *u)
{
  static int i;
  *u = (uintptr_t) &i;
}
void bar (uintptr_t *u)
{
  if (*(int *)*u != 1)
    abort ();
}
int main ()
{
  uintptr_t mem;
  foo (&mem);
  *(int *)mem = 1;
  bar (&mem);
  return 0;
}

in particular the call to foo makes mem point to NONLOCAL as can be seen
from the ealias dump:

  foo (&mem);
  mem.0_1 = mem;
  # PT = nonlocal escaped
  mem.1_2 = (int *) mem.0_1;

while for the fortran case I see

  object_holder_init (&object_holder);
  pobj_1 = object_holder;
  # PT =
  pobj.4_2 = (integer(kind=8)[3] *) pobj_1;
  *pobj.4_2[0] = 900;

so object_holder points to nothing.  If I remove the implementations
of object_hoder_init and print_vals then the alias info is correct.
Thus, some attribute on object_holder_init confuses points-to analysis.
I see it has ".w" fnspec, so that must be where the bug lies (nothing
is wrong in specifying ".w" here).

Mine.

Reply via email to