Bug 42753 - _Complex_I is reported as undeclared. Code builds with Sun compiler.
Summary: _Complex_I is reported as undeclared. Code builds with Sun compiler.
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.4.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
: 42755 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-01-15 09:03 UTC by Dr. David Kirkby
Modified: 2011-07-18 16:22 UTC (History)
3 users (show)

See Also:
Host:
Target: *-*-solaris*
Build:
Known to work:
Known to fail: 3.4.3, 4.4.1
Last reconfirmed:


Attachments
C source code that generates error (301 bytes, text/x-csrc)
2010-01-15 09:18 UTC, Dr. David Kirkby
Details
Preprocessed header (1.61 KB, text/plain)
2010-01-15 09:19 UTC, Dr. David Kirkby
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dr. David Kirkby 2010-01-15 09:03:27 UTC
The following piece of code, will not build with gcc 3.4.3 or gcc 4.4.1 on the above SPARC system. It does build on at least some Linux systems. It is somewhat similar to bug #21057 though that was reported against the C++ compiler g++, rather than gcc. 

It will not build on an Open Solaris system either, but I'll file that as a separate bug. 

kirkby@t2:[~] $ uname -a
SunOS t2 5.10 Generic_141414-02 sun4v sparc SUNW,T5240

kirkby@t2:[~] $ cat /etc/release
                       Solaris 10 5/09 s10s_u7wos_08 SPARC
           Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
                        Use is subject to license terms.
                             Assembled 30 March 2009


Fist, it should be noted it builds with the Sun compiler, and executes as expected, showing _Complex_I is defined. 

kirkby@t2:[~] $ /opt/SUNWspro/bin/cc -V simple_complex.c
cc: Sun C 5.9 SunOS_sparc Patch 124867-11 2009/04/30
acomp: Sun C 5.9 SunOS_sparc Patch 124867-11 2009/04/30
ld: Software Generation Utilities - Solaris Link Editors: 5.10-1.496
kirkby@t2:[~] $ ./a.out
CYTHON_CCOMPLEX 1

Here's the source code. 

kirkby@t2:[~] $ cat simple_complex.c
#include "stdio.h"
#include "complex.h"

#if defined(_Complex_I)
    #define CYTHON_CCOMPLEX 1
#else
    #define CYTHON_CCOMPLEX 0
#endif


#if CYTHON_CCOMPLEX
    typedef double _Complex __pyx_t_double_complex;
#else
    typedef struct { double real, imag; } __pyx_t_double_complex;
#endif


#if CYTHON_CCOMPLEX
    static __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      return x + y*(__pyx_t_double_complex)_Complex_I;
      //return 0;
    }
#else
    static __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
       __pyx_t_double_complex z;
       z.real = x;
       z.imag = y;
       return z;
    }
#endif

int main(int argc, char** argv) {
    printf("CYTHON_CCOMPLEX %d\n", CYTHON_CCOMPLEX);
    return 0;
}


kirkby@t2:[~] $ /opt/SUNWspro/bin/cc simple_complex.c
kirkby@t2:[~] $ ./a.out
CYTHON_CCOMPLEX 1


Here is the failure with gcc

kirkby@t2:[~] $  gcc -v -std=c99 simple_complex.c 
Using built-in specs.
Target: sparc-sun-solaris2.10
Configured with: ../gcc-4.4.1/configure --prefix=/usr/local/gcc-4.4.1-sun-linker/ --with-as=/usr/ccs/bin/as --without-gnu-as --with-ld=/usr/ccs/bin/ld --without-gnu-ld --enable-languages=c,c++,fortran --with-mpfr-include=/usr/local/include --with-mpfr-lib=/usr/local/lib --with-gmp-include=/usr/local/include --with-gmp-lib=/usr/local/lib CC=/usr/sfw/bin/gcc CXX=/usr/sfw/bin/g++
Thread model: posix
gcc version 4.4.1 (GCC) 
COLLECT_GCC_OPTIONS='-v' '-std=c99' '-mcpu=v9'
 /usr/local/gcc-4.4.1-sun-linker/bin/../libexec/gcc/sparc-sun-solaris2.10/4.4.1/cc1 -quiet -v -iprefix /usr/local/gcc-4.4.1-sun-linker/bin/../lib/gcc/sparc-sun-solaris2.10/4.4.1/ -D__sparcv8 simple_complex.c -quiet -dumpbase simple_complex.c -mcpu=v9 -auxbase simple_complex -std=c99 -version -o /var/tmp//ccKtOZ4e.s
