This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH PR72817/PR73450]Fix wrong code caused by niter analyzer for NE_EXPR exit cond.
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Bin Cheng <Bin dot Cheng at arm dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, nd <nd at arm dot com>
- Date: Wed, 17 Aug 2016 00:09:01 +0200
- Subject: Re: [PATCH PR72817/PR73450]Fix wrong code caused by niter analyzer for NE_EXPR exit cond.
- Authentication-results: sourceware.org; auth=none
- References: <AM4PR0802MB2163D2B5FB7166CA568A623FE71E0@AM4PR0802MB2163.eurprd08.prod.outlook.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Aug 11, 2016 at 04:35:51PM +0000, Bin Cheng wrote:
> 2016-08-11 Bin Cheng <bin.cheng@arm.com>
>
> PR tree-optimization/72817
> PR tree-optimization/73450
> * gcc.dg/tree-ssa/pr72817.c: New test.
> * gcc.dg/tree-ssa/pr73450.c: New test.
> --- /dev/null
> +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr72817.c
> @@ -0,0 +1,13 @@
> +/* { dg-do run } */
> +/* { dg-options "-O3" } */
> +
> +char a;
> +short b;
> +
> +int main ()
> +{
> + for (a = 3; a != -1; a -= 5)
> + while (b)
> + ;
> + return 0;
> +}
The testcase hangs for obvious reasons on -funsigned-char defaulting
targets. Fixed thusly, committed as obvious:
2016-08-16 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/72817
* gcc.dg/tree-ssa/pr72817.c (a): Change type from char to signed char.
--- gcc.dg/tree-ssa/pr72817.c (revision 239513)
+++ gcc.dg/tree-ssa/pr72817.c (revision 239514)
@@ -1,7 +1,7 @@
/* { dg-do run } */
/* { dg-options "-O3" } */
-char a;
+signed char a;
short b;
int main ()
Jakub