public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/33220]  New: impossible constraint in ‘asm’
@ 2007-08-28 17:43 yakov at emc dot com
  2007-09-01 19:51 ` [Bug inline-asm/33220] " pinskia at gcc dot gnu dot org
  2007-09-02 15:45 ` yakov at emc dot com
  0 siblings, 2 replies; 3+ messages in thread
From: yakov at emc dot com @ 2007-08-28 17:43 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1682 bytes --]

cc -O2 -dr -msoft-float -c f_powf.c
f_powf.c: In function ‘_f_powf’:
f_powf.c:49: error: impossible constraint in ‘asm’

typedef unsigned int __uint32_t;
typedef signed int __int32_t;
typedef union
{
  double value;
  struct
  {
    __uint32_t lsw;
    __uint32_t msw;
  } parts;
} ieee_double_shape_type;
typedef union
{
  float value;
  __uint32_t word;
} ieee_float_shape_type;

extern float powf (float, float);

__inline__ static int
check_finite(double x)

{
  __int32_t hx;
  do { ieee_double_shape_type gh_u; gh_u.value = (x); (hx) = gh_u.parts.msw; }
while (0);
  return (int)((__uint32_t)((hx&0x7fffffff)-0x7ff00000)>>31);
}

__inline__
static
int
check_finitef(float x)

{
  __int32_t ix;
  do { ieee_float_shape_type gf_u; gf_u.value = (x); (ix) = gf_u.word; } while
(0);
  return (int)((__uint32_t)((ix&0x7fffffff)-0x7f800000)>>31);
}

float _f_powf (float x, float y)
{

  if (x > 0.0 && check_finitef(y))
    {
      float result;

      asm ("flds 8(%%ebp); fyl2x; fld %%st; frndint; fsub %%st,%%st(1);" "fxch;
fchs; f2xm1; fld1; faddp; fxch; fld1; fscale; fstp %%st(1);" "fmulp" : "=t"
(result) : "0" (y));

      return result;
    }
  else
    return powf (x,y);
}


-- 
           Summary: impossible constraint in ‘asm’
           Product: gcc
           Version: 4.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: yakov at emc dot com
 GCC build triplet: gcc (GCC) 4.1.2 20061115 (prerelease) (SUSE Linux)
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: x86


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33220


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

* [Bug inline-asm/33220] impossible constraint in ‘asm’
  2007-08-28 17:43 [Bug c/33220] New: impossible constraint in ‘asm’ yakov at emc dot com
@ 2007-09-01 19:51 ` pinskia at gcc dot gnu dot org
  2007-09-02 15:45 ` yakov at emc dot com
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-09-01 19:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2007-09-01 19:51 -------
-msoft-float disables the floating register stack so this is not a bug.  The
error message is correct the constraint is impossible.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33220


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

* [Bug inline-asm/33220] impossible constraint in ‘asm’
  2007-08-28 17:43 [Bug c/33220] New: impossible constraint in ‘asm’ yakov at emc dot com
  2007-09-01 19:51 ` [Bug inline-asm/33220] " pinskia at gcc dot gnu dot org
@ 2007-09-02 15:45 ` yakov at emc dot com
  1 sibling, 0 replies; 3+ messages in thread
From: yakov at emc dot com @ 2007-09-02 15:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from yakov at emc dot com  2007-09-02 15:44 -------
Subject: Re:  impossible constraint in asm

pinskia at gcc dot gnu dot org wrote:
> ------- Comment #1 from pinskia at gcc dot gnu dot org  2007-09-01 19:51 -------
> -msoft-float disables the floating register stack so this is not a bug.  The
> error message is correct the constraint is impossible
Does it mean that gcc-3x family has a bug:

gcc -v -msoft-float f_powf.c
Reading specs from /usr/lib/gcc-lib/i486-suse-linux/3.3/specs
Configured with: ../configure --enable-threads=posix --prefix=/usr
--with-local-prefix=/usr/local --infodir=/usr/share/info
--mandir=/usr/share/man --libdir=/usr/lib
--enable-languages=c,c++,f77,objc,java,ada --disable-checking
--enable-libgcj --with-gxx-include-dir=/usr/include/g++
--with-slibdir=/lib --with-system-zlib --enable-shared
--enable-__cxa_atexit i486-suse-linux
Thread model: posix
gcc version 3.3 20030226 (prerelease) (SuSE Linux)
 /usr/lib/gcc-lib/i486-suse-linux/3.3/cc1 -quiet -v -D__GNUC__=3
