This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/49234] [4.5/4.6/4.7/4.8 Regression] -Wstrict-overflow gives obviously unwarranted warning
- From: "aldyh at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 05 Mar 2013 18:00:12 +0000
- Subject: [Bug tree-optimization/49234] [4.5/4.6/4.7/4.8 Regression] -Wstrict-overflow gives obviously unwarranted warning
- Auto-submitted: auto-generated
- References: <bug-49234-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49234
--- Comment #16 from Aldy Hernandez <aldyh at gcc dot gnu.org> 2013-03-05 18:00:12 UTC ---
Created attachment 29590
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29590
WIP: proposed patch special casing constant phi arguments
Ian.
Sure, I can handle SSA_NAME_VAR equality, but then we won't be able to handle
self referential operations like the one in gcc.dg/Wstrict-overflow-12.c. For
example, with your suggested approach (in this attached patch), we fail here:
for (i = 1, bits = 1; i > 0; i += i) /* { dg-warning "assuming signed
overflow does not occur" "correct warning" } */
++bits;
Because we encounter something like this which is perfectly valid with your
approach:
i_1 = PHI <1(2), i_4(3)>