ignoring nonexistent directory "/usr/local/gcc-4.4.1-sun-linker/bin/../lib/gcc/sparc-sun-solaris2.10/4.4.1/../../../../sparc-sun-solaris2.10/include"
ignoring duplicate directory "/usr/local/gcc-4.4.1-sun-linker/bin/../lib/gcc/../../lib/gcc/sparc-sun-solaris2.10/4.4.1/include"
ignoring duplicate directory "/usr/local/gcc-4.4.1-sun-linker/bin/../lib/gcc/../../lib/gcc/sparc-sun-solaris2.10/4.4.1/include-fixed"
ignoring nonexistent directory "/usr/local/gcc-4.4.1-sun-linker/bin/../lib/gcc/../../lib/gcc/sparc-sun-solaris2.10/4.4.1/../../../../sparc-sun-solaris2.10/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/gcc-4.4.1-sun-linker/bin/../lib/gcc/sparc-sun-solaris2.10/4.4.1/include
 /usr/local/gcc-4.4.1-sun-linker/bin/../lib/gcc/sparc-sun-solaris2.10/4.4.1/include-fixed
 /usr/local/include
 /usr/local/gcc-4.4.1-sun-linker/bin/../lib/gcc/../../include
 /usr/include
End of search list.
GNU C (GCC) version 4.4.1 (sparc-sun-solaris2.10)
        compiled by GNU C version 4.4.1, GMP version 4.3.1, MPFR version 2.4.1.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: e89036b586fe85e82df0096e13fb8898
simple_complex.c: In function ‘__pyx_t_double_complex_from_parts’:
simple_complex.c:20: error: ‘_Complex_I’ undeclared (first use in this function)
simple_complex.c:20: error: (Each undeclared identifier is reported only once
simple_complex.c:20: error: for each function it appears in.)

I'm somewhat puzzled I can't see any option to attach a file, so I'll put inline the preprocessed file, generated with: 

kirkby@t2:[~] $  gcc -v -save-temps -std=c99 simple_complex.c 

kirkby@t2:[~] $ cat simple_complex.i
# 1 "simple_complex.c"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "simple_complex.c"
# 1 "/usr/include/stdio.h" 1 3 4
# 20 "/usr/include/stdio.h" 3 4
#pragma ident "@(#)stdio.h      1.84    04/09/28 SMI"

# 1 "/usr/local/gcc-4.4.1-sun-linker/bin/../lib/gcc/sparc-sun-solaris2.10/4.4.1/include-fixed/sys/feature_tests.h" 1 3 4
# 18 "/usr/local/gcc-4.4.1-sun-linker/bin/../lib/gcc/sparc-sun-solaris2.10/4.4.1/include-fixed/sys/feature_tests.h" 3 4
#pragma ident "@(#)feature_tests.h      1.25    07/02/02 SMI"

# 1 "/usr/include/sys/ccompile.h" 1 3 4
# 9 "/usr/include/sys/ccompile.h" 3 4
#pragma ident "@(#)ccompile.h   1.2     04/11/08 SMI"
# 21 "/usr/local/gcc-4.4.1-sun-linker/bin/../lib/gcc/sparc-sun-solaris2.10/4.4.1/include-fixed/sys/feature_tests.h" 2 3 4
# 1 "/usr/include/sys/isa_defs.h" 1 3 4
# 9 "/usr/include/sys/isa_defs.h" 3 4
#pragma ident "@(#)isa_defs.h   1.29    08/06/06 SMI"
# 22 "/usr/local/gcc-4.4.1-sun-linker/bin/../lib/gcc/sparc-sun-solaris2.10/4.4.1/include-fixed/sys/feature_tests.h" 2 3 4
# 23 "/usr/include/stdio.h" 2 3 4
# 67 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/iso/stdio_iso.h" 1 3 4
# 32 "/usr/include/iso/stdio_iso.h" 3 4
#pragma ident "@(#)stdio_iso.h  1.8     05/08/16 SMI"


# 1 "/usr/include/sys/va_list.h" 1 3 4
# 16 "/usr/include/sys/va_list.h" 3 4
#pragma ident "@(#)va_list.h    1.15    04/11/19 SMI"
# 99 "/usr/include/sys/va_list.h" 3 4
typedef __builtin_va_list __gnuc_va_list;





