diff options
author | Richard Guenther <rguenther@suse.de> | 2009-06-29 12:20:39 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2009-06-29 12:20:39 +0000 |
commit | 5b21f0f37dd072967e60c5e413dbabec1eb1c837 (patch) | |
tree | e708803ab158cd132fb494655ffed7aec0ca820d /gcc/tree.c | |
parent | 09a782ebdacc6a5227ed464d47eb3cc27e252c6a (diff) | |
download | gcc-5b21f0f37dd072967e60c5e413dbabec1eb1c837.zip gcc-5b21f0f37dd072967e60c5e413dbabec1eb1c837.tar.gz gcc-5b21f0f37dd072967e60c5e413dbabec1eb1c837.tar.bz2 |
re PR middle-end/38212 (restrict implementation causes wrong-code)
2009-06-29 Richard Guenther <rguenther@suse.de>
PR middle-end/38212
* alias.c (find_base_decl): Remove.
(get_deref_alias_set_1): Remove restrict handling.
* c-common.c (c_apply_type_quals_to_decl): Do not set
DECL_POINTER_ALIAS_SET.
* gimplify.c (find_single_pointer_decl_1): Remove.
(find_single_pointer_decl): Likewise.
(internal_get_tmp_var): Remove restrict handling.
(gimple_regimplify_operands): Likewise.
* omp-low.c (expand_omp_atomic_pipeline): Do not set
DECL_POINTER_ALIAS_SET. Use ref-all pointers.
* print-tree.c (print_node): Do not print DECL_POINTER_ALIAS_SET.
* tree.c (restrict_base_for_decl): Remove.
(init_ttree): Do not allocate it.
(make_node_stat): Do not set DECL_POINTER_ALIAS_SET. Set
LABEL_DECL_UID for label decls.
(copy_node_stat): Do not copy restrict information.
(decl_restrict_base_lookup): Remove.
(decl_restrict_base_insert): Likewise.
(print_restrict_base_statistics): Likewise.
(dump_tree_statistics): Do not call print_restrict_base_statistics.
* tree.h (DECL_POINTER_ALIAS_SET): Remove.
(DECL_POINTER_ALIAS_SET_KNOWN_P): Likewise.
(struct tree_decl_common): Rename pointer_alias_set to label_decl_uid.
(LABEL_DECL_UID): Adjust.
(DECL_BASED_ON_RESTRICT_P): Remove.
(DECL_GET_RESTRICT_BASE): Likewise.
(SET_DECL_RESTRICT_BASE): Likewise.
(struct tree_decl_with_vis): Remove based_on_restrict_p flag.
* config/i386/i386.c (ix86_gimplify_va_arg): Use ref-all pointers
instead of DECL_POINTER_ALIAS_SET.
* config/rs6000/rs6000.c (rs6000_gimplify_va_arg): Likewise.
* config/s390/s390.c (s390_gimplify_va_arg): Likewise.
* config/spu/spu.c (spu_gimplify_va_arg_expr): Likewise.
* gcc.c-torture/execute/pr38212.c: New testcase.
From-SVN: r149047
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 59 |
1 files changed, 2 insertions, 57 deletions
@@ -194,9 +194,6 @@ static GTY ((if_marked ("tree_priority_map_marked_p"), param_is (struct tree_priority_map))) htab_t init_priority_for_decl; -static GTY ((if_marked ("tree_map_marked_p"), param_is (struct tree_map))) - htab_t restrict_base_for_decl; - static void set_type_quals (tree, int); static int type_hash_eq (const void *, const void *); static hashval_t type_hash_hash (const void *); @@ -273,8 +270,6 @@ init_ttree (void) tree_map_eq, 0); init_priority_for_decl = htab_create_ggc (512, tree_priority_map_hash, tree_priority_map_eq, 0); - restrict_base_for_decl = htab_create_ggc (256, tree_map_hash, - tree_map_eq, 0); int_cst_hash_table = htab_create_ggc (1024, int_cst_hash_hash, int_cst_hash_eq, NULL); @@ -658,11 +653,11 @@ make_node_stat (enum tree_code code MEM_STAT_DECL) } else DECL_ALIGN (t) = 1; - /* We have not yet computed the alias set for this declaration. */ - DECL_POINTER_ALIAS_SET (t) = -1; } DECL_SOURCE_LOCATION (t) = input_location; DECL_UID (t) = next_decl_uid++; + if (TREE_CODE (t) == LABEL_DECL) + LABEL_DECL_UID (t) = -1; break; @@ -748,11 +743,6 @@ copy_node_stat (tree node MEM_STAT_DECL) SET_DECL_INIT_PRIORITY (t, DECL_INIT_PRIORITY (node)); DECL_HAS_INIT_PRIORITY_P (t) = 1; } - if (TREE_CODE (node) == VAR_DECL && DECL_BASED_ON_RESTRICT_P (node)) - { - SET_DECL_RESTRICT_BASE (t, DECL_GET_RESTRICT_BASE (node)); - DECL_BASED_ON_RESTRICT_P (t) = 1; - } } else if (TREE_CODE_CLASS (code) == tcc_type) { @@ -4523,36 +4513,6 @@ decl_fini_priority_insert (tree decl, priority_type priority) h->fini = priority; } -/* Look up a restrict qualified base decl for FROM. */ - -tree -decl_restrict_base_lookup (tree from) -{ - struct tree_map *h; - struct tree_map in; - - in.base.from = from; - h = (struct tree_map *) htab_find_with_hash (restrict_base_for_decl, &in, - htab_hash_pointer (from)); - return h ? h->to : NULL_TREE; -} - -/* Record the restrict qualified base TO for FROM. */ - -void -decl_restrict_base_insert (tree from, tree to) -{ - struct tree_map *h; - void **loc; - - h = GGC_NEW (struct tree_map); - h->hash = htab_hash_pointer (from); - h->base.from = from; - h->to = to; - loc = htab_find_slot_with_hash (restrict_base_for_decl, h, h->hash, INSERT); - *(struct tree_map **) loc = h; -} - /* Print out the statistics for the DECL_DEBUG_EXPR hash table. */ static void @@ -4575,20 +4535,6 @@ print_value_expr_statistics (void) htab_collisions (value_expr_for_decl)); } -/* Print out statistics for the RESTRICT_BASE_FOR_DECL hash table, but - don't print anything if the table is empty. */ - -static void -print_restrict_base_statistics (void) -{ - if (htab_elements (restrict_base_for_decl) != 0) - fprintf (stderr, - "RESTRICT_BASE hash: size %ld, %ld elements, %f collisions\n", - (long) htab_size (restrict_base_for_decl), - (long) htab_elements (restrict_base_for_decl), - htab_collisions (restrict_base_for_decl)); -} - /* Lookup a debug expression for FROM, and return it if we find one. */ tree @@ -7100,7 +7046,6 @@ dump_tree_statistics (void) print_type_hash_statistics (); print_debug_expr_statistics (); print_value_expr_statistics (); - print_restrict_base_statistics (); lang_hooks.print_statistics (); } |