[v2,2/2] testsuite: Add new testcases for bitop reduction simplifications
Checks
| Context |
Check |
Description |
| linaro-tcwg-bot/tcwg_gcc_build--master-arm |
success
|
Build passed
|
| linaro-tcwg-bot/tcwg_gcc_check--master-arm |
success
|
Test passed
|
| linaro-tcwg-bot/tcwg_simplebootstrap_build--master-aarch64-bootstrap |
success
|
Build passed
|
| linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 |
success
|
Build passed
|
| linaro-tcwg-bot/tcwg_simplebootstrap_build--master-arm-bootstrap |
success
|
Build passed
|
Commit Message
This patch adds dedicated test coverage to verify the bitwise reduction
simplifications against zero implemented in match.pd.
PR tree-optimization/125442
gcc/testsuite/ChangeLog:
* gcc.dg/int-bwise-opt-3.c: New test.
* gcc.dg/int-bwise-opt-4.c: New test.
---
gcc/testsuite/gcc.dg/int-bwise-opt-3.c | 9 +++++++++
gcc/testsuite/gcc.dg/int-bwise-opt-4.c | 9 +++++++++
2 files changed, 18 insertions(+)
create mode 100644 gcc/testsuite/gcc.dg/int-bwise-opt-3.c
create mode 100644 gcc/testsuite/gcc.dg/int-bwise-opt-4.c
new file mode 100644
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int f1(int a, int b)
+{
+ return (a == 0) | ((a | b) == 0);
+}
+
+/* { dg-final { scan-tree-dump-times "\\\|" 0 "optimized" } } */
new file mode 100644
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int f1(int a, int b)
+{
+ return (a != 0) & ((a | b) != 0);
+}
+
+/* { dg-final { scan-tree-dump-times "\&" 0 "optimized" } } */