typedef __builtin_va_list __va_list;
# 36 "/usr/include/iso/stdio_iso.h" 2 3 4
# 1 "/usr/include/stdio_tag.h" 1 3 4
# 9 "/usr/include/stdio_tag.h" 3 4
#pragma ident "@(#)stdio_tag.h  1.4     04/09/28 SMI"
# 21 "/usr/include/stdio_tag.h" 3 4
typedef struct __FILE __FILE;
# 37 "/usr/include/iso/stdio_iso.h" 2 3 4
# 1 "/usr/include/stdio_impl.h" 1 3 4
# 9 "/usr/include/stdio_impl.h" 3 4
#pragma ident "@(#)stdio_impl.h 1.15    07/03/05 SMI"
# 29 "/usr/include/stdio_impl.h" 3 4
struct __FILE
{




 int _cnt;
 unsigned char *_ptr;

 unsigned char *_base;
 unsigned char _flag;
 unsigned char _file;

 unsigned __orientation:2;
 unsigned __ionolock:1;
 unsigned __seekable:1;
 unsigned __extendedfd:1;
 unsigned __xf_nocheck:1;
 unsigned __filler:10;
};
# 38 "/usr/include/iso/stdio_iso.h" 2 3 4
# 74 "/usr/include/iso/stdio_iso.h" 3 4
typedef __FILE FILE;







typedef unsigned int size_t;




typedef long fpos_t;
# 146 "/usr/include/iso/stdio_iso.h" 3 4
extern __FILE __iob[20];
# 189 "/usr/include/iso/stdio_iso.h" 3 4
extern int remove(const char *);
extern int rename(const char *, const char *);
extern FILE *tmpfile(void);
extern char *tmpnam(char *);
extern int fclose(FILE *);
extern int fflush(FILE *);
extern FILE *fopen(const char *restrict, const char *restrict);
extern FILE *freopen(const char *restrict,
   const char *restrict, FILE *restrict);
extern void setbuf(FILE *restrict, char *restrict);
extern int setvbuf(FILE *restrict, char *restrict, int,
   size_t);

extern int fprintf(FILE *restrict, const char *restrict, ...);

extern int fscanf(FILE *restrict, const char *restrict, ...);

extern int printf(const char *restrict, ...);

extern int scanf(const char *restrict, ...);

extern int sprintf(char *restrict, const char *restrict, ...);

extern int sscanf(const char *restrict,
   const char *restrict, ...);
extern int vfprintf(FILE *restrict, const char *restrict,
   __va_list);
extern int vprintf(const char *restrict, __va_list);
extern int vsprintf(char *restrict, const char *restrict,
   __va_list);
extern int fgetc(FILE *);
extern char *fgets(char *restrict, int, FILE *restrict);
extern int fputc(int, FILE *);
extern int fputs(const char *restrict, FILE *restrict);


extern int getc(FILE *);
extern int putc(int, FILE *);



extern int getchar(void);
extern int putchar(int);

extern char *gets(char *);
extern int puts(const char *);
extern int ungetc(int, FILE *);
extern size_t fread(void *restrict, size_t, size_t,
 FILE *restrict);
extern size_t fwrite(const void *restrict, size_t, size_t,
 FILE *restrict);

extern int fgetpos(FILE *restrict, fpos_t *restrict);
extern int fsetpos(FILE *, const fpos_t *);

extern int fseek(FILE *, long, int);
extern long ftell(FILE *);
extern void rewind(FILE *);


extern void clearerr(FILE *);
extern int feof(FILE *);
extern int ferror(FILE *);

extern void perror(const char *);


extern int __filbuf(FILE *);
extern int __flsbuf(int, FILE *);
# 68 "/usr/include/stdio.h" 2 3 4
# 136 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/iso/stdio_c99.h" 1 3 4
# 20 "/usr/include/iso/stdio_c99.h" 3 4
#pragma ident "@(#)stdio_c99.h  1.2     04/03/29 SMI"
# 54 "/usr/include/iso/stdio_c99.h" 3 4
extern int vfscanf(FILE *restrict, const char *restrict, __va_list);
extern int vscanf(const char *restrict, __va_list);
extern int vsscanf(const char *restrict, const char *restrict,
  __va_list);
# 68 "/usr/include/iso/stdio_c99.h" 3 4
extern int snprintf(char *restrict, size_t, const char *restrict,
 ...);
extern int vsnprintf(char *restrict, size_t, const char *restrict,
 __va_list);
