From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 115994 invoked by alias); 7 Jul 2015 16:13:03 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 115959 invoked by uid 89); 7 Jul 2015 16:13:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mailapp01.imgtec.com Received: from mailapp01.imgtec.com (HELO mailapp01.imgtec.com) (195.59.15.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 07 Jul 2015 16:12:59 +0000 Received: from KLMAIL01.kl.imgtec.org (unknown [192.168.5.35]) by Websense Email Security Gateway with ESMTPS id 6E5FDC8FF0627; Tue, 7 Jul 2015 17:12:53 +0100 (IST) Received: from LEMAIL01.le.imgtec.org (192.168.152.62) by KLMAIL01.kl.imgtec.org (192.168.5.35) with Microsoft SMTP Server (TLS) id 14.3.195.1; Tue, 7 Jul 2015 17:12:56 +0100 Received: from LEMAIL01.le.imgtec.org ([fe80::5ae:ee16:f4b9:cda9]) by LEMAIL01.le.imgtec.org ([fe80::5ae:ee16:f4b9:cda9%17]) with mapi id 14.03.0210.002; Tue, 7 Jul 2015 17:12:55 +0100 From: Andrew Bennett To: "Moore, Catherine" , "gcc-patches@gcc.gnu.org" CC: Matthew Fortune Subject: RE: [PATCH] MIPS: fix failing branch range checks for micromips Date: Tue, 07 Jul 2015 16:13:00 -0000 Message-ID: <0DA23CC379F5F945ACB41CF394B98277210F0037@LEMAIL01.le.imgtec.org> References: <0DA23CC379F5F945ACB41CF394B98277210EDC9C@LEMAIL01.le.imgtec.org> In-Reply-To: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-IsSubscribed: yes X-SW-Source: 2015-07/txt/msg00529.txt.bz2 > I see that you are naming these tests after the original branch- = tests > that they were derived from. > I think it would be better to keep all of the microMIPS tests named umips= -???. > I don't think preserving the original number is important. I have named the microMIPS tests umips-branch-??? to keep with the current = microMIPS test naming strategy. The numbering starts at 5 as there are already tests= numbered=20 1-4. An updated patch and ChangeLog is below. Ok to commit? Many thanks, Andrew testsuite/ * gcc.target/mips/branch-2.c: Change NOMIPS16 to NOCOMPRESSION. * gcc.target/mips/branch-3.c: Ditto * gcc.target/mips/branch-4.c: Ditto. * gcc.target/mips/branch-5.c: Ditto. * gcc.target/mips/branch-6.c: Ditto. * gcc.target/mips/branch-7.c: Ditto. * gcc.target/mips/branch-8.c: Ditto. * gcc.target/mips/branch-9.c: Ditto. * gcc.target/mips/branch-10.c: Ditto. * gcc.target/mips/branch-11.c: Ditto. * gcc.target/mips/branch-12.c: Ditto. * gcc.target/mips/branch-13.c: Ditto. * gcc.target/mips/branch-14.c: Ditto. * gcc.target/mips/branch-15.c: Ditto. * gcc.target/mips/umips-branch-5.c: New file. * gcc.target/mips/umips-branch-6.c: New file. * gcc.target/mips/umips-branch-7.c: New file. * gcc.target/mips/umips-branch-8.c: New file. * gcc.target/mips/umips-branch-9.c: New file. * gcc.target/mips/umips-branch-10.c: New file. * gcc.target/mips/umips-branch-11.c: New file. * gcc.target/mips/umips-branch-12.c: New file. * gcc.target/mips/umips-branch-13.c: New file. * gcc.target/mips/umips-branch-14.c: New file. * gcc.target/mips/umips-branch-15.c: New file. * gcc.target/mips/umips-branch-16.c: New file. * gcc.target/mips/umips-branch-17.c: New file. * gcc.target/mips/umips-branch-18.c: New file. * gcc.target/mips/branch-helper.h (OCCUPY_0x10000): New define. (OCCUPY_0xfffc): New define. diff --git a/gcc/testsuite/gcc.target/mips/branch-10.c b/gcc/testsuite/gcc.= target/mips/branch-10.c index e2b1b5f..eb21c16 100644 --- a/gcc/testsuite/gcc.target/mips/branch-10.c +++ b/gcc/testsuite/gcc.target/mips/branch-10.c @@ -4,7 +4,7 @@ =20 #include "branch-helper.h" =20 -NOMIPS16 void +NOCOMPRESSION void foo (int (*bar) (void), int *x) { *x =3D bar (); diff --git a/gcc/testsuite/gcc.target/mips/branch-11.c b/gcc/testsuite/gcc.= target/mips/branch-11.c index 962eb1b..bd8e834 100644 --- a/gcc/testsuite/gcc.target/mips/branch-11.c +++ b/gcc/testsuite/gcc.target/mips/branch-11.c @@ -8,7 +8,7 @@ =20 #include "branch-helper.h" =20 -NOMIPS16 void +NOCOMPRESSION void foo (int (*bar) (void), int *x) { *x =3D bar (); diff --git a/gcc/testsuite/gcc.target/mips/branch-12.c b/gcc/testsuite/gcc.= target/mips/branch-12.c index 4aef160..4944634 100644 --- a/gcc/testsuite/gcc.target/mips/branch-12.c +++ b/gcc/testsuite/gcc.target/mips/branch-12.c @@ -4,7 +4,7 @@ =20 #include "branch-helper.h" =20 -NOMIPS16 void +NOCOMPRESSION void foo (int (*bar) (void), int *x) { *x =3D bar (); diff --git a/gcc/testsuite/gcc.target/mips/branch-13.c b/gcc/testsuite/gcc.= target/mips/branch-13.c index 8a6fb04..f5269b9 100644 --- a/gcc/testsuite/gcc.target/mips/branch-13.c +++ b/gcc/testsuite/gcc.target/mips/branch-13.c @@ -8,7 +8,7 @@ =20 #include "branch-helper.h" =20 -NOMIPS16 void +NOCOMPRESSION void foo (int (*bar) (void), int *x) { *x =3D bar (); diff --git a/gcc/testsuite/gcc.target/mips/branch-14.c b/gcc/testsuite/gcc.= target/mips/branch-14.c index 026417e..c2eecc3 100644 --- a/gcc/testsuite/gcc.target/mips/branch-14.c +++ b/gcc/testsuite/gcc.target/mips/branch-14.c @@ -4,14 +4,14 @@ #include "branch-helper.h" =20 void __attribute__((noinline)) -foo (volatile int *x) +NOCOMPRESSION foo (volatile int *x) { if (__builtin_expect (*x =3D=3D 0, 1)) OCCUPY_0x1fff8; } =20 int -main (void) +NOCOMPRESSION main (void) { int x =3D 0; int y =3D 1; diff --git a/gcc/testsuite/gcc.target/mips/branch-15.c b/gcc/testsuite/gcc.= target/mips/branch-15.c index dee7a05..89e25f3 100644 --- a/gcc/testsuite/gcc.target/mips/branch-15.c +++ b/gcc/testsuite/gcc.target/mips/branch-15.c @@ -4,14 +4,14 @@ #include "branch-helper.h" =20 void -foo (volatile int *x) +NOCOMPRESSION foo (volatile int *x) { if (__builtin_expect (*x =3D=3D 0, 1)) OCCUPY_0x1fffc; } =20 int -main (void) +NOCOMPRESSION main (void) { int x =3D 0; int y =3D 1; diff --git a/gcc/testsuite/gcc.target/mips/branch-2.c b/gcc/testsuite/gcc.t= arget/mips/branch-2.c index 6409c4c..b60e9cd 100644 --- a/gcc/testsuite/gcc.target/mips/branch-2.c +++ b/gcc/testsuite/gcc.target/mips/branch-2.c @@ -5,7 +5,7 @@ =20 #include "branch-helper.h" =20 -NOMIPS16 void +NOCOMPRESSION void foo (volatile int *x) { if (__builtin_expect (*x =3D=3D 0, 1)) diff --git a/gcc/testsuite/gcc.target/mips/branch-3.c b/gcc/testsuite/gcc.t= arget/mips/branch-3.c index 5fcfece..69300f6 100644 --- a/gcc/testsuite/gcc.target/mips/branch-3.c +++ b/gcc/testsuite/gcc.target/mips/branch-3.c @@ -5,7 +5,7 @@ =20 #include "branch-helper.h" =20 -NOMIPS16 void +NOCOMPRESSION void foo (volatile int *x) { if (__builtin_expect (*x =3D=3D 0, 1)) diff --git a/gcc/testsuite/gcc.target/mips/branch-4.c b/gcc/testsuite/gcc.t= arget/mips/branch-4.c index 31e4909..29f5c9f 100644 --- a/gcc/testsuite/gcc.target/mips/branch-4.c +++ b/gcc/testsuite/gcc.target/mips/branch-4.c @@ -4,7 +4,7 @@ =20 #include "branch-helper.h" =20 -NOMIPS16 void +NOCOMPRESSION void foo (volatile int *x) { if (__builtin_expect (*x =3D=3D 0, 1)) diff --git a/gcc/testsuite/gcc.target/mips/branch-5.c b/gcc/testsuite/gcc.t= arget/mips/branch-5.c index 1e9c120..0538646 100644 --- a/gcc/testsuite/gcc.target/mips/branch-5.c +++ b/gcc/testsuite/gcc.target/mips/branch-5.c @@ -6,7 +6,7 @@ =20 #include "branch-helper.h" =20 -NOMIPS16 void +NOCOMPRESSION void foo (volatile int *x) { if (__builtin_expect (*x =3D=3D 0, 1)) diff --git a/gcc/testsuite/gcc.target/mips/branch-6.c b/gcc/testsuite/gcc.t= arget/mips/branch-6.c index 77e0340..19baee1 100644 --- a/gcc/testsuite/gcc.target/mips/branch-6.c +++ b/gcc/testsuite/gcc.target/mips/branch-6.c @@ -4,7 +4,7 @@ =20 #include "branch-helper.h" =20 -NOMIPS16 void +NOCOMPRESSION void foo (volatile int *x) { if (__builtin_expect (*x =3D=3D 0, 1)) diff --git a/gcc/testsuite/gcc.target/mips/branch-7.c b/gcc/testsuite/gcc.t= arget/mips/branch-7.c index 8ad6808..16c6d8e 100644 --- a/gcc/testsuite/gcc.target/mips/branch-7.c +++ b/gcc/testsuite/gcc.target/mips/branch-7.c @@ -6,7 +6,7 @@ =20 #include "branch-helper.h" =20 -NOMIPS16 void +NOCOMPRESSION void foo (volatile int *x) { if (__builtin_expect (*x =3D=3D 0, 1)) diff --git a/gcc/testsuite/gcc.target/mips/branch-8.c b/gcc/testsuite/gcc.t= arget/mips/branch-8.c index ba5f954..2e46844 100644 --- a/gcc/testsuite/gcc.target/mips/branch-8.c +++ b/gcc/testsuite/gcc.target/mips/branch-8.c @@ -4,7 +4,7 @@ =20 #include "branch-helper.h" =20 -NOMIPS16 void +NOCOMPRESSION void foo (int (*bar) (void), int *x) { *x =3D bar (); diff --git a/gcc/testsuite/gcc.target/mips/branch-9.c b/gcc/testsuite/gcc.t= arget/mips/branch-9.c index cad1c00..b87f2ba 100644 --- a/gcc/testsuite/gcc.target/mips/branch-9.c +++ b/gcc/testsuite/gcc.target/mips/branch-9.c @@ -9,7 +9,7 @@ =20 #include "branch-helper.h" =20 -NOMIPS16 void +NOCOMPRESSION void foo (int (*bar) (void), int *x) { *x =3D bar (); diff --git a/gcc/testsuite/gcc.target/mips/branch-helper.h b/gcc/testsuite/= gcc.target/mips/branch-helper.h index 85399be..3d033cc 100644 --- a/gcc/testsuite/gcc.target/mips/branch-helper.h +++ b/gcc/testsuite/gcc.target/mips/branch-helper.h @@ -33,5 +33,25 @@ D2 ("nop") "\n\t" \ D1 ("nop")) =20 +/* Emit something that is 0xfffc bytes long, which is the largest + permissible range for microMIPS forward branches when branches + have delay slots. */ +#define OCCUPY_0xfffc \ + asm (D13 ("nop32") "\n\t" \ + D12 ("nop32") "\n\t" \ + D11 ("nop32") "\n\t" \ + D10 ("nop32") "\n\t" \ + D9 ("nop32") "\n\t" \ + D8 ("nop32") "\n\t" \ + D7 ("nop32") "\n\t" \ + D6 ("nop32") "\n\t" \ + D5 ("nop32") "\n\t" \ + D4 ("nop32") "\n\t" \ + D3 ("nop32") "\n\t" \ + D2 ("nop32") "\n\t" \ + D1 ("nop32") "\n\t" \ + D0 ("nop32")) /* Likewise emit something that is 0x1fffc bytes long. */ #define OCCUPY_0x1fffc do { asm ("nop"); OCCUPY_0x1fff8; } while (0) +/* Likewise emit something that is 0x10000 bytes long. */ +#define OCCUPY_0x10000 do { asm ("nop32"); OCCUPY_0xfffc; } while (0) diff --git a/gcc/testsuite/gcc.target/mips/umips-branch-10.c b/gcc/testsuit= e/gcc.target/mips/umips-branch-10.c new file mode 100644 index 0000000..714691b --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/umips-branch-10.c @@ -0,0 +1,14 @@ +/* { dg-options "-mshared -mabi=3D64 -mmicromips" } */ +/* { dg-final { scan-assembler "\tdaddiu\t\\\$3,\\\$3,%lo\\(%neg\\(%gp_rel= \\(foo\\)\\)\\)\n" } } */ +/* { dg-final { scan-assembler "\tld\t\\\$1,%got_page\\(\[^)\]*\\)\\(\\\$3= \\)\\n" } } */ +/* { dg-final { scan-assembler "\tjr\t\\\$1\n" } } */ +/* { dg-final { scan-assembler-not "\\\$28" } } */ + +#include "branch-helper.h" + +NOMIPS16 void +foo (volatile int *x) +{ + if (__builtin_expect (*x =3D=3D 0, 1)) + OCCUPY_0x10000; +} diff --git a/gcc/testsuite/gcc.target/mips/umips-branch-11.c b/gcc/testsuit= e/gcc.target/mips/umips-branch-11.c new file mode 100644 index 0000000..5050669 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/umips-branch-11.c @@ -0,0 +1,13 @@ +/* { dg-options "-mshared -mabi=3D32 -mmicromips" } */ +/* { dg-final { scan-assembler-not "(\\\$28|cpload|cprestore)" } } */ +/* { dg-final { scan-assembler-not "\tjrc?\t\\\$1\n" } } */ + +#include "branch-helper.h" + +NOMIPS16 void +foo (int (*bar) (void), int *x) +{ + *x =3D bar (); + if (__builtin_expect (*x =3D=3D 0, 1)) + OCCUPY_0xfffc; +} diff --git a/gcc/testsuite/gcc.target/mips/umips-branch-12.c b/gcc/testsuit= e/gcc.target/mips/umips-branch-12.c new file mode 100644 index 0000000..a393de9 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/umips-branch-12.c @@ -0,0 +1,18 @@ +/* { dg-options "-mshared -mabi=3D32 -mmicromips" } */ +/* { dg-final { scan-assembler "\t\\.cpload\t\\\$25\n" } } */ +/* { dg-final { scan-assembler "\t\\.cprestore\t16\n" } } */ +/* { dg-final { scan-assembler "\tlw\t\\\$1,16\\(\\\$(fp|sp)\\)\n" } } */ +/* { dg-final { scan-assembler "\tlw\t\\\$1,%got\\(\[^)\]*\\)\\(\\\$1\\)\n= " } } */ +/* { dg-final { scan-assembler "\taddiu\t\\\$1,\\\$1,%lo\\(\[^)\]*\\)\n" }= } */ +/* { dg-final { scan-assembler "\tjr\t\\\$1\n" } } */ +/* { dg-final { scan-assembler-not "\\\$28" } } */ + +#include "branch-helper.h" + +NOMIPS16 void +foo (int (*bar) (void), int *x) +{ + *x =3D bar (); + if (__builtin_expect (*x =3D=3D 0, 1)) + OCCUPY_0x10000; +} diff --git a/gcc/testsuite/gcc.target/mips/umips-branch-13.c b/gcc/testsuit= e/gcc.target/mips/umips-branch-13.c new file mode 100644 index 0000000..e84b462 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/umips-branch-13.c @@ -0,0 +1,13 @@ +/* { dg-options "-mshared -mabi=3Dn32 -mmicromips" } */ +/* { dg-final { scan-assembler-not "(\\\$28|%gp_rel|%got)" } } */ +/* { dg-final { scan-assembler-not "\tjrc?\t\\\$1\n" } } */ + +#include "branch-helper.h" + +NOMIPS16 void +foo (int (*bar) (void), int *x) +{ + *x =3D bar (); + if (__builtin_expect (*x =3D=3D 0, 1)) + OCCUPY_0xfffc; +} diff --git a/gcc/testsuite/gcc.target/mips/umips-branch-14.c b/gcc/testsuit= e/gcc.target/mips/umips-branch-14.c new file mode 100644 index 0000000..f9f30a7 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/umips-branch-14.c @@ -0,0 +1,17 @@ +/* { dg-options "-mshared -mabi=3Dn32 -mmicromips" } */ +/* { dg-final { scan-assembler "\tsd\t\\\$28," } } */ +/* { dg-final { scan-assembler "\tld\t\\\$28," } } */ +/* { dg-final { scan-assembler "\taddiu\t\\\$28,\\\$28,%lo\\(%neg\\(%gp_re= l\\(foo\\)\\)\\)\n" } } */ +/* { dg-final { scan-assembler "\tlw\t\\\$1,%got_page\\(\[^)\]*\\)\\(\\\$2= 8\\)\n" } } */ +/* { dg-final { scan-assembler "\taddiu\t\\\$1,\\\$1,%got_ofst\\(\[^)\]*\\= )\n" } } */ +/* { dg-final { scan-assembler "\tjr\t\\\$1\n" } } */ + +#include "branch-helper.h" + +NOMIPS16 void +foo (int (*bar) (void), int *x) +{ + *x =3D bar (); + if (__builtin_expect (*x =3D=3D 0, 1)) + OCCUPY_0x10000; +} diff --git a/gcc/testsuite/gcc.target/mips/umips-branch-15.c b/gcc/testsuit= e/gcc.target/mips/umips-branch-15.c new file mode 100644 index 0000000..6704aad --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/umips-branch-15.c @@ -0,0 +1,13 @@ +/* { dg-options "-mshared -mabi=3D64 -mmicromips" } */ +/* { dg-final { scan-assembler-not "(\\\$28|%gp_rel|%got)" } } */ +/* { dg-final { scan-assembler-not "\tjrc?\t\\\$1\n" } } */ + +#include "branch-helper.h" + +NOMIPS16 void +foo (int (*bar) (void), int *x) +{ + *x =3D bar (); + if (__builtin_expect (*x =3D=3D 0, 1)) + OCCUPY_0xfffc; +} diff --git a/gcc/testsuite/gcc.target/mips/umips-branch-16.c b/gcc/testsuit= e/gcc.target/mips/umips-branch-16.c new file mode 100644 index 0000000..95f7db5 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/umips-branch-16.c @@ -0,0 +1,17 @@ +/* { dg-options "-mshared -mabi=3D64 -mmicromips" } */ +/* { dg-final { scan-assembler "\tsd\t\\\$28," } } */ +/* { dg-final { scan-assembler "\tld\t\\\$28," } } */ +/* { dg-final { scan-assembler "\tdaddiu\t\\\$28,\\\$28,%lo\\(%neg\\(%gp_r= el\\(foo\\)\\)\\)\n" } } */ +/* { dg-final { scan-assembler "\tld\t\\\$1,%got_page\\(\[^)\]*\\)\\(\\\$2= 8\\)\n" } } */ +/* { dg-final { scan-assembler "\tdaddiu\t\\\$1,\\\$1,%got_ofst\\(\[^)\]*\= \)\n" } } */ +/* { dg-final { scan-assembler "\tjr\t\\\$1\n" } } */ + +#include "branch-helper.h" + +NOMIPS16 void +foo (int (*bar) (void), int *x) +{ + *x =3D bar (); + if (__builtin_expect (*x =3D=3D 0, 1)) + OCCUPY_0x10000; +} diff --git a/gcc/testsuite/gcc.target/mips/umips-branch-17.c b/gcc/testsuit= e/gcc.target/mips/umips-branch-17.c new file mode 100644 index 0000000..acf5675 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/umips-branch-17.c @@ -0,0 +1,24 @@ +/* An executable version of branch-2.c. */ +/* { dg-options "-mmicromips" } */ +/* { dg-do run } */ + +#include "branch-helper.h" + +void __attribute__((noinline)) +foo (volatile int *x) +{ + if (__builtin_expect (*x =3D=3D 0, 1)) + OCCUPY_0xfffc; +} + +int +main (void) +{ + int x =3D 0; + int y =3D 1; + + foo (&x); + foo (&y); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/mips/umips-branch-18.c b/gcc/testsuit= e/gcc.target/mips/umips-branch-18.c new file mode 100644 index 0000000..e08ba5d --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/umips-branch-18.c @@ -0,0 +1,24 @@ +/* An executable version of branch-3.c. */ +/* { dg-options "-mmicromips" } */ +/* { dg-do run } */ + +#include "branch-helper.h" + +void +foo (volatile int *x) +{ + if (__builtin_expect (*x =3D=3D 0, 1)) + OCCUPY_0x10000; +} + +int +main (void) +{ + int x =3D 0; + int y =3D 1; + + foo (&x); + foo (&y); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/mips/umips-branch-5.c b/gcc/testsuite= /gcc.target/mips/umips-branch-5.c new file mode 100644 index 0000000..d124f91 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/umips-branch-5.c @@ -0,0 +1,13 @@ +/* { dg-options "-mshared -mabi=3D32 -mmicromips" } */ +/* { dg-final { scan-assembler-not "(\\\$25|\\\$28|cpload)" } } */ +/* { dg-final { scan-assembler-not "\tjr\t\\\$1\n" } } */ +/* { dg-final { scan-assembler-not "\\.cprestore" } } */ + +#include "branch-helper.h" + +NOMIPS16 void +foo (volatile int *x) +{ + if (__builtin_expect (*x =3D=3D 0, 1)) + OCCUPY_0xfffc; +} diff --git a/gcc/testsuite/gcc.target/mips/umips-branch-6.c b/gcc/testsuite= /gcc.target/mips/umips-branch-6.c new file mode 100644 index 0000000..d688bc9 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/umips-branch-6.c @@ -0,0 +1,13 @@ +/* { dg-options "-mshared -mabi=3D32 -mmicromips" } */ +/* { dg-final { scan-assembler "\t\\.cpload\t\\\$25\n" } } */ +/* { dg-final { scan-assembler "\tjr\t\\\$1\n" } } */ +/* { dg-final { scan-assembler-not "\\.cprestore" } } */ + +#include "branch-helper.h" + +NOMIPS16 void +foo (volatile int *x) +{ + if (__builtin_expect (*x =3D=3D 0, 1)) + OCCUPY_0x10000; +} diff --git a/gcc/testsuite/gcc.target/mips/umips-branch-7.c b/gcc/testsuite= /gcc.target/mips/umips-branch-7.c new file mode 100644 index 0000000..294805a --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/umips-branch-7.c @@ -0,0 +1,12 @@ +/* { dg-options "-mshared -mabi=3Dn32 -mmicromips" } */ +/* { dg-final { scan-assembler-not "(\\\$25|\\\$28|%gp_rel|%got)" } } */ +/* { dg-final { scan-assembler-not "\tjrc?\t\\\$1\n" } } */ + +#include "branch-helper.h" + +NOMIPS16 void +foo (volatile int *x) +{ + if (__builtin_expect (*x =3D=3D 0, 1)) + OCCUPY_0xfffc; +} diff --git a/gcc/testsuite/gcc.target/mips/umips-branch-8.c b/gcc/testsuite= /gcc.target/mips/umips-branch-8.c new file mode 100644 index 0000000..02273cf --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/umips-branch-8.c @@ -0,0 +1,14 @@ +/* { dg-options "-mshared -mabi=3Dn32 -mmicromips" } */ +/* { dg-final { scan-assembler "\taddiu\t\\\$3,\\\$3,%lo\\(%neg\\(%gp_rel\= \(foo\\)\\)\\)\n" } } */ +/* { dg-final { scan-assembler "\tlw\t\\\$1,%got_page\\(\[^)\]*\\)\\(\\\$3= \\)\\n" } } */ +/* { dg-final { scan-assembler "\tjr\t\\\$1\n" } } */ +/* { dg-final { scan-assembler-not "\\\$28" } } */ + +#include "branch-helper.h" + +NOMIPS16 void +foo (volatile int *x) +{ + if (__builtin_expect (*x =3D=3D 0, 1)) + OCCUPY_0x10000; +} diff --git a/gcc/testsuite/gcc.target/mips/umips-branch-9.c b/gcc/testsuite= /gcc.target/mips/umips-branch-9.c new file mode 100644 index 0000000..ab02e88 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/umips-branch-9.c @@ -0,0 +1,12 @@ +/* { dg-options "-mshared -mabi=3D64 -mmicromips" } */ +/* { dg-final { scan-assembler-not "(\\\$25|\\\$28|%gp_rel|%got)" } } */ +/* { dg-final { scan-assembler-not "\tjrc?\t\\\$1\n" } } */ + +#include "branch-helper.h" + +NOMIPS16 void +foo (volatile int *x) +{ + if (__builtin_expect (*x =3D=3D 0, 1)) + OCCUPY_0xfffc; +} --=20 1.7.1