diff options
author | Michael Matz <matz@suse.de> | 2009-09-16 16:12:18 +0000 |
---|---|---|
committer | Michael Matz <matz@gcc.gnu.org> | 2009-09-16 16:12:18 +0000 |
commit | 9b87db3c0fc95b7f76fcdc38e21371dff155ee4b (patch) | |
tree | 16bc7e6ccab2dd7b94d385eb0dc4572ffb988dc7 /gcc/tree.h | |
parent | 798763075fa686158fc9b40b2e6b3bc57320dd5a (diff) | |
download | gcc-9b87db3c0fc95b7f76fcdc38e21371dff155ee4b.zip gcc-9b87db3c0fc95b7f76fcdc38e21371dff155ee4b.tar.gz gcc-9b87db3c0fc95b7f76fcdc38e21371dff155ee4b.tar.bz2 |
re PR fortran/41212 (miscompilation at -O2)
PR fortran/41212
* tree.h (struct tree_decl_common): Add decl_restricted_flag,
shorten decl_common_unused.
(DECL_RESTRICTED_P): New accessor.
* tree-ssa-alias.c (ptr_deref_may_alias_decl_p): Use it
to disambiguate marked decls and restrict pointers.
fortran/
* trans.h (struct lang_type): Remove nontarget_type member.
* trans.c (gfc_add_modify): Don't access it.
* trans-decl.c (gfc_finish_var_decl): Don't allocate and set it,
instead set DECL_RESTRICTED_P on affected decls.
testsuite/
* gfortran.dg/pr41212.f90: New test.
From-SVN: r151761
Diffstat (limited to 'gcc/tree.h')
-rw-r--r-- | gcc/tree.h | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -1306,6 +1306,15 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int, (TREE_CHECK3 (NODE, VAR_DECL, PARM_DECL, \ RESULT_DECL)->decl_common.decl_by_reference_flag) +/* In a RESULT_DECL, PARM_DECL and VAR_DECL, means that this decl + can be used as restricted tag to disambiguate against other restrict + pointers. Used by fortran to capture something like non-addressability + (which it isn't really because the middle-end does take addresses of + such variables). */ +#define DECL_RESTRICTED_P(NODE) \ + (TREE_CHECK3 (NODE, VAR_DECL, PARM_DECL, \ + RESULT_DECL)->decl_common.decl_restricted_flag) + /* In a CALL_EXPR, means that the call is the jump from a thunk to the thunked-to function. */ #define CALL_FROM_THUNK_P(NODE) (CALL_EXPR_CHECK (NODE)->base.protected_flag) @@ -2646,8 +2655,10 @@ struct GTY(()) tree_decl_common { unsigned gimple_reg_flag : 1; /* In VAR_DECL, PARM_DECL and RESULT_DECL, this is DECL_BY_REFERENCE. */ unsigned decl_by_reference_flag : 1; + /* In VAR_DECL, PARM_DECL and RESULT_DECL, this is DECL_RESTRICTED_P. */ + unsigned decl_restricted_flag : 1; /* Padding so that 'off_align' can be on a 32-bit boundary. */ - unsigned decl_common_unused : 4; + unsigned decl_common_unused : 3; /* DECL_OFFSET_ALIGN, used only for FIELD_DECLs. */ unsigned int off_align : 8; |