diff options
author | Daniel Berlin <dberlin@dberlin.org> | 2005-03-15 01:26:35 +0000 |
---|---|---|
committer | Daniel Berlin <dberlin@gcc.gnu.org> | 2005-03-15 01:26:35 +0000 |
commit | 9044951e0d66b05fb6f5b2982a99857d67d7c486 (patch) | |
tree | 5152c9ec2737c779726a8e050244706fcefdc704 /gcc/tree-tailcall.c | |
parent | 50668cf626cf30043890f1000f500ce69a54fedb (diff) | |
download | gcc-9044951e0d66b05fb6f5b2982a99857d67d7c486.zip gcc-9044951e0d66b05fb6f5b2982a99857d67d7c486.tar.gz gcc-9044951e0d66b05fb6f5b2982a99857d67d7c486.tar.bz2 |
re PR tree-optimization/20458 (structure aliasing causes wrong code)
2005-03-14 Daniel Berlin <dberlin@dberlin.org>
Fix PR tree-optimization/20458
* tree-flow-inline.h (mark_call_clobbered): Don't fiddle
DECL_EXTERNAL on STRUCT_FIELD tags.
(clear_call_clobbered): Ditto.
* tree-ssa-operands.c (note_addressable): Make sure the original
variable doesn't slip into the addressable list if we have
subvars.
* tree-tailcall.c (suitable_for_tail_opt_p): Look at STRUCT_FIELD
tags too.
From-SVN: r96462
Diffstat (limited to 'gcc/tree-tailcall.c')
-rw-r--r-- | gcc/tree-tailcall.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/tree-tailcall.c b/gcc/tree-tailcall.c index 8f4778d..3c2036c 100644 --- a/gcc/tree-tailcall.c +++ b/gcc/tree-tailcall.c @@ -137,14 +137,15 @@ suitable_for_tail_opt_p (void) if (current_function_stdarg) return false; - /* No local variable should be call-clobbered. We ignore any kind - of memory tag, as these are not real variables. */ + /* No local variable nor structure field should be call-clobbered. We + ignore any kind of memory tag, as these are not real variables. */ for (i = 0; i < (int) VARRAY_ACTIVE_SIZE (referenced_vars); i++) { tree var = VARRAY_TREE (referenced_vars, i); if (!(TREE_STATIC (var) || DECL_EXTERNAL (var)) - && var_ann (var)->mem_tag_kind == NOT_A_TAG + && (var_ann (var)->mem_tag_kind == NOT_A_TAG + || var_ann (var)->mem_tag_kind == STRUCT_FIELD) && is_call_clobbered (var)) return false; } |