[Bug c++/70170] [6 regression] bogus not a constant expression error comparing pointer to array to null

2016-04-02 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70170 Martin Sebor changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|---

[Bug c++/70170] [6 regression] bogus not a constant expression error comparing pointer to array to null

2016-04-02 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70170 --- Comment #12 from Martin Sebor --- Author: msebor Date: Sat Apr 2 17:14:48 2016 New Revision: 234698 URL: https://gcc.gnu.org/viewcvs?rev=234698=gcc=rev Log: PR c++/67376 - [5/6 regression] Comparison with pointer to past-the-end of

[Bug c++/70170] [6 regression] bogus not a constant expression error comparing pointer to array to null

2016-03-14 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70170 Martin Sebor changed: What|Removed |Added Assignee|mpolacek at gcc dot gnu.org|msebor at gcc dot gnu.org ---

[Bug c++/70170] [6 regression] bogus not a constant expression error comparing pointer to array to null

2016-03-11 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70170 --- Comment #10 from Jakub Jelinek --- (In reply to Jason Merrill from comment #9) > (In reply to Jakub Jelinek from comment #7) > > A small problem is that the second argument to POINTER_PLUS_EXPR is not > > signed, but unsigned (sizetype).

[Bug c++/70170] [6 regression] bogus not a constant expression error comparing pointer to array to null

2016-03-11 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70170 --- Comment #9 from Jason Merrill --- (In reply to Jakub Jelinek from comment #7) > A small problem is that the second argument to POINTER_PLUS_EXPR is not > signed, but unsigned (sizetype). Which is why I wrote "negative", negative > would

[Bug c++/70170] [6 regression] bogus not a constant expression error comparing pointer to array to null

2016-03-11 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70170 --- Comment #8 from Marek Polacek --- Ah, true... well there's wi::sign_mask so maybe that. But given Comment 5 I'll hold off for now.

[Bug c++/70170] [6 regression] bogus not a constant expression error comparing pointer to array to null

2016-03-11 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70170 --- Comment #7 from Jakub Jelinek --- A small problem is that the second argument to POINTER_PLUS_EXPR is not signed, but unsigned (sizetype). Which is why I wrote "negative", negative would mean having the most significant bit set or so.

[Bug c++/70170] [6 regression] bogus not a constant expression error comparing pointer to array to null

2016-03-11 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70170 --- Comment #6 from Marek Polacek --- -fno-delete-null-pointer-checks seems to change nothing. But the case you mention is something I wanted to think about more before posting a real patch. I suppose I could add a check that the offset part

[Bug c++/70170] [6 regression] bogus not a constant expression error comparing pointer to array to null

2016-03-11 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70170 --- Comment #5 from Martin Sebor --- It turns out that my patch for bug 67376 (still being tested) fixes this bug.

[Bug c++/70170] [6 regression] bogus not a constant expression error comparing pointer to array to null

2016-03-11 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70170 --- Comment #4 from Jakub Jelinek --- Shouldn't -fno-delete-null-pointer-checks disable that? Or maybe only if the constant is "negative", because with -fno-delete-null-pointer-checks in theory some object could live at address NULL and you

[Bug c++/70170] [6 regression] bogus not a constant expression error comparing pointer to array to null

2016-03-11 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70170 --- Comment #3 from Marek Polacek --- I think that to fix this, we need to add a new pattern to match.pd that deals with "(ptr +p off) !=/== 0B". Thus something like: --- a/gcc/match.pd +++ b/gcc/match.pd @@ -2263,6 +2263,11 @@

[Bug c++/70170] [6 regression] bogus not a constant expression error comparing pointer to array to null

2016-03-11 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70170 Marek Polacek changed: What|Removed |Added Status|NEW |ASSIGNED CC|

[Bug c++/70170] [6 regression] bogus not a constant expression error comparing pointer to array to null

2016-03-11 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70170 Jakub Jelinek changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed|

[Bug c++/70170] [6 regression] bogus not a constant expression error comparing pointer to array to null

2016-03-11 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70170 Richard Biener changed: What|Removed |Added Priority|P3 |P1 Target Milestone|---