This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug other/77421] Bugs found in GCC with the help of PVS-Studio
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 01 Sep 2016 11:44:01 +0000
- Subject: [Bug other/77421] Bugs found in GCC with the help of PVS-Studio
- Auto-submitted: auto-generated
- References: <bug-77421-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77421
--- Comment #12 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #11)
> (In reply to Jonathan Wakely from comment #5)
> > cand_value_at in tree-ssa-loop-ivopts.c does:
> >
> > tree type = TREE_TYPE (iv->base);
> > tree steptype = type;
> > if (POINTER_TYPE_P (type))
> > steptype = sizetype;
> > steptype = unsigned_type_for (type);
> >
> > It's unclear why the last four lines aren't just:
> >
> > tree steptype = unsigned_type_for (type);
>
> it should be
>
> if (POINTER_TYPE_P (type))
> steptype = sizetype
> else
> steptype = unsigned_type_for (type);
This is now PR 77444