------- Comment #17 from bonzini at gnu dot org 2008-05-02 16:29 ------- I wonder if your patch would be a problem because it sometimes removes a CONST wrapping. It could also be possible to precede the CONST_INT optimization with another test for two adjacent CONSTANT_P:
if (GET_CODE (ops[n_ops - 1]) == CONST_INT) i = n_ops - 2; else i = n_ops - 1; if (i >= 1 && ops[i].neg && !ops[i - 1].neg && CONSTANT_P (ops[i].op) && GET_CODE (ops[i].op) == GET_CODE (ops[i - 1].op)) { ops[i - 1].op = gen_rtx_MINUS (mode, ops[i - 1].op, ops[i].op); ops[i - 1].op = gen_rtx_CONST (mode, ops[i - 1].op); if (i < n_ops - 1) ops[i] = op[i + 1]; n_ops--; } Keeping together a (minus (symbol_ref) (symbol_ref)), which could also be a (minus (label_ref (label_ref)), seems like a good idea. Does this work? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36090