-D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=0 f_powf.c -quiet -dumpbase
f_powf.c -msoft-float -auxbase f_powf -version -o /tmp/ccOIZkYJ.s
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C version 3.3 20030226 (prerelease) (SuSE Linux) (i486-suse-linux)
        compiled by GNU C version 3.3 20030226 (prerelease) (SuSE Linux).
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/lib/gcc-lib/i486-suse-linux/3.3/include
 /usr/i486-suse-linux/include
 /usr/include
End of search list.
 /usr/lib/gcc-lib/i486-suse-linux/3.3/../../../../i486-suse-linux/bin/as
-V -Qy -o /tmp/ccgzdkTv.o /tmp/ccOIZkYJ.s
GNU assembler version 2.13.90.0.18 (i486-suse-linux) using BFD version
2.13.90.0.18 20030121 (SuSE Linux)
 /usr/lib/gcc-lib/i486-suse-linux/3.3/collect2 --eh-frame-hdr -m
elf_i386 -dynamic-linker /lib/ld-linux.so.2
/usr/lib/gcc-lib/i486-suse-linux/3.3/../../../crt1.o
/usr/lib/gcc-lib/i486-suse-linux/3.3/../../../crti.o
/usr/lib/gcc-lib/i486-suse-linux/3.3/crtbegin.o
-L/usr/lib/gcc-lib/i486-suse-linux/3.3
-L/usr/lib/gcc-lib/i486-suse-linux/3.3/../../../../i486-suse-linux/lib
-L/usr/lib/gcc-lib/i486-suse-linux/3.3/../../.. /tmp/ccgzdkTv.o -lgcc
-lgcc_eh -lc -lgcc -lgcc_eh
/usr/lib/gcc-lib/i486-suse-linux/3.3/crtend.o
/usr/lib/gcc-lib/i486-suse-linux/3.3/../../../crtn.o
/usr/lib/gcc-lib/i486-suse-linux/3.3/../../../crt1.o(.text+0x18): In
function `_start':
: undefined reference to `main'
/tmp/ccgzdkTv.o(.text+0xf): In function `_f_powf':
: undefined reference to `__gtsf2'
/tmp/ccgzdkTv.o(.text+0x6b): In function `_f_powf':
: undefined reference to `powf'
collect2: ld returned 1 exit status
usenmyakushnx1l[/emc/yakov]: gcc -v -msoft-float -c f_powf.c
Reading specs from /usr/lib/gcc-lib/i486-suse-linux/3.3/specs
Configured with: ../configure --enable-threads=posix --prefix=/usr
--with-local-prefix=/usr/local --infodir=/usr/share/info
--mandir=/usr/share/man --libdir=/usr/lib
--enable-languages=c,c++,f77,objc,java,ada --disable-checking
--enable-libgcj --with-gxx-include-dir=/usr/include/g++
--with-slibdir=/lib --with-system-zlib --enable-shared
--enable-__cxa_atexit i486-suse-linux
Thread model: posix
gcc version 3.3 20030226 (prerelease) (SuSE Linux)
 /usr/lib/gcc-lib/i486-suse-linux/3.3/cc1 -quiet -v -D__GNUC__=3
-D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=0 f_powf.c -quiet -dumpbase
f_powf.c -msoft-float -auxbase f_powf -version -o /tmp/ccGvb4Lt.s
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C version 3.3 20030226 (prerelease) (SuSE Linux) (i486-suse-linux)
        compiled by GNU C version 3.3 20030226 (prerelease) (SuSE Linux).
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/lib/gcc-lib/i486-suse-linux/3.3/include
 /usr/i486-suse-linux/include
 /usr/include
End of search list.
 /usr/lib/gcc-lib/i486-suse-linux/3.3/../../../../i486-suse-linux/bin/as
-V -Qy -o f_powf.o /tmp/ccGvb4Lt.s
GNU assembler version 2.13.90.0.18 (i486-suse-linux) using BFD version
2.13.90.0.18 20030121 (SuSE Linux)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33220


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

end of thread, other threads:[~2007-09-02 15:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-28 17:43 [Bug c/33220] New: impossible constraint in ‘asm’ yakov at emc dot com
2007-09-01 19:51 ` [Bug inline-asm/33220] " pinskia at gcc dot gnu dot org
2007-09-02 15:45 ` yakov at emc dot com

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