[Bug c/61240] [6/7/8 Regression] Incorrect warning "integer overflow in expression" on pointer-pointer subtraction

2018-01-18 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61240 --- Comment #19 from Jakub Jelinek --- Author: jakub Date: Thu Jan 18 08:29:14 2018 New Revision: 256838 URL: https://gcc.gnu.org/viewcvs?rev=256838=gcc=rev Log: PR c/61240 * match.pd ((P + A) - P, P - (P + A), (P + A) - (P +

[Bug c/61240] [6/7/8 Regression] Incorrect warning "integer overflow in expression" on pointer-pointer subtraction

2018-01-17 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61240 --- Comment #18 from Marc Glisse --- (In reply to Jakub Jelinek from comment #17) > Created attachment 43162 [details] > gcc8-pr61240.patch > > The C FE doesn't do this optimization anymore, but c_fully_fold does because > the generic folding

[Bug c/61240] [6/7/8 Regression] Incorrect warning "integer overflow in expression" on pointer-pointer subtraction

2018-01-17 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61240 --- Comment #17 from Jakub Jelinek --- Created attachment 43162 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43162=edit gcc8-pr61240.patch The C FE doesn't do this optimization anymore, but c_fully_fold does because the generic folding

[Bug c/61240] [6/7/8 Regression] Incorrect warning "integer overflow in expression" on pointer-pointer subtraction

2018-01-16 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61240 --- Comment #16 from Jakub Jelinek --- It is a regression, so it isn't too late yet.

[Bug c/61240] [6/7/8 Regression] Incorrect warning "integer overflow in expression" on pointer-pointer subtraction

2018-01-16 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61240 --- Comment #15 from Marek Polacek --- I've been meaning to address this PR (for too long, apparently), but it seems it's too late for GCC 8 now. If you want, you can take it. If not, hopefully I'll get to it for GCC 9.

[Bug c/61240] [6/7/8 Regression] Incorrect warning "integer overflow in expression" on pointer-pointer subtraction

2018-01-16 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61240 --- Comment #14 from Jakub Jelinek --- Marek, are you still on the hook to remove this premature optimization from the FE and let it be folded in c_fully_fold or later?