# 137 "/usr/include/stdio.h" 2 3 4
# 198 "/usr/include/stdio.h" 3 4
extern unsigned char _sibuf[], _sobuf[];
# 230 "/usr/include/stdio.h" 3 4
extern unsigned char *_bufendtab[];
extern FILE *_lastbuf;
# 2 "simple_complex.c" 2
# 1 "/usr/include/complex.h" 1 3 4
# 9 "/usr/include/complex.h" 3 4
#pragma ident "@(#)complex.h    1.9     04/10/23 SMI"
# 24 "/usr/include/complex.h" 3 4
extern float cabsf(float _Complex);
extern float cargf(float _Complex);
extern float cimagf(float _Complex);
extern float crealf(float _Complex);
extern float _Complex cacosf(float _Complex);
extern float _Complex cacoshf(float _Complex);
extern float _Complex casinf(float _Complex);
extern float _Complex casinhf(float _Complex);
extern float _Complex catanf(float _Complex);
extern float _Complex catanhf(float _Complex);
extern float _Complex ccosf(float _Complex);
extern float _Complex ccoshf(float _Complex);
extern float _Complex cexpf(float _Complex);
extern float _Complex clogf(float _Complex);
extern float _Complex conjf(float _Complex);
extern float _Complex cpowf(float _Complex, float _Complex);
extern float _Complex cprojf(float _Complex);
extern float _Complex csinf(float _Complex);
extern float _Complex csinhf(float _Complex);
extern float _Complex csqrtf(float _Complex);
extern float _Complex ctanf(float _Complex);
extern float _Complex ctanhf(float _Complex);

extern double cabs(double _Complex);
extern double carg(double _Complex);
extern double cimag(double _Complex);
extern double creal(double _Complex);
extern double _Complex cacos(double _Complex);
extern double _Complex cacosh(double _Complex);
extern double _Complex casin(double _Complex);
extern double _Complex casinh(double _Complex);
extern double _Complex catan(double _Complex);
extern double _Complex catanh(double _Complex);
extern double _Complex ccos(double _Complex);
extern double _Complex ccosh(double _Complex);
extern double _Complex cexp(double _Complex);

        
# 61 "/usr/include/complex.h" 3 4
#pragma redefine_extname clog __clog
# 61 "/usr/include/complex.h" 3 4





extern double _Complex clog(double _Complex);
extern double _Complex conj(double _Complex);
extern double _Complex cpow(double _Complex, double _Complex);
extern double _Complex cproj(double _Complex);
extern double _Complex csin(double _Complex);
extern double _Complex csinh(double _Complex);
extern double _Complex csqrt(double _Complex);
extern double _Complex ctan(double _Complex);
extern double _Complex ctanh(double _Complex);

extern long double cabsl(long double _Complex);
extern long double cargl(long double _Complex);
extern long double cimagl(long double _Complex);
extern long double creall(long double _Complex);
extern long double _Complex cacoshl(long double _Complex);
extern long double _Complex cacosl(long double _Complex);
extern long double _Complex casinhl(long double _Complex);
extern long double _Complex casinl(long double _Complex);
extern long double _Complex catanhl(long double _Complex);
extern long double _Complex catanl(long double _Complex);
extern long double _Complex ccoshl(long double _Complex);
extern long double _Complex ccosl(long double _Complex);
extern long double _Complex cexpl(long double _Complex);
extern long double _Complex clogl(long double _Complex);
extern long double _Complex conjl(long double _Complex);
extern long double _Complex cpowl(long double _Complex, long double _Complex);
extern long double _Complex cprojl(long double _Complex);
extern long double _Complex csinhl(long double _Complex);
extern long double _Complex csinl(long double _Complex);
extern long double _Complex csqrtl(long double _Complex);
extern long double _Complex ctanhl(long double _Complex);
extern long double _Complex ctanl(long double _Complex);
# 3 "simple_complex.c" 2
# 12 "simple_complex.c"
    typedef double _Complex __pyx_t_double_complex;






    static __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      return x + y*(__pyx_t_double_complex)_Complex_I;

    }
# 32 "simple_complex.c"
int main(int argc, char** argv) {
    printf("CYTHON_CCOMPLEX %d\n", 1);
    return 0;
}
Comment 1 Dr. David Kirkby 2010-01-15 09:18:18 UTC
Created attachment 19604 [details]
C source code that generates error
Comment 2 Dr. David Kirkby 2010-01-15 09:19:57 UTC
Created attachment 19605 [details]
Preprocessed header
Comment 3 Dr. David Kirkby 2010-01-15 09:27:48 UTC
I discovered the bug first on a Sun Blade 2000 running Solaris 10 while building the Sage maths software. 

