This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/11936] New: Problems with allocator::rebind::other


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: Problems with allocator::rebind::other
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: poschmid at lbl dot gov
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu

The code t.c, extracted from root, causes an ice when the optimization, -O, is
enabled. Without optimization the example compiles without a problem. This
is a regression with respect to previous versions of gcc. The inline
implementation of the fmod function is taken from the file math.h distributed
with glibc 2.3.2. I do not know whether this asm code is correct.

Environment:
System: Linux linux 2.4.20-4GB #1 Fri Jul 11 07:33:18 UTC 2003 i686 unknown unknown GNU/Linux
Architecture: i686
SuSE 8.2
glibc 2.3.2
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../gcc/configure --enable-threads=posix --enable-languages=c,c++,f77,objc --enable-__cxa_atexit --enable-debug

How-To-Repeat:
source code t.c
extern double fmod (double __x, double __y) ; extern double __fmod (double __x, double __y) ;

extern __inline double fmod (double __x, double __y) { register long double __value; __asm __volatile__ ("1:	fprem\n\t" "fnstsw	%%ax\n\t" "sahf\n\t" "jp	1b" : "=t" (__value) : "0" (__x), "u" (__y) : "ax", "cc"); return __value; } extern __inline float fmodf (float __x, float __y) { register long double __value; __asm __volatile__ ("1:	fprem\n\t" "fnstsw	%%ax\n\t" "sahf\n\t" "jp	1b" : "=t" (__value) : "0" (__x), "u" (__y) : "ax", "cc"); return __value; } extern __inline long double fmodl (long double __x, long double __y) { register long double __value; __asm __volatile__ ("1:	fprem\n\t" "fnstsw	%%ax\n\t" "sahf\n\t" "jp	1b" : "=t" (__value) : "0" (__x), "u" (__y) : "ax", "cc"); return __value; }

extern void G__letdouble ();
extern double G__double();

struct G__p2p {
  long i;
  int reftype;
};

typedef struct {
  union {
    double d;
    long i;
    struct G__p2p reftype;

    char ch;
    short sh;
    int in;
    float fl;
    unsigned char uch;
    unsigned short ush;
    unsigned int uin;
    unsigned long ulo;
  } obj;
} G__value ;

struct G__param {
  int paran;
  G__value para[40];
};

int G__compiled_func(result7,libp)
G__value *result7;
struct G__param *libp;
{
    G__letdouble(result7,'d',(double)fmod(G__double(libp->para[0]),G__double(libp->para[1])));
  return(0);
}

Compiling t.c
gcc -v -O -c -W -Wall -I../../include t.c -save-temps
Reading specs from /usr/local/lib/gcc/i686-pc-linux-gnu/3.4/specs
Configured with: ../gcc/configure --enable-threads=posix --enable-languages=c,c++,f77,objc --enable-__cxa_atexit --enable-debug
Thread model: posix
gcc version 3.4 20030806 (experimental)
 /usr/local/libexec/gcc/i686-pc-linux-gnu/3.4/cc1 -E -quiet -v -I../../include t.c -mtune=pentiumpro -W -Wall -O -o t.i
ignoring nonexistent directory "NONE/include"
ignoring nonexistent directory "/usr/local/lib/gcc/i686-pc-linux-gnu/3.4/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 ../../include
 /usr/local/include
 /usr/local/lib/gcc/i686-pc-linux-gnu/3.4/include
 /usr/include
End of search list.
 /usr/local/libexec/gcc/i686-pc-linux-gnu/3.4/cc1 -fpreprocessed t.i -quiet -dumpbase t.c -mtune=pentiumpro -auxbase t -O -W -Wall -version -o t.s
GNU C version 3.4 20030806 (experimental) (i686-pc-linux-gnu)
	compiled by GNU C version 3.4 20030806 (experimental).
GGC heuristics: --param ggc-min-expand=47 --param ggc-min-heapsize=31899
t.c: In function `G__compiled_func':

t.c:3: error: can't find a register in class `FP_TOP_REG' while reloading `asm'

Preprocessed source code t.i

# 1 "t.c"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "t.c"
extern double fmod (double __x, double __y) ; extern double __fmod (double __x, double __y) ;

extern __inline double fmod (double __x, double __y) { register long double __value; __asm __volatile__ ("1:	fprem\n\t" "fnstsw	%%ax\n\t" "sahf\n\t" "jp	1b" : "=t" (__value) : "0" (__x), "u" (__y) : "ax", "cc"); return __value; } extern __inline float fmodf (float __x, float __y) { register long double __value; __asm __volatile__ ("1:	fprem\n\t" "fnstsw	%%ax\n\t" "sahf\n\t" "jp	1b" : "=t" (__value) : "0" (__x), "u" (__y) : "ax", "cc"); return __value; } extern __inline long double fmodl (long double __x, long double __y) { register long double __value; __asm __volatile__ ("1:	fprem\n\t" "fnstsw	%%ax\n\t" "sahf\n\t" "jp	1b" : "=t" (__value) : "0" (__x), "u" (__y) : "ax", "cc"); return __value; }

extern void G__letdouble ();
extern double G__double();

struct G__p2p {
  long i;
  int reftype;
};

typedef struct {
  union {
    double d;
    long i;
    struct G__p2p reftype;

    char ch;
    short sh;
    int in;
    float fl;
    unsigned char uch;
    unsigned short ush;
    unsigned int uin;
    unsigned long ulo;
  } obj;
} G__value ;

struct G__param {
  int paran;
  G__value para[40];
};

int G__compiled_func(result7,libp)
G__value *result7;
struct G__param *libp;
{
    G__letdouble(result7,'d',(double)fmod(G__double(libp->para[0]),G__double(libp->para[1])));
  return(0);
}

Compiling without optimization works:
gcc -v -c -W -Wall -I../../include t.c -save-temps
Reading specs from /usr/local/lib/gcc/i686-pc-linux-gnu/3.4/specs
Configured with: ../gcc/configure --enable-threads=posix --enable-languages=c,c++,f77,objc --enable-__cxa_atexit --enable-debug
Thread model: posix
gcc version 3.4 20030806 (experimental)
 /usr/local/libexec/gcc/i686-pc-linux-gnu/3.4/cc1 -E -quiet -v -I../../include t.c -mtune=pentiumpro -W -Wall -o t.i
ignoring nonexistent directory "NONE/include"
ignoring nonexistent directory "/usr/local/lib/gcc/i686-pc-linux-gnu/3.4/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 ../../include
 /usr/local/include
 /usr/local/lib/gcc/i686-pc-linux-gnu/3.4/include
 /usr/include
End of search list.
 /usr/local/libexec/gcc/i686-pc-linux-gnu/3.4/cc1 -fpreprocessed t.i -quiet -dumpbase t.c -mtune=pentiumpro -auxbase t -W -Wall -version -o t.s
GNU C version 3.4 20030806 (experimental) (i686-pc-linux-gnu)
	compiled by GNU C version 3.4 20030806 (experimental).
GGC heuristics: --param ggc-min-expand=47 --param ggc-min-heapsize=31899
 as -V -Qy -o t.o t.s
GNU assembler version 2.13.90.0.18 (i486-suse-linux) using BFD version 2.13.90.0.18 20030121 (SuSE Linux)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]