IPA: compare VRP types.
gcc/ChangeLog: PR ipa/97404 * ipa-prop.c (struct ipa_vr_ggc_hash_traits): Compare types of VRP as we can merge ranges of different types. gcc/testsuite/ChangeLog: PR ipa/97404 * gcc.c-torture/execute/pr97404.c: New test.
This commit is contained in:
parent
23a9215f3e
commit
a866239027
2 changed files with 30 additions and 1 deletions
|
@ -123,7 +123,8 @@ struct ipa_vr_ggc_hash_traits : public ggc_cache_remove <value_range *>
|
|||
static bool
|
||||
equal (const value_range *a, const value_range *b)
|
||||
{
|
||||
return a->equal_p (*b);
|
||||
return (a->equal_p (*b)
|
||||
&& types_compatible_p (a->type (), b->type ()));
|
||||
}
|
||||
static const bool empty_zero_p = true;
|
||||
static void
|
||||
|
|
28
gcc/testsuite/gcc.c-torture/execute/pr97404.c
Normal file
28
gcc/testsuite/gcc.c-torture/execute/pr97404.c
Normal file
|
@ -0,0 +1,28 @@
|
|||
/* PR ipa/97404 */
|
||||
/* { dg-additional-options "-fno-inline" } */
|
||||
|
||||
char a, b;
|
||||
long c;
|
||||
short d, e;
|
||||
long *f = &c;
|
||||
int g;
|
||||
char h(signed char i) { return 0; }
|
||||
static short j(short i, int k) { return i < 0 ? 0 : i >> k; }
|
||||
void l(void);
|
||||
void m(void)
|
||||
{
|
||||
e = j(d | 9766, 11);
|
||||
*f = e;
|
||||
}
|
||||
void l(void)
|
||||
{
|
||||
a = 5 | g;
|
||||
b = h(a);
|
||||
}
|
||||
int main()
|
||||
{
|
||||
m();
|
||||
if (c != 4)
|
||||
__builtin_abort();
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Reference in a new issue