http://www.sagemath.org/

A test case was created by Robert Bradshaw. The attached header file was generated on a Sun T5240. 

If necessary, access can be arranged for a serious developer to the system, but it has failed on every Solaris system tested on, including Open Solaris x86 systems, so I assume you will be able to verify it easily. But if not, I can create an account on the T5240. 

Comment 4 Joseph S. Myers 2010-01-15 11:49:19 UTC
This is a fixincludes bug; it needs to fix Sun's complex.h header to
work with GCC.
Comment 5 Joseph S. Myers 2010-01-15 11:51:10 UTC
*** Bug 42755 has been marked as a duplicate of this bug. ***
Comment 6 Joseph S. Myers 2010-01-15 11:52:47 UTC
For reference of people without Solaris headers to hand, the code needing
fixing by fixincludes is:

/*
 * Compilation environments for Solaris must provide the _Imaginary datatype
 * and the compiler intrinsics _Complex_I and _Imaginary_I
 */
#define _Complex_I      _Complex_I
#define complex         _Complex
#define _Imaginary_I    _Imaginary_I
#define imaginary       _Imaginary
#undef  I
#define I               _Imaginary_I

Note there are some TABs there in the original header.
Comment 7 Dr. David Kirkby 2010-01-15 16:02:15 UTC
(In reply to comment #5)
> *** Bug 42755 has been marked as a duplicate of this bug. ***
> 

(In reply to comment #4)
> This is a fixincludes bug; it needs to fix Sun's complex.h header to
> work with GCC.
> 

I've read the fixincludes README, and  http://autogen.SourceForge.net/fixinc.html Perhaps I'm thick, but I have great difficulty in understanding what I am supposed to do. 

Is this a bug in gcc, or just I've not installed gcc fully? The bug has not been marked as CONFIRMED or INVALID, so I'm unsure what you believe it is. 

If it's due to the fact I've mis-installed gcc, I would appreciate some clearer instructions about how to fix this problem. Those fixincludes instructions make very little sense to me. 

The same problem exists with the gcc included by Sun at /usr/sfw/bin/gcc (on SPARC) and also the gcc 4.3.4 build by Blastwave (a well known distributor of Solaris software)

Does the fixincludes actually modify the Solaris header (in which case one would need root access)? 

Would including the above bit of code as another header file solve the problem?  

Comment 8 Joseph S. Myers 2010-01-15 16:30:27 UTC
Fixincludes is part of the compiler sources, and it is the part that should
work around GCC-incompatible system headers (such as this one) by making
fixed copies when GCC is built and installed.  Thus, a failure to fix it
indicates a limitation in fixincludes, and the fix would be to enhance
fixincludes and rebuild GCC.

It is not part of the C front end, so "c" is not the correct component.  Do
not change components back if a maintainer changes them to be more accurate.
Comment 9 Dr. David Kirkby 2010-01-15 18:25:50 UTC
(In reply to comment #8)
> Fixincludes is part of the compiler sources, and it is the part that should
> work around GCC-incompatible system headers (such as this one) by making
> fixed copies when GCC is built and installed.  Thus, a failure to fix it
> indicates a limitation in fixincludes, and the fix would be to enhance
> fixincludes and rebuild GCC.
> 
> It is not part of the C front end, so "c" is not the correct component.  Do
> not change components back if a maintainer changes them to be more accurate.

Is this is trivial fix that could be implemted quickly, or it will require quite a bit of work, and so I should not expect a solution soon? 

Is there any workaround you can suggest? Would simply adding 

#define _Complex_I      _Complex_I
#define complex         _Complex
#define _Imaginary_I    _Imaginary_I
#define imaginary       _Imaginary
#undef  I
#define I               _Imaginary_I

at the top of the source files work? 


Comment 10 jsm-csl@polyomino.org.uk 2010-01-15 18:32:24 UTC
Subject: Re:  _Complex_I is reported as undeclared. Code
 builds with Sun compiler.

On Fri, 15 Jan 2010, david dot kirkby at onetel dot net wrote:

> Is this is trivial fix that could be implemted quickly, or it will require
> quite a bit of work, and so I should not expect a solution soon? 

It could be implemented quickly if someone familiar with fixincludes 
wishes to fix it.

> Is there any workaround you can suggest? Would simply adding 
> 
> #define _Complex_I      _Complex_I
> #define complex         _Complex
> #define _Imaginary_I    _Imaginary_I
> #define imaginary       _Imaginary
> #undef  I
> #define I               _Imaginary_I
> 
> at the top of the source files work? 

Adding copies of the non-GCC definitions certainly won't work.  I suppose 
you could add #undef of the problem macros followed by #define to values 
valid for GCC (such as those used by glibc), after including any system 
headers.

Comment 11 Dr. David Kirkby 2010-01-16 14:27:16 UTC
(In reply to comment #10)
> Subject: Re:  _Complex_I is reported as undeclared. Code
>  builds with Sun compiler.
> 
> On Fri, 15 Jan 2010, david dot kirkby at onetel dot net wrote:
> 
> > Is this is trivial fix that could be implemted quickly, or it will require
> > quite a bit of work, and so I should not expect a solution soon? 
> 
> It could be implemented quickly if someone familiar with fixincludes 
> wishes to fix it.

Do you know of anyone with the necessary knowledge? If so, I'll drop them an email and ask if they would mind looking at it. It is a *major* headache for the GPL Sage maths project, 

http://www.sagemath.org/

as we are having to disable working code on Solaris due to a bug in gcc. 

Unfortunately, not all of Sage will build with Sun's compiler, so that is not an option. 

BTW, the bug is still marked as 'UNCONFIRMED'. Is that still appropriate? 

Dave 

Comment 12 jsm-csl@polyomino.org.uk 2010-01-17 03:36:17 UTC
Subject: Re:  _Complex_I is reported as undeclared. Code
 builds with Sun compiler.

On Sat, 16 Jan 2010, david dot kirkby at onetel dot net wrote:

> Do you know of anyone with the necessary knowledge? If so, I'll drop them an

The correct way to communicate with maintainers is via the mailing lists 
and bug database, not direct contact to individuals.  They are however 
listed in MAINTAINERS.

> as we are having to disable working code on Solaris due to a bug in gcc. 

A bug in Solaris's headers and a missing feature in GCC that it doesn't 
work around that bug.

Comment 13 Dr. David Kirkby 2010-01-17 03:53:19 UTC
(In reply to comment #12)
> Subject: Re:  _Complex_I is reported as undeclared. Code
>  builds with Sun compiler.
> 
> On Sat, 16 Jan 2010, david dot kirkby at onetel dot net wrote:
> 
> > Do you know of anyone with the necessary knowledge? If so, I'll drop them an
> 
> The correct way to communicate with maintainers is via the mailing lists 
> and bug database, not direct contact to individuals.  They are however 
> listed in MAINTAINERS.
> 
> > as we are having to disable working code on Solaris due to a bug in gcc. 
> 
> A bug in Solaris's headers and a missing feature in GCC that it doesn't 
> work around that bug.
> 

Marc Glisse  said on gcc-help "It looks like it was fixed in trunk in Septembre (r151331), did you check?" 

I downloaded gcc-4.4-20100112, but that did not fix the issue. I was hoping it might be fixed in a 4.4.x series, but no such luck. 

I just downloaded gcc-4.5-20100114 in the vague hope that it might be fixed, and the snapshot not cause more problems than it solves. I've not compiled that yet - just had to install MPC first. 

If this is fixed "in trunk" do you do you know I might get that fix? If possible, I'd like to get just the fix applied to the latest stable release (i.e. 4.4.2 plus the fix), so it is as risk-free as reasonably practical. 

Dave 

Comment 14 Rainer Orth 2010-04-28 18:45:41 UTC
The bug was fixed for 4.5 by this patch:

  PATCH: Fix IRIX 6.5/Solaris 2 <complex.h> for GCC (PR libfortran/41169)
  http://gcc.gnu.org/ml/gcc-patches/2009-09/msg00114.html

with a subsequent fix by Ralf Wildenhues.

The 4.4 branch is currently frozen for the 4.4.4 release, and I have no idea
if there are any releases planned after that.  Given that 4.5.0 is already out,
I'd like you to try this one before investing any effort into a backport.

Parallel to this, we should try to get this Solaris CR fixed:

  6549313  /usr/sfw/bin/gcc needs a patched complex.h
  http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6549313

I'd like to get changes made by fixincludes backported to Solaris proper,
but there are only so many hours in a day.
Comment 15 Rainer Orth 2011-07-18 16:22:34 UTC
Fixed for 4.5, no feedback in more than a year, so I assume no backport is
necessary.

  Rainer