From f3b2657c01366bc9ea847b95745c4f89cdc5661c Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 20 Aug 2004 22:52:22 +0200 Subject: [PATCH] re PR rtl-optimization/17099 (Bootstrap failure on powerpc64-redhat-linux) PR rtl-optimization/17099 * combine.c (force_to_mode): Check if inner_mask has any bits set outside of GET_MODE (x) instead of op_mode. * gcc.c-torture/execute/20040820-1.c: New test. From-SVN: r86339 --- gcc/ChangeLog | 6 +++++ gcc/combine.c | 5 ++-- gcc/testsuite/ChangeLog | 5 ++++ .../gcc.c-torture/execute/20040820-1.c | 24 +++++++++++++++++++ 4 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/gcc.c-torture/execute/20040820-1.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 21159763e7d..4238269f5b9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2004-08-20 Jakub Jelinek + + PR rtl-optimization/17099 + * combine.c (force_to_mode): Check if inner_mask has any bits set + outside of GET_MODE (x) instead of op_mode. + 2004-08-20 Mark Mitchell * config.gcc (arm*-*-symbianelf*): Add t-symbian Makefile diff --git a/gcc/combine.c b/gcc/combine.c index 426b0d775e5..a116f81360c 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -7151,9 +7151,8 @@ force_to_mode (rtx x, enum machine_mode mode, unsigned HOST_WIDE_INT mask, /* We can only change the mode of the shift if we can do arithmetic in the mode of the shift and INNER_MASK is no wider than the - width of OP_MODE. */ - if (GET_MODE_BITSIZE (op_mode) > HOST_BITS_PER_WIDE_INT - || (inner_mask & ~GET_MODE_MASK (op_mode)) != 0) + width of X's mode. */ + if ((inner_mask & ~GET_MODE_MASK (GET_MODE (x))) != 0) op_mode = GET_MODE (x); inner = force_to_mode (inner, op_mode, inner_mask, reg, next_select); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8a14c05f1bf..0e8d341589f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-08-20 Jakub Jelinek + + PR rtl-optimization/17099 + * gcc.c-torture/execute/20040820-1.c: New test. + 2004-08-20 David Edelsohn * gcc.dg/uninit-H.c: Add _POWER to powerpc case. diff --git a/gcc/testsuite/gcc.c-torture/execute/20040820-1.c b/gcc/testsuite/gcc.c-torture/execute/20040820-1.c new file mode 100644 index 00000000000..366607c827e --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20040820-1.c @@ -0,0 +1,24 @@ +/* PR rtl-optimization/17099 */ + +extern void exit (int); +extern void abort (void); + +void +check (int a) +{ + if (a != 1) + abort (); +} + +void +test (int a, int b) +{ + check ((a ? 1 : 0) | (b ? 2 : 0)); +} + +int +main (void) +{ + test (1, 0); + exit (0); +} -- 2.30.2