home *** CD-ROM | disk | FTP | other *** search
Wrap
Path: sparky!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!cis.ohio-state.edu!ecs.ox.ac.UK!u90jl From: u90jl@ecs.ox.ac.UK Newsgroups: gnu.g++.bug Subject: Internal error: <built-in>:0: crosses initialization of `__FUNCTION__' Date: 25 Jan 1993 21:01:46 -0500 Organization: GNUs Not Usenet Lines: 829 Sender: daemon@cis.ohio-state.edu Approved: bug-g++@prep.ai.mit.edu Distribution: gnu Message-ID: <9301251321.AA00651@booth2.ecs.ox.ac.uk> I'm on a SparcStation SLC, SunOS4.1.1 running GCC 2.3.3. First, a trivial point. The option `-x c++-cpp-output' isn't documented in the info that comes with gcc-2.3.3. Perhaps it should be? Second, a compiler bug: $ gcc -v -x c++-cpp-output -Wall -c -o region.o region.pp Produces: gcc version 2.3.3 /mclab/u90jl/gnu/lib/gcc-lib/sparc-sun-sunos4.1.1/2.3.3/cc1plus region.pp -quiet -Wall -version -o /usr/tmp/cca00645.s GNU C++ version 2.3.3 (sparc) compiled by GNU C version 2.3.3. region.cpp: In function `static class Region::RegionNode* Region::ROP_subtract (class Region::RegionPair*, class Region::RegionPair*, class Region::RegionNode*, int &, int &)': region.cpp:1750: label `A_and_B' used but not defined <built-in>:0: crosses initialization of `__PRETTY_FUNCTION__' <built-in>:0: crosses initialization of `__FUNCTION__' region.cpp:1825: Internal compiler error. region.cpp:1825: Please report this to `bug-g++@prep.ai.mit.edu'. If I correct the reference to the label `A_and_B', by changing it to `A_not_B', the compiler does not crash. Preprocessed source follows (blank lines removed). -- Jamie Lokier ------------------------------------------------------------------------------- # 1 "region.cpp" #pragma implementation "Point.h" #pragma implementation "Rectangle.h" #pragma implementation "Region.h" #pragma implementation "RegionIterator.h" # 1 "config.h" 1 # 126 "config.h" # 199 "config.h" # 218 "config.h" # 29 "region.cpp" 2 # 1 "Point.h" 1 #pragma interface class Point { public: int x, y; inline Point() {} inline Point(const Point& A) : x(A.x), y(A.y) {} inline Point(int xnew, int ynew) : x(xnew), y(ynew) {} inline Point& operator = (const Point A) { x=A.x; y=A.y; return *this; } inline Point operator + (Point B) const { return Point(x+B.x, y+B.y); } inline Point operator - (Point B) const { return Point(x-B.x, y-B.y); } inline Point& operator += (Point B) { x+=B.x; y+=B.y; return *this; } inline Point& operator -= (Point B) { x-=B.x; y-=B.y; return *this; } inline int operator <= (Point B) const { return (x<=B.x) && (y<=B.y); } inline int operator < (Point B) const { return (x<B.x) && (y<B.y); } inline int operator == (Point B) const { return (x==B.x) && (y==B.y); } inline int operator != (Point B) const { return (x!=B.x) || (y!=B.y); } }; # 33 "region.cpp" 2 # 1 "Rectangle.h" 1 #pragma interface class Rectangle { public: Point topLeft, bottomRight; inline Rectangle() {} inline Rectangle(const Rectangle& A) : topLeft(A.topLeft), bottomRight(A.bottomRight) {} inline Rectangle(Point tl, Point br) : topLeft(tl), bottomRight(br) {}; inline Rectangle(int left, int top, int right, int bottom) : topLeft(left, top), bottomRight(right, bottom) {} inline Rectangle& operator = (const Rectangle& A) { topLeft=A.topLeft; bottomRight=A.bottomRight; return *this; } inline int contains(Point A) const { return topLeft <= A && A < bottomRight; } inline void translate(Point A) { topLeft+=A; bottomRight+=A; } }; # 37 "region.cpp" 2 # 1 "Region.h" 1 #pragma interface # 1 "/mclab/u90jl/gnu/lib/g++-include/stdlib.h" 1 3 # 1 "/mclab/u90jl/gnu/lib/g++-include/stddef.h" 1 3 extern "C" { # 1 "/mclab/u90jl/gnu/lib/gcc-lib/sparc-sun-sunos4.1.1/2.3.3/include/stddef.h" 1 3 # 43 "/mclab/u90jl/gnu/lib/gcc-lib/sparc-sun-sunos4.1.1/2.3.3/include/stddef.h" 3 typedef int ptrdiff_t; typedef int size_t; typedef __wchar_t wchar_t; # 179 "/mclab/u90jl/gnu/lib/gcc-lib/sparc-sun-sunos4.1.1/2.3.3/include/stddef.h" 3 # 7 "/mclab/u90jl/gnu/lib/g++-include/stddef.h" 2 3 } # 6 "/mclab/u90jl/gnu/lib/g++-include/stdlib.h" 2 3 extern "C" { int abs(int); void volatile abort(void); double atof(const char*); int atoi(const char*); long atol(const char*); int atexit(auto void (*p) (void)); int bsearch (const void *, const void *, size_t, size_t, auto int (*ptf)(const void*, const void*)); void* calloc(size_t, size_t); void cfree(void*); void volatile exit(int); char* fcvt(double, int, int*, int*); void free(void*); char* getenv(const char*); int getopt(int, char * const *, const char*); int getpw(int, char*); char* gcvt(double, int, char*); char* ecvt(double, int, int*, int*); extern char** environ; long labs(long); void* malloc(size_t); size_t malloc_usable_size(void*); int putenv(const char*); extern char* optarg; extern int opterr; extern int optind; void qsort(void*, size_t, size_t, auto int (*ptf)(void*,void*)); int rand(void); void* realloc(void*, size_t); int setkey(const char*); int srand(unsigned int); double strtod(const char*, char**); long strtol(const char*, char**, int); unsigned long stroul(const char**, int); int system(const char*); long random(void); void srandom(int); char* setstate(char*); char* initstate(unsigned, char*, int); double drand48(void); void lcong48(short*); long jrand48(short*); long lrand48(void); long mrand48(void); long nrand48(short*); short* seed48(short*); void srand48(long); char* ctermid(char*); char* cuserid(char*); char* tempnam(const char*, const char*); char* tmpnam(char*); } # 29 "Region.h" 2 class RegionIterator; class Region { class RegionPair; class RegionRow; class RegionNode; class Initialiser; class RegionPair { friend Region; friend RegionIterator; friend Region::Initialiser; enum { BlockSize = 20 }; static RegionPair *freeList; public: static void allocateBlock(RegionPair *); private: static void *operator new (size_t) { register Region::RegionPair *nodE=freeList; if (!(freeList=nodE->tail)) allocateBlock(nodE); return (nodE); } static void operator delete (void *node) { ((Region::RegionPair *)node)->tail=freeList; freeList=(Region::RegionPair *)node; } static RegionPair *peek() { return freeList; } RegionPair *tail; int left, right; }; class RegionRow { friend Region; friend RegionIterator; enum { BlockSize = 20 }; static RegionRow *freeList; static RegionRow *allocateBlock(); static void *operator new (size_t) { if (!freeList) return allocateBlock(); register Region::RegionRow *nodE=freeList; freeList=nodE->tail; return (nodE); } static void operator delete (void *node) { ((Region::RegionRow *)node)->tail=freeList; freeList=(Region::RegionRow *)node; } union { RegionPair *pair; RegionRow *tail; }; unsigned int ref; int right; }; class RegionNode { friend Region; friend RegionIterator; friend Region::Initialiser; enum { BlockSize = 20 }; static RegionNode *freeList; public: static void allocateBlock(RegionNode *); private: void *operator new (size_t) { register Region::RegionNode *nodE=freeList; if (!(freeList=nodE->tail)) allocateBlock(nodE); return (nodE); } void operator delete (void *node) { ((Region::RegionNode *)node)->tail=freeList; freeList=(Region::RegionNode *)node; } static RegionNode *peek() { return freeList; } RegionNode *tail; RegionRow *row; int y; }; class Initialiser { public: Initialiser() { Region::RegionPair::allocateBlock(0); Region::RegionNode::allocateBlock(0); } static Initialiser initialiser; }; friend RegionIterator; Rectangle rect; enum { EmptyRegion, SimpleRegion, ComplexRegion } type; class RegionNode *node; typedef RegionNode *(*__RegionOp)(RegionPair *, RegionPair *, RegionNode *, int&, int&); static RegionNode *ROP_merge(RegionPair *, RegionPair *, RegionNode *, int &, int &); static RegionNode *ROP_intersect(RegionPair *, RegionPair *, RegionNode *, int&, int&); static RegionNode *ROP_subtract(RegionPair *, RegionPair *, RegionNode *, int&, int&); static RegionNode *ROP_xor(RegionPair *, RegionPair *, RegionNode *, int&, int&); static RegionNode *make_complex_node(const Rectangle&); static void free_complex_node(RegionNode *node); static void simplify_result(Region&, RegionNode *); static RegionNode *region_op(char, char, char, __RegionOp, RegionNode *, int, RegionNode *, int, Rectangle&); static void copy(const Region&, Region&); static void free_nodes(Region&); public: Region(); Region(Point, Point); Region(const Rectangle&); Region(int, int, int, int); Region(const Region&); ~Region(); Region& operator = (const Rectangle&); Region& operator = (const Region&); static void merge(const Rectangle&, const Rectangle&, Region&); static void merge(const Region&, const Rectangle&, Region&); static void merge(const Region&, const Region&, Region&); static void intersect(const Rectangle&, const Rectangle&, Region&); static void intersect(const Region&, const Rectangle&, Region&); static void intersect(const Region&, const Region&, Region&); static void subtract(const Rectangle&, const Rectangle&, Region&); static void subtract(const Rectangle&, const Region&, Region&); static void subtract(const Region&, const Rectangle&, Region&); static void subtract(const Region&, const Region&, Region&); static void xor(const Rectangle&, const Rectangle&, Region&); static void xor(const Region&, const Rectangle&, Region&); static void xor(const Region&, const Region&, Region&); Region& operator |= (const Rectangle&); Region& operator |= (const Region&); Region& operator &= (const Rectangle&); Region& operator &= (const Region&); Region& operator -= (const Rectangle&); Region& operator -= (const Region&); Region& operator ^= (const Rectangle&); Region& operator ^= (const Region&); int isEmpty() const; int contains(Point) const; void clear(); void translate(Point); }; inline Region::Region() : type(EmptyRegion) { } inline Region::Region(Point tl, Point br) : type(SimpleRegion), rect(tl, br) { } inline Region::Region(const Rectangle& A) : type(SimpleRegion), rect(A) { } inline Region::Region(int left, int top, int right, int bottom) : type(SimpleRegion), rect(left, top, right, bottom) { } inline Region::Region(const Region& A) { copy(A, *this); } inline Region::~Region() { free_nodes(*this); } inline Region& Region::operator = (const Rectangle& A) { free_nodes(*this); rect=A; type=SimpleRegion; return *this; } inline Region& Region::operator = (const Region& A) { if (this != &A) { free_nodes(*this); copy(A, *this); } return *this; } inline Region operator | (const Rectangle& A, const Rectangle& B) return result { Region::merge(A, B, result); return; } inline Region operator | (const Rectangle& A, const Region& B) return result { Region::merge(B, A, result); return; } inline Region operator | (const Region& A, const Rectangle& B) return result { Region::merge(A, B, result); return; } inline Region operator | (const Region& A, const Region& B) return result { Region::merge(A, B, result); return; } inline Region operator & (const Rectangle& A, const Rectangle& B) return result { Region::intersect(A, B, result); return; } inline Region operator & (const Rectangle& A, const Region& B) return result { Region::intersect(B, A, result); return; } inline Region operator & (const Region& A, const Rectangle& B) return result { Region::intersect(A, B, result); return; } inline Region operator & (const Region& A, const Region& B) return result { Region::intersect(A, B, result); return; } inline Region operator - (const Rectangle& A, const Rectangle& B) return result { Region::subtract(A, B, result); return; } inline Region operator - (const Rectangle& A, const Region& B) return result { Region::subtract(A, B, result); return; } inline Region operator - (const Region& A, const Rectangle& B) return result { Region::subtract(A, B, result); return; } inline Region operator - (const Region& A, const Region& B) return result { Region::subtract(A, B, result); return; } inline Region operator ^ (const Rectangle& A, const Rectangle& B) return result { Region::xor(A, B, result); return; } inline Region operator ^ (const Rectangle& A, const Region& B) return result { Region::xor(B, A, result); return; } inline Region operator ^ (const Region& A, const Rectangle& B) return result { Region::xor(A, B, result); return; } inline Region operator ^ (const Region& A, const Region& B) return result { Region::xor(A, B, result); return; } # 552 "Region.h" inline Region& Region::operator |= (const Rectangle& B) { Region::merge(*this, B, *this); return *this; } inline Region& Region::operator |= (const Region& B) { Region::merge(*this, B, *this); return *this; } inline Region& Region::operator &= (const Rectangle& B) { Region::intersect(*this, B, *this); return *this; } inline Region& Region::operator &= (const Region& B) { Region::intersect(*this, B, *this); return *this; } inline Region& Region::operator -= (const Rectangle& B) { return *this; } inline Region& Region::operator -= (const Region& B) { return *this; } inline Region& Region::operator ^= (const Rectangle& B) { return *this; } inline Region& Region::operator ^= (const Region& B) { return *this; } inline void merge(const Rectangle& A, const Rectangle& B, Region& C) { Region::merge(A, B, C); } inline void merge(const Rectangle& A, const Region& B, Region& C) { Region::merge(B, A, C); } inline void merge(const Region& A, const Rectangle& B, Region& C) { Region::merge(A, B, C); } inline void merge(const Region& A, const Region& B, Region& C) { Region::merge(A, B, C); } inline void intersect(const Rectangle& A, const Rectangle& B, Region& C) { Region::intersect(A, B, C); } inline void intersect(const Rectangle& A, const Region& B, Region& C) { Region::intersect(B, A, C); } inline void intersect(const Region& A, const Rectangle& B, Region& C) { Region::intersect(A, B, C); } inline void intersect(const Region& A, const Region& B, Region& C) { Region::intersect(A, B, C); } inline void subtract(const Rectangle& A, const Rectangle& B, Region& C) { Region::subtract(A, B, C); } inline void subtract(const Rectangle& A, const Region& B, Region& C) { Region::subtract(A, B, C); } inline void subtract(const Region& A, const Rectangle& B, Region& C) { Region::subtract(A, B, C); } inline void subtract(const Region& A, const Region& B, Region& C) { Region::subtract(A, B, C); } inline void xor(const Rectangle& A, const Rectangle& B, Region& C) { Region::xor(A, B, C); } inline void xor(const Rectangle& A, const Region& B, Region& C) { Region::xor(B, A, C); } inline void xor(const Region& A, const Rectangle& B, Region& C) { Region::xor(A, B, C); } inline void xor(const Region& A, const Region& B, Region& C) { Region::xor(A, B, C); } inline int Region::isEmpty() const { return type == EmptyRegion; } inline void Region::clear() { free_nodes(*this); type=EmptyRegion; } inline void Region::translate(Point) { } # 41 "region.cpp" 2 # 1 "RegionIterator.h" 1 #pragma interface class RegionIterator { Region::RegionNode *node; Region::RegionPair *pair; public: RegionIterator() {} int first(const Region&); int next(); Point topLeft, bottomRight; }; # 109 "RegionIterator.h" inline int RegionIterator::next() { if (!pair) { if (!node) return 0; if (!node->row) { topLeft.y=node->y; node=node->tail; bottomRight.y=node->y; } else { topLeft.y=bottomRight.y; bottomRight.y=node->y; } pair=node->row->pair; node=node->tail; } topLeft.x=pair->left; bottomRight.x=pair->right; pair=pair->tail; return 1; } # 45 "region.cpp" 2 # 1 "misc.h" 1 #pragma interface typedef unsigned char Byte; typedef Byte *BytePointer; typedef BytePointer *BytePointerPointer; volatile void _botchFunction(const char *, const char *, unsigned int); volatile void _fatalFunction(const char *, const char *, unsigned int); volatile void _allocationError(); volatile void printError(const char *, ...); volatile void abortProgram(); # 49 "region.cpp" 2 # 1 "/mclab/u90jl/gnu/lib/g++-include/values.h" 1 3 # 57 "/mclab/u90jl/gnu/lib/g++-include/values.h" 3 # 166 "/mclab/u90jl/gnu/lib/g++-include/values.h" 3 # 56 "region.cpp" 2 # 1566 "region.cpp" Region::RegionNode * Region::ROP_subtract(RegionPair *PA, RegionPair *PB, RegionNode *nd, int& left, int& right) { register RegionPair *pa=PA; register RegionPair *pb=PB; register RegionPair *pd; register RegionPair *ppd; RegionPair *first_pd; if (pa->left >= pb->left) { first_pd=RegionPair::peek(); pd=0; if (nd && nd->row) { ppd=nd->row->pair; goto B_not_A_with_comparison; } goto B_not_A; } first_pd=pd=new RegionPair; pd->left=pa->left; if (nd && nd->row) { ppd=nd->row->pair; if (pd->left == ppd->left) goto A_not_B_with_comparison; } A_not_B: for (;;) { if (pa->right <= pb->left) { pd->right=pa->right; if (pa=pa->tail) { if (pa->left < pb->left) { pd=new RegionPair; pd->left=pa->left; continue; } goto B_not_A; } goto not_ending; } pd->right=pb->left; if (pa->right > pb->right) { pd=new RegionPair; pd->left=pb->right; if (pb=pb->tail) { continue; } pd->right=pa->right; pa=pa->tail; goto ending; } if (pa=pa->tail) { goto B_not_A; } goto not_ending; } B_not_A: for (;;) { if (pb->right <= pa->left) { if (pb=pb->tail) { if (pb->left <= pa->left) { continue; } pd=new RegionPair; pd->left=pa->left; goto A_not_B; } goto ending; } if (pb->right >= pa->right) { if (pa=pa->tail) { continue; } goto not_ending; } pd=new RegionPair; pd->left=pb->right; if (pb=pb->tail) { goto A_not_B; } pd->right=pa->right; pa=pa->tail; goto ending; } ending: while (pa) { pd=new RegionPair; pd->left=pa->left; pd->right=pa->right; pa=pa->tail; } not_ending: finally: if (pd) { pd->tail=0; ((nd=new RegionNode)->row=new RegionRow)->ref=0; nd->row->right=pd->right; if (pd->right > right) right=pd->right; nd->row->pair=pd=first_pd; if (pd->left < left) left=pd->left; return nd; } (nd=new RegionNode)->row=0; return nd; ending_with_comparison: while (pa) { pd=new RegionPair; if (!ppd || (pd->left=pa->left) != ppd->left || (pd->right=pa->right) != ppd->right) { pd->left=pa->left; pd->right=pa->right; pa=pa->tail; goto ending; } ppd=ppd->tail; pa=pa->tail; } not_ending_with_comparison: if (ppd) goto finally; RegionPair::freeList=first_pd; return nd; A_not_B_with_comparison: for (;;) { if (pa->right <= pb->left) { if ((pd->right=pa->right) != ppd->right) { if (pa=pa->tail) { if (pa->left < pb->left) { pd=new RegionPair; pd->left=pa->left; goto A_not_B; } goto B_not_A; } goto not_ending; } ppd=ppd->tail; if (pa=pa->tail) { if (pa->left < pb->left) { pd=new RegionPair; if (!ppd) { pd->left=pa->left; goto A_not_B; } if ((pd->left=pa->left) != ppd->left) goto A_not_B; continue; } goto B_not_A_with_comparison; } goto not_ending_with_comparison; } if ((pd->right=pb->left) != ppd->right) { if (pa->right > pb->right) { pd=new RegionPair; pd->left=pb->right; if (pb=pb->tail) { continue; } pd->right=pa->right; pa=pa->tail; goto ending; } if (pa=pa->tail) { goto B_not_A; } goto not_ending; } ppd=ppd->tail; if (pa->right > pb->right) { pd=new RegionPair; if (!ppd) { pd->left=pb->right; if (pb=pb->tail) { goto A_not_B; } pd->right=pa->right; pa=pa->tail; goto ending; } if ((pd->left=pb->right) != ppd->left) { if (pb=pb->tail) { goto A_and_B; } pd->right=pa->right; pa=pa->tail; goto ending; } if (pb=pb->tail) { continue; } if ((pd->right=pa->right) != ppd->right) { pa=pa->tail; goto ending; } ppd=ppd->tail; pa=pa->tail; goto ending_with_comparison; } if (pa=pa->tail) { goto B_not_A_with_comparison; } goto not_ending_with_comparison; } B_not_A_with_comparison: for (;;) { if (pb->right <= pa->left) { if (pb=pb->tail) { if (pb->left <= pa->left) { continue; } pd=new RegionPair; if (!ppd) { pd->left=pa->left; goto A_not_B; } if ((pd->left=pa->left) != ppd->left) goto A_not_B; goto A_not_B_with_comparison; } goto ending_with_comparison; } if (pb->right >= pa->right) { if (pa=pa->tail) { continue; } goto not_ending_with_comparison; } pd=new RegionPair; if (!ppd) { pd->left=pb->right; if (pb=pb->tail) { goto A_not_B; } pd->right=pa->right; pa=pa->tail; goto ending; } if ((pd->left=pb->right) != ppd->left) { if (pb=pb->tail) { goto A_not_B; } pd->right=pa->right; pa=pa->tail; goto ending; } if (pb=pb->tail) { goto A_not_B_with_comparison; } if ((pd->right=pa->right) != ppd->right) { pa=pa->tail; goto ending; } ppd=ppd->tail; pa=pa->tail; goto ending_with_comparison; } } # 3160 "region.cpp"