Commit 50b4b446 by Tom de Vries Committed by Tom de Vries

Handle single restrict pointer in struct in create_variable_info_for_1

2015-09-22  Tom de Vries  <tom@codesourcery.com>

	PR tree-optimization/67666
	* tree-ssa-structalias.c (create_variable_info_for_1): Handle struct
	with single field non-conservative.

	* g++.dg/pr67666.C: New test.

From-SVN: r227996
parent 6bb4c3e2
2015-09-22 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/67666
* tree-ssa-structalias.c (create_variable_info_for_1): Handle struct
with single field non-conservative.
2015-09-21 David S. Miller <davem@davemloft.net> 2015-09-21 David S. Miller <davem@davemloft.net>
PR/67622 PR/67622
2015-09-22 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/67666
* g++.dg/pr67666.C: New test.
2015-09-21 Steven G. Kargl <kargl@gcc.gnu.org> 2015-09-21 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/67615 PR fortran/67615
......
// { dg-do compile }
// { dg-options "-O2 -fdump-tree-ealias-all" }
struct ps
{
int *__restrict__ p;
};
void
f (struct ps &__restrict__ ps1)
{
*(ps1.p) = 1;
}
// { dg-final { scan-tree-dump-times "clique 1 base 1" 1 "ealias" } }
// { dg-final { scan-tree-dump-times "clique 1 base 2" 1 "ealias" } }
// { dg-final { scan-tree-dump-times "(?n)clique .* base .*" 2 "ealias" } }
...@@ -5675,7 +5675,7 @@ create_variable_info_for_1 (tree decl, const char *name) ...@@ -5675,7 +5675,7 @@ create_variable_info_for_1 (tree decl, const char *name)
/* If we didn't end up collecting sub-variables create a full /* If we didn't end up collecting sub-variables create a full
variable for the decl. */ variable for the decl. */
if (fieldstack.length () <= 1 if (fieldstack.length () == 0
|| fieldstack.length () > MAX_FIELDS_FOR_FIELD_SENSITIVE) || fieldstack.length () > MAX_FIELDS_FOR_FIELD_SENSITIVE)
{ {
vi = new_var_info (decl, name); vi = new_var_info (decl, name);
...@@ -5694,19 +5694,26 @@ create_variable_info_for_1 (tree decl, const char *name) ...@@ -5694,19 +5694,26 @@ create_variable_info_for_1 (tree decl, const char *name)
fieldstack.iterate (i, &fo); fieldstack.iterate (i, &fo);
++i, newvi = vi_next (newvi)) ++i, newvi = vi_next (newvi))
{ {
const char *newname = "NULL"; const char *newname = NULL;
char *tempname; char *tempname;
if (dump_file) if (dump_file)
{ {
tempname if (fieldstack.length () != 1)
= xasprintf ("%s." HOST_WIDE_INT_PRINT_DEC {
"+" HOST_WIDE_INT_PRINT_DEC, name, tempname
fo->offset, fo->size); = xasprintf ("%s." HOST_WIDE_INT_PRINT_DEC
newname = ggc_strdup (tempname); "+" HOST_WIDE_INT_PRINT_DEC, name,
free (tempname); fo->offset, fo->size);
newname = ggc_strdup (tempname);
free (tempname);
}
} }
newvi->name = newname; else
newname = "NULL";
if (newname)
newvi->name = newname;
newvi->offset = fo->offset; newvi->offset = fo->offset;
newvi->size = fo->size; newvi->size = fo->size;
newvi->fullsize = vi->fullsize; newvi->fullsize = vi->fullsize;
......
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