From: Jakub Jelinek Date: Tue, 28 Oct 2008 10:34:51 +0000 (+0100) Subject: re PR middle-end/37931 (ice: verify_gimple failed) X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5229689d71b35d2e94c1c2f80147927bf5470c07;p=platform%2Fupstream%2Fgcc.git re PR middle-end/37931 (ice: verify_gimple failed) PR middle-end/37931 * fold-const.c (distribute_bit_expr): Convert common, left and right arguments to type. * gcc.c-torture/execute/pr37931.c: New test. From-SVN: r141406 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 44432df..d04aa06 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2008-10-28 Jakub Jelinek + + PR middle-end/37931 + * fold-const.c (distribute_bit_expr): Convert common, left and + right arguments to type. + 2008-10-28 Nick Clifton * config/mn10300/mn10300.h (CALL_REALLY_USED_REGISTERS): Define. diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 1eac946..7a215d2 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -3806,6 +3806,9 @@ distribute_bit_expr (enum tree_code code, tree type, tree arg0, tree arg1) else return 0; + common = fold_convert (type, common); + left = fold_convert (type, left); + right = fold_convert (type, right); return fold_build2 (TREE_CODE (arg0), type, common, fold_build2 (code, type, left, right)); } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3aa9a1e..58e7819 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-10-28 Jakub Jelinek + + PR middle-end/37931 + * gcc.c-torture/execute/pr37931.c: New test. + 2008-10-27 Jakub Jelinek PR tree-optimization/37879 diff --git a/gcc/testsuite/gcc.c-torture/execute/pr37931.c b/gcc/testsuite/gcc.c-torture/execute/pr37931.c new file mode 100644 index 0000000..0077a21 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr37931.c @@ -0,0 +1,23 @@ +/* PR middle-end/37931 */ + +extern void abort (void); + +int +foo (int a, unsigned int b) +{ + return (a | 1) & (b | 1); +} + +int +main (void) +{ + if (foo (6, 0xc6) != 7) + abort (); + if (foo (0x80, 0xc1) != 0x81) + abort (); + if (foo (4, 4) != 5) + abort (); + if (foo (5, 4) != 5) + abort (); + return 0; +}