From 1aee3ab6f3ee78281b71429bf2bc2613922fd4fb Mon Sep 17 00:00:00 2001 From: Andrew Pinski Date: Tue, 6 May 2008 03:47:29 +0000 Subject: [PATCH] re PR middle-end/36141 (Gcc 4.4 failed to boostrap) 2008-05-05 Andrew Pinski PR middle-end/36141 * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Don't create VCE for function decls. 2008-05-05 Andrew Pinski PR middle-end/36141 * gcc.c-torture/pr36141.c: New testcase. From-SVN: r134972 --- gcc/ChangeLog | 6 ++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.c-torture/pr36141.c | 17 +++++++++++++++++ gcc/tree-ssa-forwprop.c | 3 +++ 4 files changed, 31 insertions(+) create mode 100644 gcc/testsuite/gcc.c-torture/pr36141.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5fe9f63cce2..aba462fbd8d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2008-05-05 Andrew Pinski + + PR middle-end/36141 + * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Don't create VCE + for function decls. + 2008-05-05 H.J. Lu * config/i386/sse.md (sse2_3): Fix a typo. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9adb755b600..ecae39579e6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-05-05 Andrew Pinski + + PR middle-end/36141 + * gcc.c-torture/pr36141.c: New testcase. + 2008-05-06 Danny Smith * lib/target_supports.exp (check_effective_target_4byte_wchar_t): diff --git a/gcc/testsuite/gcc.c-torture/pr36141.c b/gcc/testsuite/gcc.c-torture/pr36141.c new file mode 100644 index 00000000000..82756199b77 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/pr36141.c @@ -0,0 +1,17 @@ +extern void ffi_closure_unix (void); +ffi_prep_closure_loc (void) +{ + struct ia64_fd + { + unsigned long long code_pointer; + unsigned long long gp; + }; + struct ffi_ia64_trampoline_struct + { + unsigned long long code_pointer; + }; + struct ffi_ia64_trampoline_struct *tramp; + struct ia64_fd *fd; + fd = (struct ia64_fd *)(void *)ffi_closure_unix; + tramp->code_pointer = fd->code_pointer; +} diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c index 9fbf58d853d..31322b65791 100644 --- a/gcc/tree-ssa-forwprop.c +++ b/gcc/tree-ssa-forwprop.c @@ -657,6 +657,9 @@ forward_propagate_addr_expr_1 (tree name, tree def_rhs, tree use_stmt, && TREE_OPERAND (rhs, 0) == name && TYPE_SIZE (TREE_TYPE (rhs)) && TYPE_SIZE (TREE_TYPE (TREE_OPERAND (def_rhs, 0))) + /* Function decls should not be used for VCE either as it could be + a function descriptor that we want and not the actual function code. */ + && TREE_CODE (TREE_OPERAND (def_rhs, 0)) != FUNCTION_DECL /* We should not convert volatile loads to non volatile loads. */ && !TYPE_VOLATILE (TREE_TYPE (rhs)) && !TYPE_VOLATILE (TREE_TYPE (TREE_OPERAND (def_rhs, 0))) -- 2.30.2