This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix for PR c/57490
- From: Jakub Jelinek <jakub at redhat dot com>
- To: "Iyer, Balaji V" <balaji dot v dot iyer at intel dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- Date: Mon, 1 Jul 2013 19:09:26 +0200
- Subject: Re: [PATCH] Fix for PR c/57490
- References: <BF230D13CA30DD48930C31D4099330003A43C80E at FMSMSX101 dot amr dot corp dot intel dot com> <20130701162401 dot GY2336 at tucnak dot redhat dot com> <BF230D13CA30DD48930C31D4099330003A43C87D at FMSMSX101 dot amr dot corp dot intel dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Mon, Jul 01, 2013 at 05:02:57PM +0000, Iyer, Balaji V wrote:
> OK. The fixed patch is attached. Here are the ChangeLog entries:
>
> gcc/cp/ChangeLog
> 2013-07-01 Balaji V. Iyer <balaji.v.iyer@intel.com>
>
Still
PR c/57490
hasn't been added to cp/ChangeLog and c/ChangeLog entries.
> --- /dev/null
> +++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57490.c
> @@ -0,0 +1,25 @@
Do you want the testcase just as a compile time test (dunno what
is the default for cilk-plus.exp)? If it would be usable as
a runtime test, it would be better to just convert it into a
runtime test (then of course you can't use __assert, but
do something like:
#define assert(x) do { if (!(x)) __builtin_abort () } while (0)
and use
assert (__sec_reduce_add(x[0:n]) == 3.0f * n);
etc. in the testcase, or just write the conditionals plus
__builtin_abort etc. And add /* { dg-do run } */.
> +extern void __assert(const char *, const char *, int);
> +const int n = 8;
> +float x[8], y[8], z[8];
> +int main() {
> + int i = 0;
> + float x_sum =0;
> + for(i=1; i<=5; i+=4 ) {
> + x[0:n] = 3;
> + y[0:n] = i;
> + z[0:n] = 0;
> + (void)((__sec_reduce_add(x[0:n])==(float)3*n) || (__assert("__sec_reduce_add(x[0:n])==3*n", "an-if.c", 28), 0));
> + (void)((__sec_reduce_add(y[0:n])==(float)i*n) || (__assert("__sec_reduce_add(y[0:n])==i*n", "an-if.c", 29), 0));
> + (void)((__sec_reduce_add(z[0:n])==(float)0) || (__assert("__sec_reduce_add(z[0:n])==0", "an-if.c", 30), 0));
> +
> + if (x[0:n] >= y[0:n]) {
> + z[0:n] = x[0:n] - y[0:n];
> + } else {
> + z[0:n] = x[0:n] + y[0:n];
> + }
> + (void)((__sec_reduce_add(x[0:n])==(float)3*n) || (__assert("__sec_reduce_add(x[0:n])==3*n", "an-if.c", 43), 0));
> + (void)((__sec_reduce_add(y[0:n])==(float)i*n) || (__assert("__sec_reduce_add(y[0:n])==i*n", "an-if.c", 44), 0));
> + (void)((__sec_reduce_add(z[0:n])==(float)(3>=i?3-i:3+i)*n) || (__assert("__sec_reduce_add(z[0:n])==(3>=i?3-i:3+i)*n", "an-if.c", 45), 0));
> + }
> + return 0;
> +}
Jakub