This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fixing PR fortran/3924.
- From: Richard Henderson <rth at redhat dot com>
- To: Toon Moene <toon at moene dot indiv dot nluug dot nl>
- Cc: gcc-patches at gcc dot gnu dot org, pavenis at latnet dot lv
- Date: Mon, 16 Sep 2002 23:05:52 -0700
- Subject: Re: Fixing PR fortran/3924.
- References: <3D848645.60708@moene.indiv.nluug.nl>
On Sun, Sep 15, 2002 at 03:08:21PM +0200, Toon Moene wrote:
> if (GET_CODE (value) == MEM
> - && GET_CODE (XEXP (value, 0)) == SYMBOL_REF)
> + && GET_CODE (XEXP (value, 0)) == SYMBOL_REF
> + && GET_CODE (XEXP (XEXP (value, 0), 0) != PLUS
> + && GET_CODE (XEXP (XEXP (value, 0), 0) != MINUS)
This isn't right. The only argument for SYMBOL_REF
is XSTR (blah, 0), which is a string. A PLUS/MINUS
would have to come elsewhere. E.g.
else if (GET_CODE (value) == MEM && GET_CODE (XEXP (value, 0)) == CONST)
{
/* Handle an obscure case which can arise when optimizing and
when there are few available registers. (This is *always*
the case for i386/i486 targets). The DECL_RTL looks like
(MEM (CONST ...)) even though this variable is a local `auto'
or a local `register' variable. In effect, what has happened
is that the reload pass has seen that all assignments and
references for one such a local variable can be replaced by
equivalent assignments and references to some static storage
variable, thereby avoiding the need for a register. In such
cases we're forced to lie to debuggers and tell them that
this variable was itself `static'. */
PUT_SDB_DEF (name);
PUT_SDB_VAL (XEXP (XEXP (value, 0), 0));
PUT_SDB_SCL (C_STAT);
Indeed, removing this hunk appears to fix the problem.
Verified via cross-compiler to msdjgpp.
r~
* sdbout.c (sdbout_symbol): Don't handle offsets from a symbol.
Index: sdbout.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/sdbout.c,v
retrieving revision 1.71
diff -c -p -d -r1.71 sdbout.c
*** sdbout.c 15 Aug 2002 19:59:29 -0000 1.71
--- sdbout.c 17 Sep 2002 06:04:02 -0000
*************** sdbout_symbol (decl, local)
*** 924,946 ****
PUT_SDB_INT_VAL (DEBUGGER_AUTO_OFFSET (XEXP (value, 0)));
PUT_SDB_SCL (C_AUTO);
}
- else if (GET_CODE (value) == MEM && GET_CODE (XEXP (value, 0)) == CONST)
- {
- /* Handle an obscure case which can arise when optimizing and
- when there are few available registers. (This is *always*
- the case for i386/i486 targets). The DECL_RTL looks like
- (MEM (CONST ...)) even though this variable is a local `auto'
- or a local `register' variable. In effect, what has happened
- is that the reload pass has seen that all assignments and
- references for one such a local variable can be replaced by
- equivalent assignments and references to some static storage
- variable, thereby avoiding the need for a register. In such
- cases we're forced to lie to debuggers and tell them that
- this variable was itself `static'. */
- PUT_SDB_DEF (name);
- PUT_SDB_VAL (XEXP (XEXP (value, 0), 0));
- PUT_SDB_SCL (C_STAT);
- }
else
{
/* It is something we don't know how to represent for SDB. */
--- 924,929 ----