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/config | |
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/config')
-rw-r--r-- | gcc/config/i386/i386.c | 5 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 3 | ||||
-rw-r--r-- | gcc/config/s390/s390.c | 6 | ||||
-rw-r--r-- | gcc/config/spu/spu.c | 4 |
4 files changed, 7 insertions, 11 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 81f3b9e..42bf323 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -6928,7 +6928,6 @@ ix86_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p, /* Pull the value out of the saved registers. */ addr = create_tmp_var (ptr_type_node, "addr"); - DECL_POINTER_ALIAS_SET (addr) = get_varargs_alias_set (); if (container) { @@ -6983,9 +6982,7 @@ ix86_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p, else { int_addr = create_tmp_var (ptr_type_node, "int_addr"); - DECL_POINTER_ALIAS_SET (int_addr) = get_varargs_alias_set (); sse_addr = create_tmp_var (ptr_type_node, "sse_addr"); - DECL_POINTER_ALIAS_SET (sse_addr) = get_varargs_alias_set (); } /* First ensure that we fit completely in registers. */ @@ -7123,7 +7120,7 @@ ix86_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p, if (container) gimple_seq_add_stmt (pre_p, gimple_build_label (lab_over)); - ptrtype = build_pointer_type (type); + ptrtype = build_pointer_type_for_mode (type, ptr_mode, true); addr = fold_convert (ptrtype, addr); if (indirect_p) diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index cf8f53f..2065721 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -7620,7 +7620,7 @@ rs6000_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p, int size, rsize, n_reg, sav_ofs, sav_scale; tree lab_false, lab_over, addr; int align; - tree ptrtype = build_pointer_type (type); + tree ptrtype = build_pointer_type_for_mode (type, ptr_mode, true); int regalign = 0; gimple stmt; @@ -7711,7 +7711,6 @@ rs6000_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p, lab_over = NULL; addr = create_tmp_var (ptr_type_node, "addr"); - DECL_POINTER_ALIAS_SET (addr) = get_varargs_alias_set (); /* AltiVec vectors never go in registers when -mabi=altivec. */ if (TARGET_ALTIVEC_ABI && ALTIVEC_VECTOR_MODE (TYPE_MODE (type))) diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index fd81bba..350850a 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -8624,7 +8624,6 @@ s390_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p, lab_false = create_artificial_label (UNKNOWN_LOCATION); lab_over = create_artificial_label (UNKNOWN_LOCATION); addr = create_tmp_var (ptr_type_node, "addr"); - DECL_POINTER_ALIAS_SET (addr) = get_varargs_alias_set (); t = fold_convert (TREE_TYPE (reg), size_int (max_reg)); t = build2 (GT_EXPR, boolean_type_node, reg, t); @@ -8671,13 +8670,14 @@ s390_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p, if (indirect_p) { - t = build_pointer_type (build_pointer_type (type)); + t = build_pointer_type_for_mode (build_pointer_type (type), + ptr_mode, true); addr = fold_convert (t, addr); addr = build_va_arg_indirect_ref (addr); } else { - t = build_pointer_type (type); + t = build_pointer_type_for_mode (type, ptr_mode, true); addr = fold_convert (t, addr); } diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c index 07e2265..f86bda6 100644 --- a/gcc/config/spu/spu.c +++ b/gcc/config/spu/spu.c @@ -4068,7 +4068,6 @@ spu_gimplify_va_arg_expr (tree valist, tree type, gimple_seq * pre_p, build3 (COMPONENT_REF, TREE_TYPE (f_skip), valist, f_skip, NULL_TREE); addr = create_tmp_var (ptr_type_node, "va_arg"); - DECL_POINTER_ALIAS_SET (addr) = get_varargs_alias_set (); /* if an object is dynamically sized, a pointer to it is passed instead of the object itself. */ @@ -4098,7 +4097,8 @@ spu_gimplify_va_arg_expr (tree valist, tree type, gimple_seq * pre_p, tmp = build2 (POINTER_PLUS_EXPR, ptr_type_node, addr, paddedsize); gimplify_assign (unshare_expr (args), tmp, pre_p); - addr = fold_convert (build_pointer_type (type), addr); + addr = fold_convert (build_pointer_type_for_mode (type, ptr_mode, true), + addr); if (pass_by_reference_p) addr = build_va_arg_indirect_ref (addr); |