This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [BUG/PATCH 2.95.3] [V3 also] rs6000.c tests TREE_ASM_WRITTEN too early.
- To: "David Edelsohn" <dje at watson dot ibm dot com>
- Subject: Re: [BUG/PATCH 2.95.3] [V3 also] rs6000.c tests TREE_ASM_WRITTEN too early.
- From: "Dave Korn" <davek-ml at ntlworld dot com>
- Date: Mon, 15 Jan 2001 00:39:56 -0000
- Cc: "gcc-patches" <gcc-patches at gcc dot gnu dot org>
- References: <200012270301.WAA22570@mal-ach.watson.ibm.com>
Hi David,
In the course of tracking down a couple of testcase regressions cause by
my efforts at adding -mlongcall, I came to feel that if
current_file_function_operand *ever* returns 1 for a given SYMBOL_REF it
should *always* return 1 for the given SYMBOL_REF, and the simplest way to
do that was to set the SYMBOL_REF_FLAG if we were going to return 1. This
fixed both the testcase regressions and the similar failure I was
experiencing with my $HUGE_APP. Keeping the result of c_f_f_o the same in
every pass when it's being deferred for inlining can be quite tricky
otherwise (and doubly so if it recursively calls itself, as was the case
in c-torture/execute/981001-1.c). I thought you might be interested to
see this. I haven't added the pic_flag test in here yet. I was wondering
if maybe the various places that set SYMBOL_REF_FLAG which test for
!DECL_WEAK should also test for virtual functions, or perhaps specifically
for inlined virtual functions?
regards,
DaveK
cvs server: Diffing gcc/config/rs6000
Index: gcc/config/rs6000/rs6000.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.70.4.16
diff -c -3 -p -r1.70.4.16 rs6000.c
*** rs6000.c 2001/01/11 18:02:46 1.70.4.16
--- rs6000.c 2001/01/14 06:23:57
*************** current_file_function_operand (op, mode)
*** 1201,1213 ****
register rtx op;
enum machine_mode mode ATTRIBUTE_UNUSED;
{
return (GET_CODE (op) == SYMBOL_REF
&& (SYMBOL_REF_FLAG (op)
|| (op == XEXP (DECL_RTL (current_function_decl), 0)
&& !DECL_WEAK (current_function_decl))));
}
-
/* Return 1 if this operand is a valid input for a move insn. */
int
--- 1200,1217 ----
register rtx op;
enum machine_mode mode ATTRIBUTE_UNUSED;
{
+
+ if (GET_CODE (op) == SYMBOL_REF
+ && op == XEXP (DECL_RTL (current_function_decl), 0)
+ && !DECL_WEAK (current_function_decl))
+ SYMBOL_REF_FLAG(op) = 1;
+
return (GET_CODE (op) == SYMBOL_REF
&& (SYMBOL_REF_FLAG (op)
|| (op == XEXP (DECL_RTL (current_function_decl), 0)
&& !DECL_WEAK (current_function_decl))));
}
/* Return 1 if this operand is a valid input for a move insn. */
int