aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2003-03-24 08:31:36 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2003-03-24 08:31:36 +0000
commitf29a2bd17dbd3bcd89fabb4af8e9c5aa7dd8d223 (patch)
tree85eda9fd606f02112ed55c3f9d9703201269055d /gcc
parentffe4ebba87d78d4da242adb6e95d2976bd796d91 (diff)
downloadgcc-f29a2bd17dbd3bcd89fabb4af8e9c5aa7dd8d223.zip
gcc-f29a2bd17dbd3bcd89fabb4af8e9c5aa7dd8d223.tar.gz
gcc-f29a2bd17dbd3bcd89fabb4af8e9c5aa7dd8d223.tar.bz2
re PR c++/7086 (compile time regression)
PR c++/7086 * c-typeck.c (c_mark_addressable): Adjust calls to put_var_into_stack. * expr.c (expand_expr): Likewise. * function.c (put_var_into_stack): Add rescan parameter. Do not call fixup_var_refs when rescan is false. (gen_mem_addressof): Likewise. (assign_parms): Adjust calls to put_var_into_stack. (setjmp_protect): Likewise. (setjmp_protect_args): Likewise. * rtl.h (gen_mem_addressof): Change prototype. * stmt.c (expand_decl): Adjust calls to put_var_into_stack. * tree.h (put_var_into_stack): Change prototype. PR c++/7086 * utils2.c: Adjust calls to put_var_into_stack. PR c++/7086 * semantics.c (genrtl_named_return_value): Adjust calls to put_var_into_stack. * typeck.c (cxx_mark_addressable): Likewise. PR c++/7086 * com.c (ffecom_sym_transform_): Adjust calls to put_var_into_stack. (ffe_mark_addressable): Likewise. From-SVN: r64781
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog16
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/utils2.c2
-rw-r--r--gcc/c-typeck.c2
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/typeck.c2
-rw-r--r--gcc/expr.c12
-rw-r--r--gcc/f/ChangeLog7
-rw-r--r--gcc/f/com.c4
-rw-r--r--gcc/function.c39
-rw-r--r--gcc/rtl.h2
-rw-r--r--gcc/stmt.c2
-rw-r--r--gcc/tree.h2
13 files changed, 72 insertions, 28 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 10d0aae..aea37fb 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,19 @@
+2003-03-23 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/7086
+ * c-typeck.c (c_mark_addressable): Adjust calls to
+ put_var_into_stack.
+ * expr.c (expand_expr): Likewise.
+ * function.c (put_var_into_stack): Add rescan parameter. Do not
+ call fixup_var_refs when rescan is false.
+ (gen_mem_addressof): Likewise.
+ (assign_parms): Adjust calls to put_var_into_stack.
+ (setjmp_protect): Likewise.
+ (setjmp_protect_args): Likewise.
+ * rtl.h (gen_mem_addressof): Change prototype.
+ * stmt.c (expand_decl): Adjust calls to put_var_into_stack.
+ * tree.h (put_var_into_stack): Change prototype.
+
2003-03-23 Arpad Beszedes <beszedes@cc.u-szeged.hu>
PR middle-end/9967
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index e2733f9..dfca138 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,8 @@
+2003-03-23 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/7086
+ * utils2.c: Adjust calls to put_var_into_stack.
+
2003-03-12 Nathanael Nerode <neroden@gcc.gnu.org>
* Make-lang.in, Makefile.in, config-lang.in: GCC, not GNU CC.
diff --git a/gcc/ada/utils2.c b/gcc/ada/utils2.c
index 1d76d91..131aeec 100644
--- a/gcc/ada/utils2.c
+++ b/gcc/ada/utils2.c
@@ -2038,7 +2038,7 @@ gnat_mark_addressable (expr_node)
case VAR_DECL:
case PARM_DECL:
case RESULT_DECL:
- put_var_into_stack (expr_node);
+ put_var_into_stack (expr_node, /*rescan=*/true);
TREE_ADDRESSABLE (expr_node) = 1;
return true;
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index dc5b9d5..8fbcd86 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -3346,7 +3346,7 @@ c_mark_addressable (exp)
pedwarn ("address of register variable `%s' requested",
IDENTIFIER_POINTER (DECL_NAME (x)));
}
- put_var_into_stack (x);
+ put_var_into_stack (x, /*rescan=*/true);
/* drops in */
case FUNCTION_DECL:
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index ecc9bda..68c1716 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2003-03-23 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/7086
+ * typeck.c (cxx_mark_addressable): Likewise.
+
2003-03-22 Nathan Sidwell <nathan@codesourcery.com>
PR c++/9978, c++/9708
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 142b128..45d528f 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -4744,7 +4744,7 @@ cxx_mark_addressable (exp)
warning ("address requested for `%D', which is declared `register'",
x);
TREE_ADDRESSABLE (x) = 1;
- put_var_into_stack (x);
+ put_var_into_stack (x, /*rescan=*/true);
return true;
case FUNCTION_DECL:
diff --git a/gcc/expr.c b/gcc/expr.c
index 926a18e..a957dd7 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -6919,7 +6919,7 @@ expand_expr (exp, target, tmode, modifier)
temp = SAVE_EXPR_RTL (exp);
if (temp && GET_CODE (temp) == REG)
{
- put_var_into_stack (exp);
+ put_var_into_stack (exp, /*rescan=*/true);
temp = SAVE_EXPR_RTL (exp);
}
if (temp == 0 || GET_CODE (temp) != MEM)
@@ -7413,7 +7413,8 @@ expand_expr (exp, target, tmode, modifier)
forcing the SAVE_EXPR into memory. */
if (TREE_CODE (TREE_OPERAND (exp, 0)) == SAVE_EXPR)
{
- put_var_into_stack (TREE_OPERAND (exp, 0));
+ put_var_into_stack (TREE_OPERAND (exp, 0),
+ /*rescan=*/true);
op0 = SAVE_EXPR_RTL (TREE_OPERAND (exp, 0));
}
else
@@ -9001,7 +9002,7 @@ expand_expr (exp, target, tmode, modifier)
preserve_temp_slots (target);
SET_DECL_RTL (slot, target);
if (TREE_ADDRESSABLE (slot))
- put_var_into_stack (slot);
+ put_var_into_stack (slot, /*rescan=*/false);
/* Since SLOT is not known to the called function
to belong to its stack frame, we must build an explicit
@@ -9040,7 +9041,7 @@ expand_expr (exp, target, tmode, modifier)
/* If we must have an addressable slot, then make sure that
the RTL that we just stored in slot is OK. */
if (TREE_ADDRESSABLE (slot))
- put_var_into_stack (slot);
+ put_var_into_stack (slot, /*rescan=*/true);
}
}
@@ -9190,7 +9191,8 @@ expand_expr (exp, target, tmode, modifier)
forcing the SAVE_EXPR into memory. */
if (TREE_CODE (TREE_OPERAND (exp, 0)) == SAVE_EXPR)
{
- put_var_into_stack (TREE_OPERAND (exp, 0));
+ put_var_into_stack (TREE_OPERAND (exp, 0),
+ /*rescan=*/true);
op0 = SAVE_EXPR_RTL (TREE_OPERAND (exp, 0));
}
else
diff --git a/gcc/f/ChangeLog b/gcc/f/ChangeLog
index 848f649..46c3309 100644
--- a/gcc/f/ChangeLog
+++ b/gcc/f/ChangeLog
@@ -1,3 +1,10 @@
+Sun Mar 23 23:43:45 2003 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/7086
+ * com.c (ffecom_sym_transform_): Adjust calls to
+ put_var_into_stack.
+ (ffe_mark_addressable): Likewise.
+
2003-03-22 Bud Davis <bdavis9659@comcast.net>
* com.c (ffecom_constantunion_with_type): New function.
diff --git a/gcc/f/com.c b/gcc/f/com.c
index b850774..b63e2ea 100644
--- a/gcc/f/com.c
+++ b/gcc/f/com.c
@@ -7443,7 +7443,7 @@ ffecom_sym_transform_ (ffesymbol s)
assert (et != NULL_TREE);
if (! TREE_STATIC (et))
- put_var_into_stack (et);
+ put_var_into_stack (et, /*rescan=*/true);
offset = ffestorag_modulo (est)
+ ffestorag_offset (ffesymbol_storage (s))
@@ -14294,7 +14294,7 @@ ffe_mark_addressable (tree exp)
}
assert ("address of register var requested" == NULL);
}
- put_var_into_stack (x);
+ put_var_into_stack (x, /*rescan=*/true);
/* drops in */
case FUNCTION_DECL:
diff --git a/gcc/function.c b/gcc/function.c
index 56f2ecc..2749c9a 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -1304,12 +1304,16 @@ init_temp_slots ()
target_temp_slot_level = 0;
}
-/* Retroactively move an auto variable from a register to a stack slot.
- This is done when an address-reference to the variable is seen. */
+/* Retroactively move an auto variable from a register to a stack
+ slot. This is done when an address-reference to the variable is
+ seen. If RESCAN is true, all previously emitted instructions are
+ examined and modified to handle the fact that DECL is now
+ addressable. */
void
-put_var_into_stack (decl)
+put_var_into_stack (decl, rescan)
tree decl;
+ bool rescan;
{
rtx reg;
enum machine_mode promoted_mode, decl_mode;
@@ -1384,7 +1388,7 @@ put_var_into_stack (decl)
to put things in the stack for the sake of setjmp, try to keep it
in a register until we know we actually need the address. */
if (can_use_addressof)
- gen_mem_addressof (reg, decl);
+ gen_mem_addressof (reg, decl, rescan);
else
put_reg_into_stack (function, reg, TREE_TYPE (decl), promoted_mode,
decl_mode, volatilep, 0, usedp, 0);
@@ -1431,7 +1435,7 @@ put_var_into_stack (decl)
/* Prevent sharing of rtl that might lose. */
if (GET_CODE (XEXP (reg, 0)) == PLUS)
XEXP (reg, 0) = copy_rtx (XEXP (reg, 0));
- if (usedp)
+ if (usedp && rescan)
{
schedule_fixup_var_refs (function, reg, TREE_TYPE (decl),
promoted_mode, 0);
@@ -2871,15 +2875,19 @@ static int cfa_offset;
#define ARG_POINTER_CFA_OFFSET(FNDECL) FIRST_PARM_OFFSET (FNDECL)
#endif
-/* Build up a (MEM (ADDRESSOF (REG))) rtx for a register REG that just had its
- address taken. DECL is the decl or SAVE_EXPR for the object stored in the
- register, for later use if we do need to force REG into the stack. REG is
- overwritten by the MEM like in put_reg_into_stack. */
+/* Build up a (MEM (ADDRESSOF (REG))) rtx for a register REG that just
+ had its address taken. DECL is the decl or SAVE_EXPR for the
+ object stored in the register, for later use if we do need to force
+ REG into the stack. REG is overwritten by the MEM like in
+ put_reg_into_stack. RESCAN is true if previously emitted
+ instructions must be rescanned and modified now that the REG has
+ been transformed. */
rtx
-gen_mem_addressof (reg, decl)
+gen_mem_addressof (reg, decl, rescan)
rtx reg;
tree decl;
+ bool rescan;
{
rtx r = gen_rtx_ADDRESSOF (Pmode, gen_reg_rtx (GET_MODE (reg)),
REGNO (reg), decl);
@@ -2917,10 +2925,11 @@ gen_mem_addressof (reg, decl)
if (DECL_P (decl) && decl_rtl == reg)
SET_DECL_RTL (decl, reg);
- if (TREE_USED (decl) || (DECL_P (decl) && DECL_INITIAL (decl) != 0))
+ if (rescan
+ && (TREE_USED (decl) || (DECL_P (decl) && DECL_INITIAL (decl) != 0)))
fixup_var_refs (reg, GET_MODE (reg), TREE_UNSIGNED (type), reg, 0);
}
- else
+ else if (rescan)
fixup_var_refs (reg, GET_MODE (reg), 0, reg, 0);
return reg;
@@ -4984,7 +4993,7 @@ assign_parms (fndecl)
stack. So, we go back to that sequence, just so that
the fixups will happen. */
push_to_sequence (conversion_insns);
- put_var_into_stack (parm);
+ put_var_into_stack (parm, /*rescan=*/true);
conversion_insns = get_insns ();
end_sequence ();
}
@@ -5513,7 +5522,7 @@ setjmp_protect (block)
||
#endif
! DECL_REGISTER (decl)))
- put_var_into_stack (decl);
+ put_var_into_stack (decl, /*rescan=*/true);
for (sub = BLOCK_SUBBLOCKS (block); sub; sub = TREE_CHAIN (sub))
setjmp_protect (sub);
}
@@ -5540,7 +5549,7 @@ setjmp_protect_args ()
||
#endif
! DECL_REGISTER (decl)))
- put_var_into_stack (decl);
+ put_var_into_stack (decl, /*rescan=*/true);
}
/* Return the context-pointer register corresponding to DECL,
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 4bb760b..0232c43 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -1577,7 +1577,7 @@ extern rtx simplify_rtx PARAMS ((rtx));
extern rtx avoid_constant_pool_reference PARAMS ((rtx));
/* In function.c */
-extern rtx gen_mem_addressof PARAMS ((rtx, tree));
+extern rtx gen_mem_addressof PARAMS ((rtx, tree, bool));
/* In regclass.c */
extern enum machine_mode choose_hard_reg_mode PARAMS ((unsigned int,
diff --git a/gcc/stmt.c b/gcc/stmt.c
index d8f36c5..642a5b1 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -3943,7 +3943,7 @@ expand_decl (decl)
/* If something wants our address, try to use ADDRESSOF. */
if (TREE_ADDRESSABLE (decl))
- put_var_into_stack (decl);
+ put_var_into_stack (decl, /*rescan=*/false);
}
else if (TREE_CODE (DECL_SIZE_UNIT (decl)) == INTEGER_CST
diff --git a/gcc/tree.h b/gcc/tree.h
index 4dd753a..a55374d 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -2987,7 +2987,7 @@ extern void expand_dummy_function_end PARAMS ((void));
extern void init_function_for_compilation PARAMS ((void));
extern void init_function_start PARAMS ((tree, const char *, int));
extern void assign_parms PARAMS ((tree));
-extern void put_var_into_stack PARAMS ((tree));
+extern void put_var_into_stack PARAMS ((tree, bool));
extern void flush_addressof PARAMS ((tree));
extern void uninitialized_vars_warning PARAMS ((tree));
extern void setjmp_args_warning PARAMS ((void));