This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: -fstrict-aliasing fixes 5/6: make type system independent of flag_strict_aliasing
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, gcc-patches at gcc dot gnu dot org, rguenther at suse dot de
- Date: Wed, 9 Dec 2015 08:29:55 +0100
- Subject: Re: -fstrict-aliasing fixes 5/6: make type system independent of flag_strict_aliasing
- Authentication-results: sourceware.org; auth=none
- References: <20151202080716 dot GV5527 at kam dot mff dot cuni dot cz> <4833565 dot b9m1IQmy3c at polaris>
Hi
this patch implements the trik for punting if we get too many nested pointers.
This fixes the ada tstcases. Curiously enough I would like to replace safe_push
by quick_push but doing so I get weird error about freeing non-heap object
in the auto_vec desructor...
Bootstraping/regtesting x86_64-linux. Ok if it passes?
Honza
* alias.c (get_alias_set): Punt after getting 8 nested pointers.
Index: alias.c
===================================================================
--- alias.c (revision 231439)
+++ alias.c (working copy)
@@ -990,6 +990,14 @@ get_alias_set (tree t)
|| TREE_CODE (p) == VECTOR_TYPE;
p = TREE_TYPE (p))
{
+ /* Ada supports recusive pointers. Instead of doing recrusion check
+ just give up once the preallocated space of 8 elements is up.
+ In this case just punt to void * alias set. */
+ if (reference.length () == 8)
+ {
+ p = ptr_type_node;
+ break;
+ }
if (TREE_CODE (p) == REFERENCE_TYPE)
/* In LTO we want languages that use references to be compatible
with languages that use pointers. */