Re: [PATCH] Avoid introducing undefined behavior in sccp (PR tree-optimization/59387)

2014-01-13 Thread Jakub Jelinek
On Mon, Jan 13, 2014 at 11:42:11AM +0100, Richard Biener wrote: > > + if (TREE_CODE (def) == INTEGER_CST && TREE_OVERFLOW (def)) > > TREE_OVERFLOW_P (), but it seems to me that the SCEV machinery > should do this at a good place (like where it finally records > the result into its cache before

Re: [PATCH] Avoid introducing undefined behavior in sccp (PR tree-optimization/59387)

2014-01-13 Thread Richard Biener
On Fri, 10 Jan 2014, Jakub Jelinek wrote: > Hi! > > If folded_casts is true, sccp can introduce undefined behavior even when > there was none in the original loop, e.g. all actual additions performed in > unsigned type and then cast back to signed. > > The following patch fixes that by turning t

[PATCH] Avoid introducing undefined behavior in sccp (PR tree-optimization/59387)

2014-01-10 Thread Jakub Jelinek
Hi! If folded_casts is true, sccp can introduce undefined behavior even when there was none in the original loop, e.g. all actual additions performed in unsigned type and then cast back to signed. The following patch fixes that by turning the arithmetic stmts added by sccp use unsigned operations