mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-23 15:01:17 +08:00
analyzer: fix ICE due to comparing int and real constants (PR 93547)
gcc/analyzer/ChangeLog: PR analyzer/93547 * constraint-manager.cc (constraint_manager::get_or_add_equiv_class): Ensure types are compatible before comparing constants. gcc/testsuite/ChangeLog: PR analyzer/93547 * gcc.dg/analyzer/pr93547.c: New test.
This commit is contained in:
parent
e01975f97c
commit
287ccd3bd6
@ -1,3 +1,10 @@
|
||||
2020-02-03 David Malcolm <dmalcolm@redhat.com>
|
||||
|
||||
PR analyzer/93547
|
||||
* constraint-manager.cc
|
||||
(constraint_manager::get_or_add_equiv_class): Ensure types are
|
||||
compatible before comparing constants.
|
||||
|
||||
2020-01-31 David Malcolm <dmalcolm@redhat.com>
|
||||
|
||||
PR analyzer/93457
|
||||
|
@ -928,7 +928,9 @@ constraint_manager::get_or_add_equiv_class (svalue_id sid)
|
||||
int i;
|
||||
equiv_class *ec;
|
||||
FOR_EACH_VEC_ELT (m_equiv_classes, i, ec)
|
||||
if (ec->m_constant)
|
||||
if (ec->m_constant
|
||||
&& types_compatible_p (TREE_TYPE (cst),
|
||||
TREE_TYPE (ec->m_constant)))
|
||||
{
|
||||
tree eq = fold_build2 (EQ_EXPR, boolean_type_node,
|
||||
cst, ec->m_constant);
|
||||
|
@ -1,3 +1,8 @@
|
||||
2020-02-03 David Malcolm <dmalcolm@redhat.com>
|
||||
|
||||
PR analyzer/93547
|
||||
* gcc.dg/analyzer/pr93547.c: New test.
|
||||
|
||||
2020-02-03 Stam Markianos-Wright <stam.markianos-wright@arm.com>
|
||||
|
||||
PR target/91816
|
||||
|
14
gcc/testsuite/gcc.dg/analyzer/pr93547.c
Normal file
14
gcc/testsuite/gcc.dg/analyzer/pr93547.c
Normal file
@ -0,0 +1,14 @@
|
||||
/* { dg-do compile } */
|
||||
|
||||
void
|
||||
wy (int);
|
||||
|
||||
int
|
||||
f9 (void)
|
||||
{
|
||||
int p5 = __builtin_ilogb (__builtin_inf ());
|
||||
|
||||
wy (0);
|
||||
|
||||
return p5;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user