From 8b4f2b5e0871d32d0f78ce3f3250af71bfb6f65a Mon Sep 17 00:00:00 2001 From: Peter Bergner Date: Thu, 7 Nov 2019 18:48:45 +0000 Subject: [PATCH] Allow MODE_PARTIAL_INT modes for integer constant input operands. gcc/ PR other/92090 * config/rs6000/predicates.md (input_operand): Allow MODE_PARTIAL_INT modes for integer constants. gcc/testsuite/ PR other/92090 * gcc.target/powerpc/pr92090.c: New test. From-SVN: r277928 --- gcc/ChangeLog | 6 ++++ gcc/config/rs6000/predicates.md | 3 +- gcc/testsuite/ChangeLog | 5 +++ gcc/testsuite/gcc.target/powerpc/pr92090.c | 42 ++++++++++++++++++++++ 4 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.target/powerpc/pr92090.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a489c729202..606c3073b37 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-11-07 Peter Bergner + + PR other/92090 + * config/rs6000/predicates.md (input_operand): Allow MODE_PARTIAL_INT + modes for integer constants. + 2019-11-07 Jan Hubicka PR ipa/92406 diff --git a/gcc/config/rs6000/predicates.md b/gcc/config/rs6000/predicates.md index 5ef505bb1c4..6c3f2e2eddd 100644 --- a/gcc/config/rs6000/predicates.md +++ b/gcc/config/rs6000/predicates.md @@ -1047,8 +1047,7 @@ return 1; /* Allow any integer constant. */ - if (GET_MODE_CLASS (mode) == MODE_INT - && CONST_SCALAR_INT_P (op)) + if (SCALAR_INT_MODE_P (mode) && CONST_SCALAR_INT_P (op)) return 1; /* Allow easy vector constants. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c80457cca9e..b4d865c5389 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-11-07 Peter Bergner + + PR other/92090 + * gcc.target/powerpc/pr92090.c: New test. + 2019-11-07 Feng Xue PR tree-optimization/89134 diff --git a/gcc/testsuite/gcc.target/powerpc/pr92090.c b/gcc/testsuite/gcc.target/powerpc/pr92090.c new file mode 100644 index 00000000000..15e12a9ea21 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr92090.c @@ -0,0 +1,42 @@ +/* { dg-do compile } */ +/* { dg-options "-mdejagnu-cpu=power8 -Os -mbig" } */ + +/* Verify that we don't ICE. */ + +_Atomic int a; +_Atomic long double b, c; +int j; +void foo (void); +void bar (int, int, int, int); + +void +bug (void) +{ + b = 1; + int d, e, f, g; + while (a) + ; + for (int h = 0; h < 10000; h++) + { + double i = b /= 3; + foo (); + if (i) + { + if (i == 1) + d++; + e++; + b = 0; + } + else + { + if (i == 2) + f++; + g++; + b = 1; + } + } + bar (d, e, f, g); + c = 1; + for (int h; h; h++) + j = 0; +} -- 2.30.2