Commit a4f91294 by Diego Novillo Committed by Diego Novillo

re PR tree-optimization/21584 (ICE: verify_flow_sensitive_alias_info failed.)


	PR 21584
	PR 22219
	* tree-ssa-alias.c (create_name_tags): Also process
	non-dereferenced pointers.
	Remove argument 'ai'.  Update all callers.

testsuite/ChangeLog

	PR 21584
	PR 22219
	* g++.dg/tree-ssa/pr21584-1.C: New test.
	* g++.dg/tree-ssa/pr21584-2.C: New test.

From-SVN: r101498
parent 8ce2456a
2005-06-30 Diego Novillo <dnovillo@redhat.com>
PR 21584
PR 22219
* tree-ssa-alias.c (create_name_tags): Also process
non-dereferenced pointers.
Remove argument 'ai'. Update all callers.
2005-06-30 Andrew Pinski <pinskia@physics.uc.edu> 2005-06-30 Andrew Pinski <pinskia@physics.uc.edu>
* config/rs6000/darwin.h (STARTING_FRAME_OFFSET): * config/rs6000/darwin.h (STARTING_FRAME_OFFSET):
......
2005-06-30 Diego Novillo <dnovillo@redhat.com>
PR 21584
PR 22219
* g++.dg/tree-ssa/pr21584-1.C: New test.
* g++.dg/tree-ssa/pr21584-2.C: New test.
2005-06-30 Ziemowit Laski <zlaski@apple.com> 2005-06-30 Ziemowit Laski <zlaski@apple.com>
* obj-c++.dg/try-catch-11.mm: New. * obj-c++.dg/try-catch-11.mm: New.
......
extern "C" {
extern char *strcpy (char *__restrict __dest, __const char *__restrict __src)
throw () __attribute__ ((__nonnull__ (1, 2)));
extern char *foo (char *__restrict __s) throw ();
}
class cset {
public:
cset();
int operator()(unsigned char) const;
private:
char v[(127 * 2 + 1)+1];
};
inline int cset::operator()(unsigned char c) const
{
return v[c];
}
extern cset csspace;
void baz()
{
char *vec;
char buf[512];
char *p = buf;
while (csspace(*p))
p++;
if (*p != '#' && (p = foo(buf)) != 0) {
vec = new char[10+ 1];
strcpy(vec, p);
}
}
extern char *strcpy (char *__restrict __dest, __const char *__restrict __src);
extern char *foo (void);
extern void *malloc(__SIZE_TYPE__) __attribute__((malloc));
char v[100];
void baz()
{
char *vec;
char buf[512];
char *p = buf;
while (v[(*p)])
p++;
if (*p != '#' && (p = foo()) != 0) {
strcpy ((char*)malloc(10), p);
}
}
...@@ -791,14 +791,21 @@ compute_points_to_and_addr_escape (struct alias_info *ai) ...@@ -791,14 +791,21 @@ compute_points_to_and_addr_escape (struct alias_info *ai)
are assigned the same name tag. */ are assigned the same name tag. */
static void static void
create_name_tags (struct alias_info *ai) create_name_tags (void)
{ {
size_t i; size_t i;
for (i = 0; i < VARRAY_ACTIVE_SIZE (ai->processed_ptrs); i++) for (i = 1; i < num_ssa_names; i++)
{ {
tree ptr = VARRAY_TREE (ai->processed_ptrs, i); tree ptr = ssa_name (i);
struct ptr_info_def *pi = SSA_NAME_PTR_INFO (ptr); struct ptr_info_def *pi;
if (!ptr
|| !POINTER_TYPE_P (TREE_TYPE (ptr))
|| !SSA_NAME_PTR_INFO (ptr))
continue;
pi = SSA_NAME_PTR_INFO (ptr);
if (pi->pt_anything || !pi->is_dereferenced) if (pi->pt_anything || !pi->is_dereferenced)
{ {
...@@ -824,10 +831,15 @@ create_name_tags (struct alias_info *ai) ...@@ -824,10 +831,15 @@ create_name_tags (struct alias_info *ai)
problems if they both had different name tags because problems if they both had different name tags because
they would have different SSA version numbers (which they would have different SSA version numbers (which
would force us to take the name tags in and out of SSA). */ would force us to take the name tags in and out of SSA). */
for (j = 0; j < i; j++) for (j = 1; j < i; j++)
{ {
tree q = VARRAY_TREE (ai->processed_ptrs, j); tree q = ssa_name (j);
struct ptr_info_def *qi = SSA_NAME_PTR_INFO (q); struct ptr_info_def *qi;
if (!q || !POINTER_TYPE_P (TREE_TYPE (q)))
continue;
qi = SSA_NAME_PTR_INFO (q);
if (qi if (qi
&& qi->pt_vars && qi->pt_vars
...@@ -896,7 +908,8 @@ compute_flow_sensitive_aliasing (struct alias_info *ai) ...@@ -896,7 +908,8 @@ compute_flow_sensitive_aliasing (struct alias_info *ai)
find_what_p_points_to (ptr); find_what_p_points_to (ptr);
} }
} }
create_name_tags (ai);
create_name_tags ();
for (i = 0; i < VARRAY_ACTIVE_SIZE (ai->processed_ptrs); i++) for (i = 0; i < VARRAY_ACTIVE_SIZE (ai->processed_ptrs); i++)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment