Commit 6e042ef4 by Jan Hubicka Committed by Jan Hubicka

alias.c (alias_set_entry_d): Add is_pointer and has_pointer.

	* alias.c (alias_set_entry_d): Add is_pointer and has_pointer.
	(alias_stats): Add num_universal.
	(alias_set_subset_of): Special case pointers; be ready for NULL
	children.
	(alias_sets_conflict_p): Special case pointers; be ready for NULL
	children.
	(init_alias_set_entry): Break out from ...
	(record_alias_subset): ... here; propagate new fields;
	allocate children only when really needed.
	(get_alias_set): Do less generous pointer globbing.
	(dump_alias_stats_in_alias_c): Update statistics.
	* gcc.dg/alias-8.c: Do not xfail.
	* gcc.dg/pr62167.c: Prevent FRE.
	* gcc.dg/alias-14.c: New testcase.

From-SVN: r223883
parent 530141b6
2015-05-30 Jan Hubicka <hubicka@ucw.cz>
* alias.c (alias_set_entry_d): Add is_pointer and has_pointer.
(alias_stats): Add num_universal.
(alias_set_subset_of): Special case pointers; be ready for NULL
children.
(alias_sets_conflict_p): Special case pointers; be ready for NULL
children.
(init_alias_set_entry): Break out from ...
(record_alias_subset): ... here; propagate new fields;
allocate children only when really needed.
(get_alias_set): Do less generous pointer globbing.
(dump_alias_stats_in_alias_c): Update statistics.
2015-05-30 Alan Modra <amodra@gmail.com>
* config/rs6000/rs6000.c (split_stack_arg_pointer_used_p): Scan
......
2015-05-30 Jan Hubicka <hubicka@ucw.cz>
* gcc.dg/alias-8.c: Do not xfail.
* gcc.dg/pr62167.c: Prevent FRE.
* gcc.dg/alias-14.c: New testcase.
2015-05-29 Christophe Lyon <christophe.lyon@linaro.org>
* gcc.target/arm/simd/vextp64_1.c: Close comment on final line.
......
/* { dg-do compile } */
/* { dg-options "-O2" } */
#include <stddef.h>
void *a;
int *b;
struct c {void * a;} c;
struct d {short * a;} d;
int *ip= (int *)(size_t)2;
int **ipp = &ip;
int
main()
{
float **ptr;
void **uptr;
int* const* cipp = (int* const*)ipp;
/* as an extension we consider void * universal. Writes to it should alias. */
asm ("":"=r"(ptr):"0"(&a));
a=NULL;
*ptr=(float*)(size_t)1;
if (!a)
__builtin_abort ();
a=NULL;
if (*ptr)
__builtin_abort ();
asm ("":"=r"(uptr):"0"(&b));
b=NULL;
*uptr=(void*)(size_t)1;
if (!b)
__builtin_abort ();
b=NULL;
if (*uptr)
__builtin_abort ();
/* Check that we disambiguate int * and char *. */
asm ("":"=r"(ptr):"0"(&b));
b=NULL;
*ptr=(float*)(size_t)1;
if (b)
__builtin_abort ();
/* Again we should make void * in the structure conflict with any pointer. */
asm ("":"=r"(ptr):"0"(&c));
c.a=NULL;
*ptr=(float*)(size_t)1;
if (!c.a)
__builtin_abort ();
c.a=NULL;
if (*ptr)
__builtin_abort ();
asm ("":"=r"(uptr):"0"(&d));
d.a=NULL;
*uptr=(void*)(size_t)1;
if (!d.a)
__builtin_abort ();
d.a=NULL;
if (*uptr)
__builtin_abort ();
if ((void *)*cipp != (void*)(size_t)2)
__builtin_abort ();
*ipp = NULL;
if (*cipp)
__builtin_abort ();
return 0;
}
......@@ -8,5 +8,5 @@ struct s {
void
func(struct s *ptr)
{
*(void **)&ptr->p = 0; /* { dg-warning "type-punned pointer" "" { xfail *-*-* } } */
*(void **)&ptr->p = 0; /* { dg-warning "type-punned pointer" "" { } } */
}
......@@ -29,6 +29,8 @@ main ()
node.prev = (void *)head;
asm("":"=m"(node.prev));
head->first = &node;
struct node *n = head->first;
......
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