Bug 22254 - We never call may_alias_p for PARM_DECL's
Summary: We never call may_alias_p for PARM_DECL's
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.1.0
: P2 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks: 17064 21470
  Show dependency treegraph
 
Reported: 2005-06-30 15:33 UTC by Daniel Berlin
Modified: 2015-10-20 14:49 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-10-30 17:23:49


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Berlin 2005-06-30 15:33:12 UTC
Given a simple testcase
/* Two int arrays testcase for ipaa.  */

#define N 11

void f ();
void g (int* g1, int* g2);

main ()
{
  f();
  return; 
}

void f ()
{
  int a[N];
  int b[N];
  g(a,b);
  return; 
}

void g (int* g1, int* g2)
{
  int i;
  for (i=0; i < N; i++)
    g1[i] = g2[i];
}

may_alias_p is never called.

However, Interprocedural Alias Analysis can tell us these formals never alias.

We need to be able to take this kind of analysis into account in our representation.
Comment 1 Daniel Berlin 2005-06-30 15:33:44 UTC
By "These formals" i mean g1 and g2
Comment 2 Paolo Carlini 2005-06-30 15:39:29 UTC
> By "These formals" i mean g1 and g2

Thanks for the clarification: I clearly remember "someone" at GCCSummit puzzled
by the spelling checker marking "formal" as error ;) 
Comment 3 Steven Bosscher 2005-06-30 16:41:01 UTC
Ack. 
 
Comment 4 Daniel Berlin 2005-10-02 02:05:57 UTC
Subject: Bug 22254

I actually came across a case recently where we do call it for 
PARM_DECL's.
I'll try to find it again

Comment 5 Diego Novillo 2006-03-10 15:45:05 UTC
The two pointers are assigned the same SMT.  Is this still a problem?

Dereferenced pointers

D.1541, UID 1541, int *, symbol memory tag: SMT.5
D.1542, UID 1542, int *, symbol memory tag: SMT.5

Or do you need to analyze g1 and g2?