On Fri, Sep 5, 2008 at 7:25 AM, Hans-Peter Nilsson <[EMAIL PROTECTED]> wrote: >> Date: Fri, 05 Sep 2008 12:55:17 +0200 >> From: Paolo Bonzini <[EMAIL PROTECTED]>
> 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.) >> 3) adding a check that the MINUS is a legitimate address, and only wrap >> it in CONST if it is. simplify_plus_minus was tearing apart and reordering (CONST (MINUS (SYMBOL_REF1) (SYMBOL_REF2))) when combined with (PLUS (REG) (CONST_INT)) binding the CONST_INT more tightly with one of the SYMBOL_REFs The rs6000 port needs the SYMBOL_REFs bound tightly and simplify_plus_minus should not insist that a CONST_INT is better. CRIS and other ports are experiencing problems because the new algorithm in simplify_plus_minus is creating the CONST difference of SYMBOL_REFs in different sections. Instead of trying to teach simplify_plus_minus the precedence of these objects, should there be some RTL idiom(s) of (CONST (MINUS (X) (Y))) that it leaves untouched? Thanks, David