public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: How "broken" is C complex number support?
@ 2000-05-23 10:16 Stephen L Moshier
  0 siblings, 0 replies; 7+ messages in thread
From: Stephen L Moshier @ 2000-05-23 10:16 UTC (permalink / raw)
  To: Steven G. Johnson; +Cc: gcc

Steven G. Johnson <stevenj@gil-galad.mit.edu> wrote

> According to http://gcc.gnu.org/c9xstatus.html , support for the C99
> complex type is currently "broken."  What exactly does this mean?
> Is it just that complex numbers in gcc (a longstanding extension) have
> some minor technical incompatibilities with the C99 specification?
> Or is even the gcc version seriously buggy?

The complex type generally works OK on any gcc back to about
gcc-2.7 but no released version works properly with float complex on
64-bit machines.  Double complex might or might not work on certain
64-bit machines.  This problem has been mostly fixed in the development
compiler by Meissner's patches but there are (or were) supposedly
still some problems with inlining, again just on 64-bit computers.

Regarding C99, gcc has no pure imaginary type yet.
C99 complex requires header file and math library support that do not come
with the compiler.  The GNU-linux C library has complex support for C99.
Or you could try a portable suite for C99 complex using gcc from
  http://www.netlib.org/cephes/c9x-complex.shar.gz

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How "broken" is C complex number support?
  2000-05-22  2:15 ` Martin v. Loewis
@ 2000-05-22 11:44   ` Joern Rennecke
  0 siblings, 0 replies; 7+ messages in thread
From: Joern Rennecke @ 2000-05-22 11:44 UTC (permalink / raw)
  To: Martin v. Loewis; +Cc: stevenj, gcc

> I believe that depends on the target. GCC may generate incorrect code
> when passing complex numbers as function arguments.

Yes.  In particular, SCmode (complex float) doesn't work on 64 bit targets.
We need an infrastructure change (the SUBREG_BYTE stuff) to properly fix this.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How "broken" is C complex number support?
  2000-05-20 12:27 Steven G. Johnson
  2000-05-20 12:53 ` Gabriel Dos Reis
@ 2000-05-22  2:15 ` Martin v. Loewis
  2000-05-22 11:44   ` Joern Rennecke
  1 sibling, 1 reply; 7+ messages in thread
From: Martin v. Loewis @ 2000-05-22  2:15 UTC (permalink / raw)
  To: stevenj; +Cc: gcc

> According to http://gcc.gnu.org/c9xstatus.html , support for the C99
> complex type is currently "broken."  What exactly does this mean?  Is it
> just that complex numbers in gcc (a longstanding extension) have some
> minor technical incompatibilities with the C99 specification?  

That is certainly the reason I called the feature buggy. AFAICT,
complex should be a keyword only if <complex.h> is included, and I
believe there are other things that are done incorrectly.

> Or is even the gcc version seriously buggy?

I believe that depends on the target. GCC may generate incorrect code
when passing complex numbers as function arguments.

Regards,
Martin

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How "broken" is C complex number support?
  2000-05-20 13:19   ` Steven G. Johnson
@ 2000-05-20 13:34     ` Gabriel Dos Reis
  0 siblings, 0 replies; 7+ messages in thread
From: Gabriel Dos Reis @ 2000-05-20 13:34 UTC (permalink / raw)
  To: stevenj; +Cc: gcc

"Steven G. Johnson" <stevenj@gil-galad.mit.edu> writes:

| Thanks!  I currently don't have a 64-bit machine (assuming that's what you
| meant to write), so presumably that problem won't affect me and I don't
| need the CVS gcc.  I am just using gcc 2.95.2 on x86 and PPC.

Aha, I (wrongly) assumed you were talking about CVS gcc.  I don't have
any idea of how broken complex support is as far as gcc-2.95.x is
concerned. 

-- Gaby
CodeSourcery, LLC                             http://www.codesourcery.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How "broken" is C complex number support?
  2000-05-20 12:53 ` Gabriel Dos Reis
@ 2000-05-20 13:19   ` Steven G. Johnson
  2000-05-20 13:34     ` Gabriel Dos Reis
  0 siblings, 1 reply; 7+ messages in thread
From: Steven G. Johnson @ 2000-05-20 13:19 UTC (permalink / raw)
  To: gcc

Thanks!  I currently don't have a 64-bit machine (assuming that's what you
meant to write), so presumably that problem won't affect me and I don't
need the CVS gcc.  I am just using gcc 2.95.2 on x86 and PPC.

Steven

On 20 May 2000, Gabriel Dos Reis wrote:
> There used to be addressing mode issue on 6biits machines.  But recent
> patches form from seem to fix the problem.  You're welcome to test it
> and feedback are appreciated.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How "broken" is C complex number support?
  2000-05-20 12:27 Steven G. Johnson
@ 2000-05-20 12:53 ` Gabriel Dos Reis
  2000-05-20 13:19   ` Steven G. Johnson
  2000-05-22  2:15 ` Martin v. Loewis
  1 sibling, 1 reply; 7+ messages in thread
From: Gabriel Dos Reis @ 2000-05-20 12:53 UTC (permalink / raw)
  To: stevenj; +Cc: gcc

"Steven G. Johnson" <stevenj@gil-galad.mit.edu> writes:

| According to http://gcc.gnu.org/c9xstatus.html , support for the C99
| complex type is currently "broken."  What exactly does this mean?  Is it
| just that complex numbers in gcc (a longstanding extension) have some
| minor technical incompatibilities with the C99 specification?  Or is even
| the gcc version seriously buggy?
| 
| The reason I ask is because I want to use complex types in a program, and
| I am wondering if they are in a usable state in gcc 2.95.2.  At first
| glance, it seems that complex numbers basically work (trivial test
| programs work fine), but I am wondering what gotchas might be lurking.

There used to be addressing mode issue on 6biits machines.  But recent
patches form from seem to fix the problem.  You're welcome to test it
and feedback are appreciated.

-- Gaby
CodeSourcery, LLC                             http://www.codesourcery.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* How "broken" is C complex number support?
@ 2000-05-20 12:27 Steven G. Johnson
  2000-05-20 12:53 ` Gabriel Dos Reis
  2000-05-22  2:15 ` Martin v. Loewis
  0 siblings, 2 replies; 7+ messages in thread
From: Steven G. Johnson @ 2000-05-20 12:27 UTC (permalink / raw)
  To: gcc

According to http://gcc.gnu.org/c9xstatus.html , support for the C99
complex type is currently "broken."  What exactly does this mean?  Is it
just that complex numbers in gcc (a longstanding extension) have some
minor technical incompatibilities with the C99 specification?  Or is even
the gcc version seriously buggy?

The reason I ask is because I want to use complex types in a program, and
I am wondering if they are in a usable state in gcc 2.95.2.  At first
glance, it seems that complex numbers basically work (trivial test
programs work fine), but I am wondering what gotchas might be lurking.

Thanks!

Cordially,
Steven G. Johnson


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2000-05-23 10:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-05-23 10:16 How "broken" is C complex number support? Stephen L Moshier
  -- strict thread matches above, loose matches on Subject: below --
2000-05-20 12:27 Steven G. Johnson
2000-05-20 12:53 ` Gabriel Dos Reis
2000-05-20 13:19   ` Steven G. Johnson
2000-05-20 13:34     ` Gabriel Dos Reis
2000-05-22  2:15 ` Martin v. Loewis
2000-05-22 11:44   ` Joern Rennecke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).