Bug 188554

Summary: GCC 4.1.0: internal compiler error: in cp_expr_size
Product: [Fedora] Fedora Reporter: John Pye <john>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED UPSTREAM QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: 5   
Target Milestone: ---   
Target Release: ---   
Hardware: i586   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-04-11 09:10:42 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Preprocessed source stored into /tmp/ccbk5Q40.out file, please attach this to your bugreport. none

Description John Pye 2006-04-11 03:47:56 UTC
Description of problem:
Internal compiler error with GCC 4.1.0

Version-Release number of selected component (if applicable):
gcc (GCC) 4.1.0 20060304 (Red Hat 4.1.0-3)

How reproducible:
Repeated multiple times on single machine. Complete rebuild and still the same
problem.

Steps to Reproduce:
1. (ran 'scons' to build sources)
2. saw a line, g++ -o flowregimecalculator.o -c -g -DTEST flowregimecalculator.cpp
3. (dual processor, so another compile started)
4. then the error message:

++ -o pipeexteriorsimple.o -c -g -DTEST pipeexteriorsimple.cpp
g++ -o absorberpye2.o -c -g -DTEST absorberpye2.cpp
g++ -o flowregimecalculator.o -c -g -DTEST flowregimecalculator.cpp
g++ -o pump.o -c -g -DTEST pump.cpp
flowregimecalculator.cpp: In member function âPipeFlowRegime
FlowRegimeCalculator::calculateFlowRegime()â:
flowregimecalculator.cpp:101: internal compiler error: in cp_expr_size, at
cp/cp-objcp-common.c:101
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugzilla.redhat.com/bugzilla> for instructions.
g++ -o joiner.o -c -g -DTEST joiner.cpp
Preprocessed source stored into /tmp/ccbk5Q40.out file, please attach this to
your bugreport.
scons: *** [flowregimecalculator.o] Error 1
scons: building terminated because of errors.
[john@cruncher2 dsg-transient]$

Some small changes to variable names are all that I can recall making here.

All changes since working (compiled ok) are here:

