From patchwork Thu Jun 16 06:42:49 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [PR45098] Disallow NULL pointer in pointer arithmetic Date: Wed, 15 Jun 2011 20:42:49 -0000 From: Tom de Vries X-Patchwork-Id: 100597 Message-Id: <4DF9A5E9.8080703@codesourcery.com> To: Zdenek Dvorak Cc: gcc-patches@gcc.gnu.org On 06/16/2011 08:39 AM, Tom de Vries wrote: > I will sent the adapted test cases in a separate email. Update 2 test cases to be more strict, and more like the original example. Thanks, - Tom 2011-06-15 Tom de Vries PR target/45098 * gcc.target/arm/ivopts-3.c: Update test. * gcc.target/arm/ivopts-5.c: Same. diff -u gcc/testsuite/gcc.target/arm/ivopts-3.c (revision 0) gcc/testsuite/gcc.target/arm/ivopts-3.c (revision 0) --- gcc/testsuite/gcc.target/arm/ivopts-3.c (revision 0) +++ gcc/testsuite/gcc.target/arm/ivopts-3.c (revision 0) @@ -8,14 +8,8 @@ { int sum = 0; unsigned int x; - x = 0; - while (1) - { - sum += foo2 (&array[x]); - if (!(x < n)) - break; - x++; - } + for (x = 0; x < n; ++x) + sum += foo2 (&array[x]); return sum; } diff -u gcc/testsuite/gcc.target/arm/ivopts-5.c (revision 0) gcc/testsuite/gcc.target/arm/ivopts-5.c (revision 0) --- gcc/testsuite/gcc.target/arm/ivopts-5.c (revision 0) +++ gcc/testsuite/gcc.target/arm/ivopts-5.c (revision 0) @@ -8,14 +8,8 @@ { int sum = 0; unsigned int x; - x = 0; - while (1) - { - sum += foo (&array[x]); - if (!(x < n)) - break; - x++; - } + for (x = 0; x < n; ++x) + sum += foo (&array[x]); return sum; }