From 4c3d876014207c013566132a93cb9d29f0c96a7b Mon Sep 17 00:00:00 2001 From: Martin Jambor Date: Tue, 25 Jun 2019 13:05:19 +0200 Subject: [PATCH] [PR 90939] Remove outdated assert in ipcp_bits_lattice::meet_with 2019-06-25 Martin Jambor PR ipa/90939 * ipa-cp.c (ipcp_bits_lattice::meet_with): Remove assert. testsuite/ * g++.dg/lto/pr90939_[01].C: New test. From-SVN: r272646 --- gcc/ChangeLog | 5 +++ gcc/ipa-cp.c | 1 - gcc/testsuite/ChangeLog | 5 +++ gcc/testsuite/g++.dg/lto/pr90939_0.C | 64 ++++++++++++++++++++++++++++ gcc/testsuite/g++.dg/lto/pr90939_1.C | 45 +++++++++++++++++++ 5 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/lto/pr90939_0.C create mode 100644 gcc/testsuite/g++.dg/lto/pr90939_1.C diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9814b5b85f8..fee1f55c7ae 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2019-06-25 Martin Jambor + + PR ipa/90939 + * ipa-cp.c (ipcp_bits_lattice::meet_with): Remove assert. + 2019-06-25 Richard Biener PR tree-optimization/90930 diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c index d3a88756a91..69c00a9c5a5 100644 --- a/gcc/ipa-cp.c +++ b/gcc/ipa-cp.c @@ -1085,7 +1085,6 @@ ipcp_bits_lattice::meet_with (ipcp_bits_lattice& other, unsigned precision, if (TREE_CODE_CLASS (code) == tcc_binary) { tree type = TREE_TYPE (operand); - gcc_assert (INTEGRAL_TYPE_P (type)); widest_int o_value, o_mask; get_value_and_mask (operand, &o_value, &o_mask); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b147b6766ee..ca27bc3bffd 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-06-25 Martin Jambor + + PR ipa/90939 + * g++.dg/lto/pr90939_[01].C: New test. + 2019-06-25 Richard Biener PR tree-optimization/90930 diff --git a/gcc/testsuite/g++.dg/lto/pr90939_0.C b/gcc/testsuite/g++.dg/lto/pr90939_0.C new file mode 100644 index 00000000000..8987c348015 --- /dev/null +++ b/gcc/testsuite/g++.dg/lto/pr90939_0.C @@ -0,0 +1,64 @@ +// PR ipa/90939 +// { dg-lto-do link } +// { dg-lto-options { { -flto -O3 } } } + + +typedef char uint8_t; +template class A { +public: + A(T *); +}; +template const Derived &To(Base &p1) { + return static_cast(p1); +} +class H; +template const H *To(Base *p1) { + return p1 ? &To(*p1) : nullptr; +} +enum TextDirection : uint8_t; +enum WritingMode : unsigned; +class B { +public: + WritingMode m_fn1(); +}; +class C { +public: + int &m_fn2(); +}; +class D { double d;}; +class H : public D {}; +class F { +public: + F(C, A, B *, WritingMode, TextDirection); +}; + +class G { +public: + C NGLayoutAlgorithm_node; + B NGLayoutAlgorithm_space; + TextDirection NGLayoutAlgorithm_direction; + H NGLayoutAlgorithm_break_token; + G(A p1) __attribute__((noinline)) + : break_token_(&NGLayoutAlgorithm_break_token), + container_builder_(NGLayoutAlgorithm_node, p1, &NGLayoutAlgorithm_space, + NGLayoutAlgorithm_space.m_fn1(), + NGLayoutAlgorithm_direction) {} + G(C p1, const H *) : G(&p1.m_fn2()) {} + A break_token_; + F container_builder_; +}; + +class I : G { +public: + I(const D *) __attribute__((noinline)); +}; +C a; +I::I(const D *p1) : G(a, To(p1)) {} + +D gd[10]; + +int main (int argc, char *argv[]) +{ + I i(&(gd[argc%2])); + return 0; +} diff --git a/gcc/testsuite/g++.dg/lto/pr90939_1.C b/gcc/testsuite/g++.dg/lto/pr90939_1.C new file mode 100644 index 00000000000..9add89494d7 --- /dev/null +++ b/gcc/testsuite/g++.dg/lto/pr90939_1.C @@ -0,0 +1,45 @@ +typedef char uint8_t; +template class A { +public: + A(T *); +}; + +enum TextDirection : uint8_t; +enum WritingMode : unsigned; +class B { +public: + WritingMode m_fn1(); +}; +class C { +public: + int &m_fn2(); +}; + +class F { +public: + F(C, A, B *, WritingMode, TextDirection); +}; +class D { double d;}; +class H : public D {}; + + + +template A::A(T*) {} + +template class A; +template class A; + +WritingMode __attribute__((noipa)) +B::m_fn1() +{ + return (WritingMode) 0; +} + +int gi; +int & __attribute__((noipa)) +C::m_fn2 () +{ + return gi; +} + +__attribute__((noipa)) F::F(C, A, B *, WritingMode, TextDirection) {} -- 2.30.2