This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61240

--- Comment #18 from Marc Glisse <glisse at gcc dot gnu.org> ---
(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 code folds it.  This should fix that.  Can't reproduce
> warning with C++.

I had no idea that convert and view_convert would not be equivalent here, it is
great that the fix is so simple, thanks.
(Maybe some day pointer_plus will take a signed argument and this will become
unnecessary...)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]