gimple-ssa-warn-alloca: Always initialize limit [PR99989]
This PR is about a -W*uninitialized warning on riscv64. alloca_type_and_limit is documented to have limit member only defined when type is ALLOCA_BOUND_MAYBE_LARGE or ALLOCA_BOUND_DEFINITELY_LARGE and otherwise just default constructs limit, which for wide_int means no initialization at all. IMHO it is fine not to use the limit member otherwise, but trying to not initialize it when it can be e.g. copied around and then invoke UB doesn't look like a good idea. 2021-04-10 Jakub Jelinek <jakub@redhat.com> PR middle-end/99989 * gimple-ssa-warn-alloca.c (alloca_type_and_limit::alloca_type_and_limit): Initialize limit to 0 with integer precision unconditionally.
This commit is contained in:
parent
7a493fcd27
commit
3e350d8539
@ -124,9 +124,8 @@ public:
|
||||
alloca_type_and_limit (enum alloca_type type,
|
||||
wide_int i) : type(type), limit(i) { }
|
||||
alloca_type_and_limit (enum alloca_type type) : type(type)
|
||||
{ if (type == ALLOCA_BOUND_MAYBE_LARGE
|
||||
|| type == ALLOCA_BOUND_DEFINITELY_LARGE)
|
||||
limit = wi::to_wide (integer_zero_node);
|
||||
{
|
||||
limit = wi::to_wide (integer_zero_node);
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user