[john@cruncher2 dsg-transient]$ cvs diff flowregimecalculator.cpp > flowregdiff.txt
[john@cruncher2 dsg-transient]$ cat flowregdiff.txt
Index: flowregimecalculator.cpp
===================================================================
RCS file: /var/cvs/dsg-transient/flowregimecalculator.cpp,v
retrieving revision 1.3
diff -r1.3 flowregimecalculator.cpp
32,34d31
<       // Froude number?
<     Num Fr = sqrt(rho_g / (rho_l - rho_g)) * U_gs / Velocity::sqrt(D * GRAV);
<
39a37,47
>       // 'Mixture velocity' and related
>       /*
>               TODO FIXME the references to 'x' are a problem!!
>       */
>     Velocity U_m = U_gs + U_ls;
>     DynamicViscosity  mu_x = mu_l + x * (mu_g - mu_l);
>     Density  rho_x = rho_l + x * (rho_g - rho_l);
>     Num Re_x = D * U_m * rho_x / mu_x;
>       Num f_m;
>
>       // Friction factor
42a51
>               // (see also Taitel1980 eq 11)
47c56
<
---
>               f_m = C * pow(Re_x, n);
51a61
>               f_m = 16 / Re_x;
53,59c63,65
<
<       // Friction factor based on mixture velocity
<     Velocity U_m = U_gs + U_ls;
<     DynamicViscosity  mu_x = mu_l + x * (mu_g - mu_l);
<     Density  rho_x = rho_l + x * (rho_g - rho_l);
<     Num Re_x = D * U_m * rho_x / mu_x;
<     Num f_m = C_l * pow(Re_x,-n);
---
>
>       //---------------------------
>       // DISPERSED BUBBLE BOUNDARY
70c76
<     Length dc = (0.725 + 4.15 * sqrt(Eb)) * pow(factor_1, 0.6) * pow(factor_2,
-0.4) * metre;
---
>     Length d_bound = (0.725 + 4.15 * sqrt(Eb)) * pow(factor_1, 0.6) *
pow(factor_2, -0.4) * metre;
73c79
<     Length dcb = 0.375 * (rho_l / (rho_l - rho_g)) * f_m * sq(U_m) / GRAV;
---
>     Length d_CB = 0.375 * (rho_l / (rho_l - rho_g)) * f_m * sq(U_m) / GRAV;
76c82
<     Length dcd = 2. * Length::sqrt(0.4 * sigma / (GRAV * (rho_l - rho_g)));
---
>     Length d_CD = 2. * Length::sqrt(0.4 * sigma / (GRAV * (rho_l - rho_g)));
78c84
<       // Calculate void fraction, alpha
---
>       // Calculate void fraction, alpha (Barnea1987 eq 8)
91a98
>       cerr << "void fraction = " << alpha << endl;
93,106c100,107
<       //cerr << "void fraction = " << alpha << endl;
<
<       // Check for Dispersed Bubble flow
<
<       /*
<       // the following doesn't seem to be allowed for by Saad: FIXME TODO
<       if(dcb<dcd){
<               throw runtime_error("Check Barnea1987: here, dcb < dcd!");
<       }
<       */
<
<     if ((alpha < 0.52) && (dc < dcd) && (dc < dcb)){
<       //cerr << "dispersed bubble..." << endl;
<       patternid = REGIME_DISPERSEDBUBBLE;
---
>       // Bubble diameter (Barnea1987 p. 3)
>       Length d_C = MIN(d_CB,d_CD);
>       cerr << "bubble diameter d_C = " << d_C << endl;
>       cerr << "critical bubble diameter = " << d_bound << endl;
>
>       // Test for dispersed bubble flow (Barnea1987 p. 3)
>     if ((alpha < 0.52) && (d_C >= d_bound)){
>       return REGIME_DISPERSEDBUBBLE;
110a112,114
>       //------------------------
>       // STRATIFIED/NONSTRATIFIED BOUNDARY
>
121a126
>       cerr << "strat liq level h_L/D = " << hlond << endl;
123,124c128,129
<       //cerr << "strat liq level = " << hlond << endl;
<
---
>       // Modified Froude number (Barnea1987 eq 10)
>     Num Fr = sqrt(rho_g / (rho_l - rho_g)) * U_gs / Velocity::sqrt(D * GRAV);
128,139c133,143
<     if ((patternid != REGIME_DISPERSEDBUBBLE) /*&& (patternid != PAT_BUBBLY)*/) {
<       Num Ulb = U_l / U_ls;
<       Num Ugb = U_g / U_gs;
<       Num Agb = A_g / sq(D);
<       Num C2 = 1 - hlond;
<       Num temp = 1 - ((2 * hlond - 1) * (2 * hlond - 1));
<       Num dAb = sqrt (temp);
<       Num Swav = sq(Fr) / sq(C2) * sq(Ugb) * dAb / Agb;
<
<       if (Swav < 1){
<               //cerr << "stratified wavy..." << endl;
<               patternid = REGIME_STRATIFIEDWAVY;
---
>       Num Ulb = U_l / U_ls;
>       Num Ugb = U_g / U_gs;
>       Num Agb = A_g / sq(D);
>       Num C2 = 1 - hlond;
>       Num temp = 1 - ((2 * hlond - 1) * (2 * hlond - 1));
>       Num dAb = sqrt (temp);
>       Num Swav = sq(Fr) / sq(C2) * sq(Ugb) * dAb / Agb;
>
>       if (Swav < 1){
>               //cerr << "stratified wavy..." << endl;
>               patternid = REGIME_STRATIFIEDWAVY;
144,154c148,157
<                       double s = 0.01;
<               double st = 2 / (Ugb * sqrt(Ulb) * sqrt(s));
<               //temp = GRAV * D;
<               temp = D * U_ls * rho_l / mu_l;
<               double ks = Fr * sqrt(temp);
<               if (ks < st){
<                       patternid = REGIME_STRATIFIEDSMOOTH;
<                       //cerr << "stratified smooth..." << endl;
<               }
<               }
<     }
---
>               double s = 0.01;
>               double st = 2 / (Ugb * sqrt(Ulb) * sqrt(s));
>               //temp = GRAV * D;
>               temp = D * U_ls * rho_l / mu_l;
>               double ks = Fr * sqrt(temp);
>               if (ks < st){
>                       patternid = REGIME_STRATIFIEDSMOOTH;
>               //cerr << "stratified smooth..." << endl;
>       }
>       }
172,173d174
<       dc = MIN(dcb, dcd);
<
177d177
<
184c184
<                               dc
---
>                               d_C
256c256,257
<       Root-finding function to locate the value of void fraction
---
>       Root-finding function to locate the value of void fraction according
>       to Barnea1987, eq 8.
[john@cruncher2 dsg-transient]$

Comment 1 John Pye 2006-04-11 03:47:57 UTC
Created attachment 127589 [details]
Preprocessed source stored into /tmp/ccbk5Q40.out file, please attach this to your bugreport.

Comment 2 John Pye 2006-04-11 03:58:23 UTC
Looks as though it may have been related to my use of 

Length var = MIN(var1, var2)

and was fixed when I switched to 

Length var;
var = MIN(var1, var2);

Note,

// Min/Max

/* Macros for MAX, MIN and ABS... */
#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
# define MAX(X,Y) \
	( { __typeof__ (X) x_ = (X); \
    	__typeof__ (Y) y_ = (Y); \
    	(x_ > y_) ? x_ : y_; \
	} )
# define MIN(X,Y) \
	( { __typeof__ (X) x_ = (X); \
    	__typeof__ (Y) y_ = (Y); \
    	(x_ < y_) ? x_ : y_; \
	} )
# define ABS(X) \
	( { __typeof__ (X) x_ = (X); \
    	(x_ > 0) ? x_ : -x_; \
	} )
#else
# define MAX(a,b) ( (a) < (b) ? (b) : (a) )
# define MIN(a,b) ( (a) < (b) ? (a) : (b) )
# define ABS(x) ( ((x) > 0) ? (x) : -(x) )
#endif



Comment 3 Jakub Jelinek 2006-04-11 09:10:42 UTC
Tracking upstream.