> Date: Fri, 05 Sep 2008 12:55:17 +0200
> From: Paolo Bonzini <[EMAIL PROTECTED]>

> > I got negative feedback on that patch (no, not regression
> > results :) on IRC from David Edelsohn and understandably you
> > held off your testing because of this, as for one the patch
> > affects the rs6000 backend.
> 
> What kind of negative feedback?

Oh, just that it was papering over the bug. :)  To be honest, I
hadn't checked myself that the patch was not doing something
like that and it wasn't obvious enough to me.  Still, now being
at stage3, IMHO that's as valid solution a solution as it was
for 4.3.

> The three possibilities I see are:
> 
> 1) removing the wrapping CONST?

Nope, not if it's a (MINUS (symbol_ref sym2) (symbol_ref sym1)).
*If* valid, that's a constant expression and *should* be wrapped
in a CONST.  (No, it's not valid for *any* ELF-target in a
single symbolic expression, at least never when sym1 and sym2
aren't in the same section and sym1 not in the same section as
the code.  ISTR there was some IEEE object format in which it'd
be valid as an expression.)

> 2) using the patch in
> http://gcc.gnu.org/bugzilla/attachment.cgi?id=15620&action=view which
> however just papers around this problem.

Right, that's what's been tested but which got negative
feedback.

> 3) adding a check that the MINUS is a legitimate address, and only wrap
> it in CONST if it is.

s/address/constant/; it's not clear that it's used as an address
at that point; it's just two expressions that gcc tries to
reduce.

But I get the point; I'm leaning towards something like
strengthening that it's a legitimate constant.  See
<http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36182#c12> and
other comments in that PR.  But... should we really redefine
LEGITIMATE_CONSTANT_P and its documentation at this stage?

brgds, H-P

Reply via email to