public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* gcc 3.4.4 assembly problem
@ 2005-05-20 22:22 Joerg Sonnenberger
  2005-05-20 23:00 ` cmath isnan function Wesley Smith
  0 siblings, 1 reply; 5+ messages in thread
From: Joerg Sonnenberger @ 2005-05-20 22:22 UTC (permalink / raw)
  To: gcc-help

[-- Attachment #1: Type: text/plain, Size: 496 bytes --]

Hi all,
I'm running into a problem with GCC 3.4.4 when building mplayer.
Test case and assembly is attached. Can others confirm this behaviour?
Any other workaround than inlining the second constraint?

The difference with GCC 3.4.3 is that it doesn't put the memory operator
into a register, which is perfectly fine.

Joerg

Using built-in specs.
Configured with: ./configure --prefix=/usr --host=i386-just-dragonflybsd
Thread model: posix
gcc version 3.4.4 [DragonFly] (propolice, visibility)


[-- Attachment #2: tabinit_MMX.c --]
[-- Type: text/plain, Size: 167 bytes --]

extern float mp3lib_decwin[];

void make_decode_tables_MMX(long scaleval)
{
    __asm __volatile(
	"fsts  %0(,%%ecx,4)\n\t"
	::"m"(mp3lib_decwin[0]),"m"(scaleval));
}

[-- Attachment #3: tabinit_MMX.s --]
[-- Type: text/plain, Size: 333 bytes --]

	.file	"tabinit_MMX.c"
	.text
	.p2align 2,,3
.globl make_decode_tables_MMX
	.type	make_decode_tables_MMX, @function
make_decode_tables_MMX:
	movl	4(%esp), %edx
	movl	%edx, 4(%esp)
	movl	$mp3lib_decwin, %eax
#APP
	fsts  (%eax)(,%ecx,4)
	
#NO_APP
	ret
	.size	make_decode_tables_MMX, .-make_decode_tables_MMX
	.ident	"GCC: (GNU) 3.4.4"

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

* cmath isnan function
  2005-05-20 22:22 gcc 3.4.4 assembly problem Joerg Sonnenberger
@ 2005-05-20 23:00 ` Wesley Smith
  2005-05-22 13:17   ` Brian Budge
  0 siblings, 1 reply; 5+ messages in thread
From: Wesley Smith @ 2005-05-20 23:00 UTC (permalink / raw)
  To: gcc-help

Hi,

I'm trying to compile a test program to see about the isnan function
on my system (apple darwin w/ gcc version 3.3 20030304 (Apple
Computer, Inc. build 1671).  Here's the code:

#include <cmath>
int main()
{
 float x=sqrt(-1);
 return isnan(x);
}

Here's the output:

gcc -o main main.cpp
main.cpp: In function `int main()':
main.cpp:5: error: `isnan' undeclared (first use this function)
main.cpp:5: error: (Each undeclared identifier is reported only once for each 
   function it appears in.)

This is baffling since cmath is included and it redifines the macros
which it includes from math.h.  I completely stumped here and would
appreciate any help.

thanks,
wes

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

* Re: cmath isnan function
  2005-05-20 23:00 ` cmath isnan function Wesley Smith
@ 2005-05-22 13:17   ` Brian Budge
  2005-05-22 15:22     ` Wesley Smith
  0 siblings, 1 reply; 5+ messages in thread
From: Brian Budge @ 2005-05-22 13:17 UTC (permalink / raw)
  To: Wesley Smith; +Cc: gcc-help

You need to be using the namespace std.

