Paul,

the piece of code that causes an issue with PGI 2013 and older is just a
bit more complex.

here is the enhanced test :

struct S { int i; double d; };
struct Y { struct S s; } ;
struct S x = {1,0};

int main (void)
{
  struct Y y = { .s = x };
  return 0;
}


it compiles just fine with PGI 2014 (14.7) but fails with PGI 2013
(13.9) and 2012 (12.10)
-c9x nor -c99 help with the older compilers :

[gouaillardet@soleil tmp]$ /opt/pgi/linux86-64/14.7/bin/pgcc -c test.c
[gouaillardet@soleil tmp]$ /opt/pgi/linux86-64/13.9/bin/pgcc -c test.c
PGC-S-0094-Illegal type conversion required (test.c: 7)
PGC/x86-64 Linux 13.9-0: compilation completed with severe errors
[gouaillardet@soleil tmp]$ /opt/pgi/linux86-64/12.10/bin/pgcc -c test.c
PGC-S-0094-Illegal type conversion required (test.c: 7)
PGC/x86-64 Linux 12.10-0: compilation completed with severe errors
[gouaillardet@soleil tmp]$ /opt/pgi/linux86-64/13.9/bin/pgcc -c9x -c test.c
PGC-S-0094-Illegal type conversion required (test.c: 7)
PGC/x86-64 Linux 13.9-0: compilation completed with severe errors
[gouaillardet@soleil tmp]$ /opt/pgi/linux86-64/13.9/bin/pgcc -c99 -c test.c
PGC-S-0094-Illegal type conversion required (test.c: 7)
PGC/x86-64 Linux 13.9-0: compilation completed with severe errors


so unless there is room for interpretation in C99, this is a compiler bug.

All,

one option is r32555
an other option is to detect this in configure and skip the scif btl
an other option is not to support PGI compilers 2013 and older
and i am out of ideas for other options ...

imho, r32555 is the less worst (not to say the best) option here

Cheers,

Gilles

On 2014/08/21 2:06, Paul Hargrove wrote:
> Can somebody confirm that configure is adding "-c9x" or "-c99" to CFLAGS
> with this compiler?
> If not then r32555 could possibly be reverted in favor of adding the proper
> compiler flag.
>
> Also, I am suspicious of this failure because even without a language-level
> option pgcc 12.9 and 13.4 compile the following:
>
> struct S { int i; double d; };
> struct S x = {1,0};
> int main (void)
> {
>   struct S y = { .i = x.i };
>   return y.i;
> }
>
>
> -Paul
>
>
> On Wed, Aug 20, 2014 at 7:20 AM, Nathan Hjelm <hje...@lanl.gov> wrote:
>
>> Really? That means PGI 2013 is NOT C99 compliant! Figures.
>>
>> -Nathan
>>
>> On Tue, Aug 19, 2014 at 10:48:48PM -0400, svn-commit-mai...@open-mpi.org
>> wrote:
>>> Author: ggouaillardet (Gilles Gouaillardet)
>>> Date: 2014-08-19 22:48:47 EDT (Tue, 19 Aug 2014)
>>> New Revision: 32555
>>> URL: https://svn.open-mpi.org/trac/ompi/changeset/32555
>>>
>>> Log:
>>> btl/scif: use safe syntax
>>>
>>> PGI compilers 2013 and older do not support the following syntax :
>>> mca_btl_scif_modex_t modex = {.port_id = mca_btl_scif_module.port_id};
>>> so split it on two lines
>>>
>>> cmr=v1.8.2:reviewer=hjelmn
>>>
>>> Text files modified:
>>>    trunk/opal/mca/btl/scif/btl_scif_component.c |     3 ++-
>>>    1 files changed, 2 insertions(+), 1 deletions(-)
>>>
>>> Modified: trunk/opal/mca/btl/scif/btl_scif_component.c
>>>
>> ==============================================================================
>>> --- trunk/opal/mca/btl/scif/btl_scif_component.c      Tue Aug 19
>> 18:34:49 2014        (r32554)
>>> +++ trunk/opal/mca/btl/scif/btl_scif_component.c      2014-08-19
>> 22:48:47 EDT (Tue, 19 Aug 2014)      (r32555)
>>> @@ -208,7 +208,8 @@
>>>
>>>  static int mca_btl_scif_modex_send (void)
>>>  {
>>> -    mca_btl_scif_modex_t modex = {.port_id =
>> mca_btl_scif_module.port_id};
>>> +    mca_btl_scif_modex_t modex;
>>> +    modex.port_id = mca_btl_scif_module.port_id;
>>>
>>>      return opal_modex_send (&mca_btl_scif_component.super.btl_version,
>> &modex, sizeof (modex));
>>>  }
>>> _______________________________________________
>>> svn mailing list
>>> s...@open-mpi.org
>>> http://www.open-mpi.org/mailman/listinfo.cgi/svn
>> _______________________________________________
>> devel mailing list
>> de...@open-mpi.org
>> Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/devel
>> Link to this post:
>> http://www.open-mpi.org/community/lists/devel/2014/08/15667.php
>>
>
>
>
>
> _______________________________________________
> devel mailing list
> de...@open-mpi.org
> Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/devel
> Link to this post: 
> http://www.open-mpi.org/community/lists/devel/2014/08/15669.php

Reply via email to