Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 77594

Summary: gcc compiler
Product: [Retired] Red Hat Linux Reporter: Dr. Scott T Kelley <skelley>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED CURRENTRELEASE QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-10-03 10:35:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
pre-processed source code requested none

Description Dr. Scott T Kelley 2002-11-10 01:59:20 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)

Description of problem:
The bug is very similar to a bug for Red Hat 7.2 gcc compiler 
bugzilla #67013. When I try to compile my C++ code it has an unrecoverable 
error. This compiler error is on a different line of the function.c file than 
the earlier bug report (and in the brand new version of Red Hat Linux 8.0).

The problem:
top.cc: In constructor `TreeTopology::TreeTopology(char*, char*)':
top.cc:151:Internal compiler error in find_function_data, at function.c: 329

Any help you can give me on this problem would be very much appreciated. I very 
much need to get my code compiled and working for a thesis project.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1.c++ -c -O3 -ffast-math -Wno-deprecated top.cc
2.
3.
	

Actual Results:  c++ -c -O3 -ffast-math -Wno-deprecated top.cc
top.cc: In constructor `TreeTopology::TreeTopology(char*, char*)':
top.cc:151: Internal compiler error in find_function_data, at function.c:329
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions.
make: *** [top.o] Error 1


Expected Results:  No error

Additional info:

/* file: top.cc*/
#ifndef TOP_H
#include "top.h"
#endif 

static ifstream File;
struct Tree_Struct {
      int No;
      double Time;
      int P; };     
static struct Tree_Struct Nodes[MAX_DEPTH][MAX_NODES];      
static int Node[MAX_DEPTH];
static int Parent[MAX_DEPTH];
static int I;
static char S[MAX_SYMBOLS];

static int CheckChar(char c)
    { if (c=='A' || c=='C' || c=='G'  || c=='T' || c=='-' || c=='U') return 1;
      else return 0; }
      
static void Read (int Depth)
     { char c;
       int j;       
       if (File.eof()) return;
       while (!File.eof())
             { File>>c;                     
               if (c=='(') { I=0;
                             Read(Depth+1); }                         
               else if (c==')') { S[I]='\0';
                                  j=0;
                                  if (S[0]!=':') { Nodes[Depth][Node
[Depth]].No=abs(atoi(S));
                                                   for (j=0;j<MAX_SYMBOLS;j++)
                                                       if (S[j]==':') break; }
                                  Nodes[Depth][Node[Depth]].Time=fabs((double) 
atoi(S+j+1));
                                  for (j=0;j<MAX_SYMBOLS;j++)
                                      if (S[j]=='.') break;
                                  Nodes[Depth][Node[Depth]].Time+=(double) atoi
(S+j+1)/100000;                           
                                  Nodes[Depth][Node[Depth]].P=Parent
[Depth];                                  
                                  Parent[Depth+1]++;
                                  Node[Depth]++;
                                  I=0;                                  
                                  break; }
                    else if (c==',') { S[I]='\0';
                                       j=0;
                                       if (S[0]!=':') { Nodes[Depth][Node
[Depth]].No=abs(atoi(S));
                                                        for 
(j=0;j<MAX_SYMBOLS;j++)
                                                            if (S[j]==':') 
break; }                                               
                                       Nodes[Depth][Node[Depth]].Time=fabs
((double) atoi(S+j+1));                                       
                                       for (j=0;j<MAX_SYMBOLS;j++)
                                           if (S[j]=='.') 
break;                                     
                                       Nodes[Depth][Node[Depth]].Time+=(double) 
atoi(S+j+1)/100000;                                                             
                                       Nodes[Depth][Node[Depth]].P=Parent
[Depth];
                                       Node[Depth]++;
                                       Parent[Depth+1]++; 
                                       I=0;}
                         else { S[I]=c; 
                                I++; }}            
       }