On 5/21/05, Wesley Smith <wesley.hoke@gmail.com> wrote:
> Hi,
> 
> I'm trying to compile a test program to see about the isnan function
> on my system (apple darwin w/ gcc version 3.3 20030304 (Apple
> Computer, Inc. build 1671).  Here's the code:
> 
> #include <cmath>
> int main()
> {
>  float x=sqrt(-1);
>  return isnan(x);
> }
> 
> Here's the output:
> 
> gcc -o main main.cpp
> main.cpp: In function `int main()':
> main.cpp:5: error: `isnan' undeclared (first use this function)
> main.cpp:5: error: (Each undeclared identifier is reported only once for each
>   function it appears in.)
> 
> This is baffling since cmath is included and it redifines the macros
> which it includes from math.h.  I completely stumped here and would
> appreciate any help.
> 
> thanks,
> wes
>

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

* Re: cmath isnan function
  2005-05-22 13:17   ` Brian Budge
@ 2005-05-22 15:22     ` Wesley Smith
  2005-05-22 15:36       ` Wesley Smith
  0 siblings, 1 reply; 5+ messages in thread
From: Wesley Smith @ 2005-05-22 15:22 UTC (permalink / raw)
  To: gcc-help

I tried:

using namespace std;

before everything and it still failed to find isnan.

wes

On 5/22/05, Brian Budge <brian.budge@gmail.com> wrote:
> You need to be using the namespace std.
> 
> On 5/21/05, Wesley Smith <wesley.hoke@gmail.com> wrote:
> > Hi,
> >
> > I'm trying to compile a test program to see about the isnan function
> > on my system (apple darwin w/ gcc version 3.3 20030304 (Apple
> > Computer, Inc. build 1671).  Here's the code:
> >
> > #include <cmath>
> > int main()
> > {
> >  float x=sqrt(-1);
> >  return isnan(x);
> > }
> >
> > Here's the output:
> >
> > gcc -o main main.cpp
> > main.cpp: In function `int main()':
> > main.cpp:5: error: `isnan' undeclared (first use this function)
> > main.cpp:5: error: (Each undeclared identifier is reported only once for each
> >   function it appears in.)
> >
> > This is baffling since cmath is included and it redifines the macros
> > which it includes from math.h.  I completely stumped here and would
> > appreciate any help.
> >
> > thanks,
> > wes
> >
>

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

* Re: cmath isnan function
  2005-05-22 15:22     ` Wesley Smith
@ 2005-05-22 15:36       ` Wesley Smith
  0 siblings, 0 replies; 5+ messages in thread
From: Wesley Smith @ 2005-05-22 15:36 UTC (permalink / raw)
  To: gcc-help

Ok,

So the following works:

using namespace std;
 #include <math.h>
int main()
{
  float x=sqrt(-1);
  return isnan(x);
}

but when I include cmath, it doesn't.  It seems that cmath is
overidding the math.h isnan macro and not redifining it.  Has anyone
else had this problem?  Is there a way to fix this?

thanks,
wes

On 5/22/05, Wesley Smith <wesley.hoke@gmail.com> wrote:
> I tried:
> 
> using namespace std;
> 
> before everything and it still failed to find isnan.
> 
> wes
> 
> On 5/22/05, Brian Budge <brian.budge@gmail.com> wrote:
> > You need to be using the namespace std.
> >
> > On 5/21/05, Wesley Smith <wesley.hoke@gmail.com> wrote:
> > > Hi,
> > >
> > > I'm trying to compile a test program to see about the isnan function
> > > on my system (apple darwin w/ gcc version 3.3 20030304 (Apple
> > > Computer, Inc. build 1671).  Here's the code:
> > >
> > > #include <cmath>
> > > int main()
> > > {
> > >  float x=sqrt(-1);
> > >  return isnan(x);
> > > }
> > >
> > > Here's the output:
> > >
> > > gcc -o main main.cpp
> > > main.cpp: In function `int main()':
> > > main.cpp:5: error: `isnan' undeclared (first use this function)
> > > main.cpp:5: error: (Each undeclared identifier is reported only once for each
> > >   function it appears in.)
> > >
> > > This is baffling since cmath is included and it redifines the macros
> > > which it includes from math.h.  I completely stumped here and would
> > > appreciate any help.
> > >
> > > thanks,
> > > wes
> > >
> >
>

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

end of thread, other threads:[~2005-05-22 15:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-20 22:22 gcc 3.4.4 assembly problem Joerg Sonnenberger
2005-05-20 23:00 ` cmath isnan function Wesley Smith
2005-05-22 13:17   ` Brian Budge
2005-05-22 15:22     ` Wesley Smith
2005-05-22 15:36       ` Wesley Smith

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).