diff options
author | Marek Polacek <polacek@redhat.com> | 2015-06-30 16:36:44 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2015-06-30 16:36:44 +0000 |
commit | 3db55b2b6d83f9d3406af133e42db688b9379395 (patch) | |
tree | 5b8dce2e677b5633bbb88ff76efadcddc0decb73 /gcc/testsuite | |
parent | d3bc1d1b65a18177f6baacda0251b4777a2794f4 (diff) | |
download | gcc-3db55b2b6d83f9d3406af133e42db688b9379395.zip gcc-3db55b2b6d83f9d3406af133e42db688b9379395.tar.gz gcc-3db55b2b6d83f9d3406af133e42db688b9379395.tar.bz2 |
match.pd (~x | x): Don't use tree_nop_conversion_p.
* match.pd (~x | x): Don't use tree_nop_conversion_p. Build
the final expression with the operand's type and then convert
it to the type of the expression.
* gcc.dg/fold-ior-3.c: New test.
From-SVN: r225196
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/fold-ior-3.c | 35 |
2 files changed, 37 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 95a75e5..7b51e77 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -2,6 +2,8 @@ * gcc.dg/fold-minus-6.c: New test. + * gcc.dg/fold-ior-3.c: New test. + 2015-06-30 Edward Smith-Rowland <3dw4rd@verizon.net> Implement N4197 - Adding u8 character literals diff --git a/gcc/testsuite/gcc.dg/fold-ior-3.c b/gcc/testsuite/gcc.dg/fold-ior-3.c new file mode 100644 index 0000000..ed89ff9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/fold-ior-3.c @@ -0,0 +1,35 @@ +/* { dg-do compile } */ +/* { dg-options "-O -fdump-tree-cddce1" } */ + +int +fn1 (_Bool a) +{ + return ((int) a) | ((int) ~a); +} + +int +fn2 (unsigned char a) +{ + return ((int) a) | ((int) ~a); +} + +int +fn3 (unsigned short a) +{ + return ((int) a) | ((int) ~a); +} + +int +fn4 (signed char a) +{ + return ((int) a) | ((int) ~a); +} + +int +fn5 (signed short a) +{ + return ((int) a) | ((int) ~a); +} + +/* { dg-final { scan-tree-dump-not "~" "cddce1" } } */ +/* { dg-final { scan-tree-dump-not " \\| " "cddce1" } } */ |