TreeTopology::TreeTopology (char *treefile, char *seqfile)
              { register int i,j;
                int flag,Temp;             
                double Freq[4];
                int CurrentNumber;
                ifstream fs;
                ofstream f;      
                int N[MAX_DEPTH];
                
                Gaps=85;
                Conservatism=95;
  
                for (i=0;i<MAX_DEPTH;i++)
                    { Node[i]=0;
                      Parent[i]=0;               
                      for (j=0;j<MAX_NODES;j++)
                          { Nodes[i][j].No=0;
                            Nodes[i][j].Time=0;
                            Nodes[i][j].P=-1; }}
                Nodes[0][0].P=0;            
                File.open(treefile,ios::in);
                if (File.fail()) 
                   { cerr << "Unable to open the tree file\n";
                     return ; }
                Read(0);           
                File.close();      

                MaxNodes=0;                       
                Depth=0;
                
                for (i=1;i<MAX_DEPTH;i++)
                    { Temp=0;
                      flag=0;
                      for (j=0;j<MAX_NODES;j++)
                      if (Nodes[i][j].P!=-1)
                         { Temp++;
                           flag=1; }                   
                      N[i]=Temp;           
                      if (flag) Depth++;}               
                  
                fs.open(seqfile,ios::in);
                if (fs.fail()) 
                   { cerr << "Unable to open the sequence file\n";
      return; }
      
                char c;
                c=fs.get();
                while(!CheckChar(c))
                     c=fs.get();
                     
                Length=0;
                while(CheckChar(c))
                     { Length++;
                       c=fs.get(); }   
                                             
                N[0]=1;            
                
                Tree=new struct Leaves
[Depth+1];                                                
                for (i=0;i<=Depth;i++)
                    { register int Nodes=N[i];
                      Tree[i].Nodes=Nodes;
                      if (MaxNodes<Nodes) MaxNodes=Nodes;
                      Tree[i].Times=new double[Nodes];
                      Tree[i].Parent=new int [Nodes];
                      Tree[i].Number=new int [Nodes];
                      Tree[i].Strands=new Strand[Nodes](Length); }
                      
                for (i=0;i<=Depth;i++)
                    for (j=0;j<Tree[i].Nodes;j++)
                        { Tree[i].Times[j]=Nodes[i][j].Time;
                          Tree[i].Parent[j]=Nodes[i][j].P;
                          Tree[i].Number[j]=Nodes[i][j].No; }      
                                 
                NumberOfSequences=0; 
                SiteIndex=new int [Length];      
                while(!fs.eof())
                     { if (c=='\n') NumberOfSequences++;
                       c=fs.get(); }       
                fs.close();  
                
                char S[NumberOfSequences][Length];     
                fs.open(seqfile,ios::in);                       
                c=fs.get();
                for (i=0;i<NumberOfSequences;i++)
                    { while(!CheckChar(c))
                           c=fs.get();
                      for (j=0;j<Length;j++)
                          { if (!CheckChar(c)) 
                               { cerr<<"Bad character in the sequences file !
\n";
                                 return; }
                      if (c=='U') {S[i][j]='T';}           
                      else {S[i][j]=c;}
                      c=fs.get(); }}                       
                fs.close();                     
                      
                for (i=0;i<Length;i++)
                    { CurrentNumber=NumberOfSequences;
                      for (j=0;j<4;j++)
                          Freq[j]=0;
                      for (j=0;j<NumberOfSequences;j++)
                          switch (S[j][i])
                          { case 'A' : Freq[0]++;
                                       break;
                            case 'C' : Freq[1]++;
                                       break;           
                            case 'G' : Freq[2]++;
                                       break;
                            case 'T' : Freq[3]++; 
                                       break;
                            default : CurrentNumber--
; }                                              
                      SiteIndex[i]=0;                     
                      if ((Freq[0]+Freq[1]+Freq[2]+Freq[3])/NumberOfSequences>
(double)Gaps/100) SiteIndex[i]=1;
                      for (j=0;j<4;j++)
                          if (Freq[j]/CurrentNumber>(double)Conservatism/100) 
SiteIndex [i]=0; }
                f.open("sequences.txt",ios::out); 
                for (i=0;i<=Depth;i++)
                    for (j=0;j<Tree[i].Nodes;j++)
                        { Temp=Nodes[i][j].No;            
                          if (Temp==0) f<<'X';
                          else for (int k=0;k<Length;k++)
                                   if (S[Temp-1][k]=='-') f<<'N';
                                   else f<<S[Temp-1][k]; 
                          
f<<'\n'; }                                                  
                 }
                 
TreeTopology::~TreeTopology()
              { register int i;
                delete SiteIndex;
                for (i=0;i<=Depth;i++)
                    { delete Tree[i].Times;
                      delete Tree[i].Parent;
                      delete Tree[i].Number;
                      delete [] Tree[i].Strands; }                
                delete [] Tree;   }

Comment 1 Jakub Jelinek 2002-11-10 21:03:11 UTC
Please attach preprocessed source (ie. top.ii, not top.cc (see g++ -save-temps).

Comment 2 Dr. Scott T Kelley 2002-11-11 17:07:28 UTC
Created attachment 84544 [details]
pre-processed source code requested

Comment 3 Richard Henderson 2004-10-03 10:35:38 UTC
No ICE with gcc-3.2.3-20.