diff options
author | Andrew Pinski <apinski@marvell.com> | 2020-01-16 02:07:28 +0000 |
---|---|---|
committer | Andrew Pinski <apinski@marvell.com> | 2020-01-16 12:30:22 +0000 |
commit | 7c6056d52ef7ea43b503b11a571b316d55f392c7 (patch) | |
tree | e21d1b601f6292ebe8d2984def0c19c8b2e31556 /gcc/sched-deps.c | |
parent | 55c7ffae7021367df36588d7991a1fb0f870e2c6 (diff) | |
download | gcc-7c6056d52ef7ea43b503b11a571b316d55f392c7.zip gcc-7c6056d52ef7ea43b503b11a571b316d55f392c7.tar.gz gcc-7c6056d52ef7ea43b503b11a571b316d55f392c7.tar.bz2 |
Uninitialized padding in struct _dep.
In struct _dep, there is an implicit padding of 4bits. This
bit-field padding is uninitialized when init_dep_1 is being called.
This means we access uninitialized memory but never use it for
anything. Adding an unused bit-field field and initializing it
in init_dep_1 will improve code generation also as we initialize
the whole 32bits now rather than just part of it.
ChangeLog:
* sched-int.h (_dep): Add unused bit-field field for the padding.
* sched-deps.c (init_dep_1): Init unused field.
Diffstat (limited to 'gcc/sched-deps.c')
-rw-r--r-- | gcc/sched-deps.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c index 9182aba..331af5f 100644 --- a/gcc/sched-deps.c +++ b/gcc/sched-deps.c @@ -101,6 +101,7 @@ init_dep_1 (dep_t dep, rtx_insn *pro, rtx_insn *con, enum reg_note type, ds_t ds DEP_NONREG (dep) = 0; DEP_MULTIPLE (dep) = 0; DEP_REPLACE (dep) = NULL; + dep->unused = 0; } /* Init DEP with the arguments. |