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 tree-optimization/49234] [4.5/4.6/4.7/4.8 Regression] -Wstrict-overflow gives obviously unwarranted warning


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)>


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