On Tue, Nov 20, 2012 at 11:46:06AM -0600, Aldy Hernandez wrote:
> The problem here is that the SLSR pass is promoting a
> POINTER_PLUS_EXPR to a PLUS_EXPR. Since pointer arithmetic is
> invalid in {PLUS,MINUS}_EXPR's, the gimple verifier chokes on the
> invalid statement.
>
> Fixed by maintaining the POINTER_PLUS_EXPR when appropriate.
>
> OK for trunk?
Ok, thanks.
> - if (bump.is_negative ())
> + if (bump.is_negative ()
> + && cand_code != POINTER_PLUS_EXPR)
> {
> code = MINUS_EXPR;
> bump = -bump;
I wonder if this isn't unsafe even when bump is the shwi minimum
(say LONG_MIN for LP64 target/64-bit HWI). But sure, it is preexisting
code, so perhaps something for Bill to look at later.
Jakub