This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Weekly reminder: [RFA:] expr.c and test-case, obvious: don't honor flag_force_addr outside function context.
- From: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- To: rth at redhat dot com
- Cc: hans-peter dot nilsson at axis dot com, gcc-patches at gcc dot gnu dot org
- Date: Thu, 13 Dec 2001 03:08:56 +0100
- Subject: Re: Weekly reminder: [RFA:] expr.c and test-case, obvious: don't honor flag_force_addr outside function context.
> Date: Wed, 12 Dec 2001 16:50:45 -0800
> From: Richard Henderson <rth@redhat.com>
> On Tue, Dec 11, 2001 at 01:02:12PM +0100, Hans-Peter Nilsson wrote:
> > Unreviewed patch. *Almost* obvious.
> > <URL:http://gcc.gnu.org/ml/gcc-patches/2001-11/msg01615.html>
>
> Most of the other similar places in expand_expr also check
>
> && modifier != EXPAND_CONST_ADDRESS
> && modifier != EXPAND_INITIALIZER
> && modifier != EXPAND_SUM
>
> I think that would be reasonable here as well, and would
> almost certainly cure your problem.
First of all: Ok to commit the test-case?
Thanks for reviewing this.
I'm not sure I understand what you mean to change. I interpret
what you say as "use this instead of cfun != 0", (because
further constraining tests can't break things, so the last part
of your sentence wouldn't make sense if you meant "in addition
to cfun != 0"). I'm testing this on the same systems, with
cris-elf build finished and now into the testing phase.
* expr.c (expand_expr, case ADDR_EXPR): Don't honor
flag_force_addr for modifier != EXPAND_CONST_ADDRESS,
modifier != EXPAND_INITIALIZER and modifier != EXPAND_SUM.
Index: expr.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/expr.c,v
retrieving revision 1.396
diff -p -c -r1.396 expr.c
*** expr.c 2001/12/11 23:02:47 1.396
--- expr.c 2001/12/13 01:57:55
*************** expand_expr (exp, target, tmode, modifie
*** 8542,8548 ****
op0 = force_operand (XEXP (op0, 0), target);
}
! if (flag_force_addr && GET_CODE (op0) != REG)
op0 = force_reg (Pmode, op0);
if (GET_CODE (op0) == REG
--- 8542,8552 ----
op0 = force_operand (XEXP (op0, 0), target);
}
! if (flag_force_addr
! && GET_CODE (op0) != REG
! && modifier != EXPAND_CONST_ADDRESS
! && modifier != EXPAND_INITIALIZER
! && modifier != EXPAND_SUM)
op0 = force_reg (Pmode, op0);
if (GET_CODE (op0) == REG
brgds, H-P