From f615b74e95263a697cfe4c8e5f6909db7243d589 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Tue, 16 Jul 2019 08:57:51 -0600 Subject: [PATCH] re PR rtl-optimization/91173 (ICE: in int_mode_for_mode, at stor-layout.c:403) PR rtl-optimization/91173 * g++.dg/pr91173.C: New test. From-SVN: r273531 --- gcc/testsuite/ChangeLog | 5 ++++ gcc/testsuite/g++.dg/pr91173.C | 45 ++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 gcc/testsuite/g++.dg/pr91173.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fc0b1298148..23d8c776321 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-07-16 Jeff Law + + PR rtl-optimization/91173 + * g++.dg/pr91173.C: New test. + 2019-07-16 Wilco Dijkstra PR target/89190 diff --git a/gcc/testsuite/g++.dg/pr91173.C b/gcc/testsuite/g++.dg/pr91173.C new file mode 100644 index 00000000000..b8fb41ba0cd --- /dev/null +++ b/gcc/testsuite/g++.dg/pr91173.C @@ -0,0 +1,45 @@ +class a { + int b; + void *c; + +public: + bool aa(); + int &ab() { + if (aa()) { + void *d(c); + return static_cast(d)[b]; + } + return *(int *)0; + } +}; +typedef enum {E} e; +class f : public a { + int g; + +public: + int ac() { + if (g) + return 1; + return ac(); + } +}; +int *ad; +struct h { + static int ae(e, int *m) { + f ag; + int *ah; + while (!0) { + ad = &ag.ab(); + ah = ad + ag.ac(); + while (ad < ah) + *m = *ad++; + } + } +}; +template +void i(int *, int *, int, int *, e n, int *o) { + h::ae(n, o); +} +int aq, ar, as, at, au; +void aw() { i(&aq, &ar, as, &at, (e)0, &au); } + -- 2.30.2