[Bug c/79479] -Woverflow false alarm in unreachable expression

2017-02-15 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79479 Martin Sebor changed: What|Removed |Added Status|WAITING |RESOLVED Resolution|---

[Bug c/79479] -Woverflow false alarm in unreachable expression

2017-02-15 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79479 --- Comment #14 from Paul Eggert --- Thanks, please feel free to mark this as a duplicate of Bug#4210. I plan to follow up there.

[Bug c/79479] -Woverflow false alarm in unreachable expression

2017-02-15 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79479 Martin Sebor changed: What|Removed |Added Status|NEW |WAITING --- Comment #13 from Martin Sebor

[Bug c/79479] -Woverflow false alarm in unreachable expression

2017-02-14 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79479 --- Comment #12 from Paul Eggert --- If the proposed change would introduce significant problems with false positives or false negatives, then surely GCC already has these problems in conditional expressions. These problems ought to be addressed

[Bug c/79479] -Woverflow false alarm in unreachable expression

2017-02-13 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79479 --- Comment #11 from Martin Sebor --- Yes, bug 4210 looks like a duplicate. The test case from attachment 40722 recast in the context of that enhancement request looks like this: int too_large (long x) { const int b = sizeof (int) < si

[Bug c/79479] -Woverflow false alarm in unreachable expression

2017-02-13 Thread joseph at codesourcery dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79479 --- Comment #10 from joseph at codesourcery dot com --- This is arguably the same as or similar to bug 4210 and its duplicates.

[Bug c/79479] -Woverflow false alarm in unreachable expression

2017-02-13 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79479 --- Comment #9 from Paul Eggert --- > 1) It's too subtle for non-expert programmers to understand. Actually, it's typically easy for non-experts to follow this. For example, although GCC falsely warns about this: /*1*/ if (0) return INT_MAX +

[Bug c/79479] -Woverflow false alarm in unreachable expression

2017-02-13 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79479 --- Comment #8 from Martin Sebor --- I understand the distinction, but I don't think it would be helpful to try to make it in the implementation of the warning, for a few reasons: 1) It's too subtle for non-expert programmers to understand. 2) I

[Bug c/79479] -Woverflow false alarm in unreachable expression

2017-02-13 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79479 --- Comment #7 from Paul Eggert --- > the translation of a program that contains an overflowing constant expression > has undefined behavior Sure, but the programs in question do not contain constant expressions in sense of the C standard. They

[Bug c/79479] -Woverflow false alarm in unreachable expression

2017-02-13 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79479 Martin Sebor changed: What|Removed |Added See Also||https://gcc.gnu.org/bugzill

[Bug c/79479] -Woverflow false alarm in unreachable expression

2017-02-13 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79479 Martin Sebor changed: What|Removed |Added CC||msebor at gcc dot gnu.org --- Comment #5

[Bug c/79479] -Woverflow false alarm in unreachable expression

2017-02-13 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79479 --- Comment #4 from Marek Polacek --- I might, but the front ends, where the warning is taking place, can't see that the function always returns early.

[Bug c/79479] -Woverflow false alarm in unreachable expression

2017-02-13 Thread bruno at clisp dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79479 --- Comment #3 from Bruno Haible --- (In reply to Marek Polacek from comment #2) > int > fn1 (long x) > { > if (0) > return __INT_MAX__ + 1; > > if (x || 0) > return __INT_MAX__ + 1; /* { dg-warning "integer overflow" } */ > > if

[Bug c/79479] -Woverflow false alarm in unreachable expression

2017-02-13 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79479 --- Comment #2 from Marek Polacek --- Generalized extended testcase: int fn1 (long x) { if (0) return __INT_MAX__ + 1; if (x || 0) return __INT_MAX__ + 1; /* { dg-warning "integer overflow" } */ if (1 || 0) return __INT_MAX__

[Bug c/79479] -Woverflow false alarm in unreachable expression

2017-02-13 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79479 Marek Polacek changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed|