This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/66555] New: Fails to warn for if (j == 0 && i == i)
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 16 Jun 2015 13:25:14 +0000
- Subject: [Bug c++/66555] New: Fails to warn for if (j == 0 && i == i)
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66555
Bug ID: 66555
Summary: Fails to warn for if (j == 0 && i == i)
Product: gcc
Version: 6.0
Status: UNCONFIRMED
Keywords: diagnostic
Severity: enhancement
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: rguenth at gcc dot gnu.org
Target Milestone: ---
Just fixed a bug in the vectorizer with
@@ -5359,7 +5373,7 @@ vectorizable_store (gimple stmt, gimple_
vect_finish_stmt_generation (stmt, incr, gsi);
running_off = newoff;
- if (j == 0 && i == i)
+ if (j == 0 && i == 0)
STMT_VINFO_VEC_STMT (stmt_info) = *vec_stmt = assign;
else
STMT_VINFO_RELATED_STMT (prev_stmt_info) = assign;
and I wonder why we don't warn about this (well, I know, we only warn
if the whole if expr folds to a constant).
Applies to the C frontend as well.