[cfe-dev] OpenMP support in CLANG: A proposal

Mahesha HS mahesha.llvm at gmail.com
Wed Nov 7 20:20:53 PST 2012

Ok. Shall I assume the following basic thumb rule for our OpenMP
support in Clang?

"The OpenMP annotated C/C++ source when compiled with OpenMP
*disabled* should be (both syntactically and semantically) equal to
its sequential counterpart. Any OpenMP (non-standard) extension which
violates the above rule will not be supported even if it will going to
be *not* compatible with existing OpenMP compilers".


On Thu, Nov 8, 2012 at 9:01 AM, Dmitri Gribenko <gribozavr at gmail.com> wrote:
> Hi Mahesha,
> On Wed, Nov 7, 2012 at 7:20 PM, Mahesha HS <mahesha.llvm at gmail.com> wrote:
>> Sometimes, the *dry* definitions of standard (I do not hesitate to use
>> the word *dry* here) makes the implementation job very messy. And, I
>> am sure, it is true in all standards including C/C++ standard.
> I think it would actually be easier to just handle an expression
> inside the if() clause.
>> GCC ( g++ ) happily reports *un-declared* error for the variable VarA
>> when I do not pass -fopenmp option, and abort the compilation. Yes,
>> OpenMP spirit is clearly broken here.  Though, I did not test the
>> other compilers, I guess that they follow GCC for whatever the
>> reasons.
>> And, now, if Clang starts fighting against these clearly violated
>> rules, it is very probable that users will start their voice against
>> it.
> While it makes sense to be compatible with other compilers, being
> bug-for-bug compatible is clearly the wrong way to go.  This
> "extension" violates the OMP spirit, has vague semantics and thus, in
> my opinion, has no practical use.
> Dmitri
> --
> main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
> (j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/


More information about the cfe-dev mailing list