Re: [PATCH] data-ref: Rework integer handling in split_constant_offset [PR98069]

2020-12-10 Thread Richard Biener
On Thu, 10 Dec 2020, Richard Sandiford wrote: > Richard Biener writes: > >> @@ -812,33 +997,80 @@ split_constant_offset_1 (tree type, tree op0, enum > >> tree_code code, tree op1, > >> } > >> } > >> > >> -/* Expresses EXP as VAR + OFF, where off is a constant. The type of OFF > >> -

Re: [PATCH] data-ref: Rework integer handling in split_constant_offset [PR98069]

2020-12-10 Thread Richard Sandiford via Gcc-patches
Richard Biener writes: >> @@ -812,33 +997,80 @@ split_constant_offset_1 (tree type, tree op0, enum >> tree_code code, tree op1, >> } >> } >> >> -/* Expresses EXP as VAR + OFF, where off is a constant. The type of OFF >> - will be ssizetype. */ >> +/* If EXP has pointer type, try to

Re: [PATCH] data-ref: Rework integer handling in split_constant_offset [PR98069]

2020-12-10 Thread Richard Biener
On Wed, 9 Dec 2020, Richard Sandiford wrote: > PR98069 is about a case in which split_constant_offset miscategorises > an expression of the form: > > int foo; > … > POINTER_PLUS_EXPR > > as: > > base: base > offset: (sizetype) (-foo) * size > init: INT_MIN * size > > “-foo”

[PATCH] data-ref: Rework integer handling in split_constant_offset [PR98069]

2020-12-09 Thread Richard Sandiford via Gcc-patches
PR98069 is about a case in which split_constant_offset miscategorises an expression of the form: int foo; … POINTER_PLUS_EXPR as: base: base offset: (sizetype) (-foo) * size init: INT_MIN * size “-foo” overflows when “foo” is INT_MIN, whereas the original expression didn't overflow