This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [GSoC 2019] [extending Csmith for fuzzing OpenMp extensions]
- From: Jakub Jelinek <jakub at redhat dot com>
- To: sameeran joshi <gsocsameeran at gmail dot com>
- Cc: gcc at gcc dot gnu dot org, Andi Kleen <ak at linux dot intel dot com>
- Date: Tue, 26 Mar 2019 09:05:50 +0100
- Subject: Re: [GSoC 2019] [extending Csmith for fuzzing OpenMp extensions]
- References: <CAKz4L0ER_F1N=gxq75pS0=vN5zayDivOCNYz5WZkOX78aDO0KA@mail.gmail.com> <ri64l91t0rz.fsf@suse.cz> <CAKz4L0H6md9OZyfqnw_OXJk6UVtus8cN9zf3hNytXnTPXxrq3g@mail.gmail.com> <20190324025508.GF18020@tassilo.jf.intel.com> <CAKz4L0FPB+HRYiDSMa7rDYRXKKn0V1dqqR7jXDprp4=_+FyPYQ@mail.gmail.com> <87o95yxya1.fsf@linux.intel.com> <20190326072935.GY7611@tucnak> <CAKz4L0E0yyx_pW8OBstv4CvUxkVmsUys7YVu=MbybJUGXgT5PA@mail.gmail.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, Mar 26, 2019 at 01:30:28PM +0530, sameeran joshi wrote:
> > I'd need to see an example of what you are talking about.
>
> int i;
> #pragma omp parallel for
> for (i = (0) ; (i< (20)) ; i++) {
> printf ("\ntest expression fails due to brackets");
> printf ("\n i< (20) works ");
> printf ("\n (i< (20)) fails ");
> }
>
> commands: ~$ gcc fail_for.c -Wall -Wextra -fopenmp
>
> fail_for.c: In function ‘main’:
> fail_for.c:5:17: error: invalid controlling predicate
> for (i = (0) ; (i< (20)) ; i++) {
> ^
That is a correct diagnostics.
See Canonical loop form.
test-expr One of the following:
var relational-op b
b relational-op var
( var relational-op b )
is neither of those.
> struct s{
> int f0;
> };
> void main (){
> int i;
> struct s var1 ;
> #pragma omp parallel for
> for (var1.f0 = 0 ; var1.f0< (20); var1.f0++) {
>
> }
> }
>
> swamimauli@swamimauli:~$ gcc fail_struct.c -Wall -Wextra -fopenmp
> fail_struct.c: In function ‘main’:
> fail_struct.c:9:14: error: expected iteration declaration or
> initialization before ‘var1’
> for (var1.f0 = 0 ; var1.f0< (20); var1.f0++) {
> ^~~~
Yeah, as I said, I believe the intent is that this is not valid, otherwise
the iterator var1.f0 could not be predetermined private, you can't write
private(var1.f0)
and all the compilers I've tried agree with me.
Jakub