This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/77425] New: Pointer test follows dereference in sched-int.h
- 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: Wed, 31 Aug 2016 16:28:34 +0000
- Subject: [Bug rtl-optimization/77425] New: Pointer test follows dereference in sched-int.h
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77425
Bug ID: 77425
Summary: Pointer test follows dereference in sched-int.h
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: rtl-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: redi at gcc dot gnu.org
Blocks: 77421
Target Milestone: ---
sd_iterator_cond in gcc/sched-int.h has:
it_ptr->linkp = &DEPS_LIST_FIRST (list);
if (list)
continue;
where DEPS_LIST_FIRST dereferences list, so either the test is always true or
the dereference is undefined behavious.
Maybe it should be:
it_ptr->linkp = list ? &DEPS_LIST_FIRST (list) : NULL;
if (list)
continue;
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77421
[Bug 77421] Bugs found in GCC with the help of PVS-Studio