From 8c56cc5a88342b2c327bdcee9245e4afd86a8862 Mon Sep 17 00:00:00 2001 From: Claudiu Zissulescu Date: Mon, 13 Mar 2017 13:56:11 +0100 Subject: [PATCH] [ARC] Fix tst_bitfield_tst pattern. gcc/ 2017-03-13 Claudiu Zissulescu * config/arc/arc.md (*tst_bitfield_tst): Fix pattern. gcc/testsuite 2017-03-13 Claudiu Zissulescu * testsuite/gcc.target/arc/bitfield.c: New file. From-SVN: r246090 --- gcc/ChangeLog | 4 ++++ gcc/config/arc/arc.md | 2 +- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.target/arc/bitfield.c | 28 +++++++++++++++++++++++++ 4 files changed, 37 insertions(+), 1 deletion(-) create mode 100755 gcc/testsuite/gcc.target/arc/bitfield.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6fdef52944d..1c160a5b86c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2017-03-13 Claudiu Zissulescu + + * config/arc/arc.md (*tst_bitfield_tst): Fix pattern. + 2017-03-13 Claudiu Zissulescu * config/arc/arc.c (arc_output_addsi): Emit code density adds. diff --git a/gcc/config/arc/arc.md b/gcc/config/arc/arc.md index 3e715b5c52d..a65735f8a7d 100644 --- a/gcc/config/arc/arc.md +++ b/gcc/config/arc/arc.md @@ -901,7 +901,7 @@ && (INTVAL (operands[3]) + INTVAL (operands[2]) <= 11 || (INTVAL (operands[3]) <= 11 && INTVAL (operands[3]) + INTVAL (operands[2]) == 32))" - "tst %1,(1<<%2)-1<<%3" + "tst %1,((1<<%2)-1)<<%3" [(set_attr "type" "compare") (set_attr "cond" "set_zn") (set_attr "length" "4")]) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5b7b5c19894..873f648e137 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2017-03-13 Claudiu Zissulescu + + * testsuite/gcc.target/arc/bitfield.c: New file. + 2017-03-13 Claudiu Zissulescu * testsuite/gcc.target/arc/pr9001090948.c: New file. diff --git a/gcc/testsuite/gcc.target/arc/bitfield.c b/gcc/testsuite/gcc.target/arc/bitfield.c new file mode 100755 index 00000000000..187cd1ddb5f --- /dev/null +++ b/gcc/testsuite/gcc.target/arc/bitfield.c @@ -0,0 +1,28 @@ +/* { dg-do run } */ +/* { dg-options "-O2" } */ + +#include + +struct ubifs_budget_req { + unsigned int fast:7; + unsigned int new_ino_d:13; +}; + +int printf(const char *format, ...); + +void __attribute__ ((noinline)) +fff(struct ubifs_budget_req *req) +{ + if (req->new_ino_d & 7) + abort (); +} + +int main (void) +{ + struct ubifs_budget_req req = { + .fast = 8, + .new_ino_d = 0, + }; + fff(&req); + return 0; +} -- 2.30.2