Fix PR tree-optimization/32583 Fix PR tree-optimization/32584
2007-07-02 Daniel Berlin <dberlin@dberlin.org> Fix PR tree-optimization/32583 Fix PR tree-optimization/32584 * tree-ssa-pre.c (phi_translate): Always pass seen bitmap. (phi_translate_set): Use phi_translate directly now. (make_values_for_stmt): Don't value number RHS if we already know it is constant. From-SVN: r126222
This commit is contained in:
parent
943c54ce49
commit
f8b041959a
5 changed files with 132 additions and 5 deletions
|
@ -1,3 +1,12 @@
|
|||
2007-07-02 Daniel Berlin <dberlin@dberlin.org>
|
||||
|
||||
Fix PR tree-optimization/32583
|
||||
Fix PR tree-optimization/32584
|
||||
* tree-ssa-pre.c (phi_translate): Always pass seen bitmap.
|
||||
(phi_translate_set): Use phi_translate directly now.
|
||||
(make_values_for_stmt): Don't value number RHS if we already know
|
||||
it is constant.
|
||||
|
||||
2007-07-02 Steve Ellcey <sje@cup.hp.com>
|
||||
Jim Wilson <wilson@specifix.com>
|
||||
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2007-07-02 Daniel Berlin <dberlin@dberlin.org>
|
||||
|
||||
* gfortran.fortran-torture/compile/pr32583.f: New.
|
||||
* gcc.c-torture/compile/pr32584.c: New
|
||||
|
||||
2007-07-02 Ollie Wild <aaw@google.com>
|
||||
|
||||
* g++.dg/lookup/using16.C: Merge dg-errors with common line.
|
||||
|
|
71
gcc/testsuite/gcc.c-torture/compile/pr32584.c
Normal file
71
gcc/testsuite/gcc.c-torture/compile/pr32584.c
Normal file
|
@ -0,0 +1,71 @@
|
|||
typedef long unsigned int size_t;
|
||||
typedef long int __ssize_t;
|
||||
typedef struct
|
||||
{
|
||||
} __mbstate_t;
|
||||
typedef struct
|
||||
{
|
||||
} _G_fpos64_t;
|
||||
enum
|
||||
{
|
||||
__GCONV_INTERNAL_ERROR
|
||||
};
|
||||
typedef int (*__gconv_trans_fct) (struct __gconv_step *,
|
||||
size_t *);
|
||||
typedef int (*__gconv_trans_context_fct) (void *, __const unsigned char *,
|
||||
unsigned char *, unsigned char *);
|
||||
struct __gconv_trans_data
|
||||
{
|
||||
};
|
||||
struct _IO_marker {
|
||||
};
|
||||
typedef __ssize_t __io_write_fn (void *__cookie, __const char *__buf,
|
||||
size_t __n);
|
||||
typedef struct blockbox {
|
||||
} *BBOXPTR, BBOX ;
|
||||
typedef struct netbox {
|
||||
} *NBOXPTR, NBOX ;
|
||||
typedef struct termbox {
|
||||
struct termbox *nextterm ;
|
||||
} *TEBOXPTR, TEBOX ;
|
||||
typedef struct tilebox {
|
||||
TEBOXPTR termsptr ;
|
||||
}
|
||||
*TIBOXPTR ,
|
||||
TIBOX ;
|
||||
typedef struct cellbox {
|
||||
TIBOXPTR tileptr ;
|
||||
}
|
||||
*CBOXPTR ,
|
||||
CBOX ;
|
||||
typedef struct dimbox {
|
||||
}
|
||||
DBOX ;
|
||||
typedef struct rowbox {
|
||||
} ROWBOX ;
|
||||
typedef struct binbox {
|
||||
}
|
||||
CHANGRDBOX ;
|
||||
extern int numcells ;
|
||||
extern int numterms ;
|
||||
sortpin()
|
||||
{
|
||||
int j , n , cell ;
|
||||
CBOXPTR ptr ;
|
||||
TIBOXPTR tile ;
|
||||
TEBOXPTR term , *xpptr ;
|
||||
for( cell = 1 ; cell <= numcells + numterms ; cell++ ) {
|
||||
if( ( tile = ptr->tileptr ) == (TIBOXPTR) ((void *)0) ) {
|
||||
}
|
||||
n = 0 ;
|
||||
for( term = tile->termsptr ; term != (TEBOXPTR) ((void *)0) ;
|
||||
term = term->nextterm ) {
|
||||
xpptr[ ++n ] = term ;
|
||||
}
|
||||
xpptr[ n + 1 ] = (TEBOXPTR) ((void *)0) ;
|
||||
ptr->tileptr->termsptr = xpptr[ 1 ] ;
|
||||
for( j = 1 ; j <= n ; j++ ) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
40
gcc/testsuite/gfortran.fortran-torture/compile/pr32583.f
Normal file
40
gcc/testsuite/gfortran.fortran-torture/compile/pr32583.f
Normal file
|
@ -0,0 +1,40 @@
|
|||
subroutine detune(iv,ekk,ep,beta,dtu,dtup,dfac)
|
||||
implicit real*8 (a-h,o-z)
|
||||
parameter(npart=64,nmac=1)
|
||||
parameter(nele=700,nblo=300,nper=16,
|
||||
&nelb=100,nblz=20000,nzfz=300000,mmul=11)
|
||||
parameter(nran=280000,ncom=100,mran=500,mpa=6,nrco=5,nema=15)
|
||||
parameter(mcor=10)
|
||||
parameter(npos=20000,nlya=10000,ninv=1000,nplo=20000)
|
||||
parameter(nmon1=600,ncor1=600)
|
||||
parameter(pieni=1d-17)
|
||||
parameter(zero=0.0d0,half=0.5d0,one=1.0d0)
|
||||
parameter(two=2.0d0,three=3.0d0,four=4.0d0)
|
||||
dimension dfac(10),dtu(2,5),ep(2),beta(2),dtup(2,5,0:4,0:4)
|
||||
save
|
||||
pi=four*atan(one)
|
||||
iv2=2*iv
|
||||
iv3=iv+1
|
||||
vtu1=-ekk*(half**iv2)*dfac(iv2)/pi
|
||||
dtu1=zero
|
||||
dtu2=zero
|
||||
do 10 iv4=1,iv3
|
||||
iv5=iv4-1
|
||||
iv6=iv-iv5
|
||||
vor=one
|
||||
if(mod(iv6,2).ne.0) vor=-one
|
||||
vtu2=vor/(dfac(iv5+1)**2)/(dfac(iv6+1)**2)*(beta(1)**iv5)* (beta
|
||||
+ (2)**iv6)
|
||||
if(iv5.ne.0) then
|
||||
dtu1=dtu1+vtu2*iv5*(ep(1)**(iv5-1))*(ep(2)**iv6)
|
||||
dtup(1,iv,iv5-1,iv6)=dtup(1,iv,iv5-1,iv6)+vtu2*iv5*vtu1
|
||||
endif
|
||||
if(iv6.ne.0) then
|
||||
dtu2=dtu2+vtu2*iv6*(ep(1)**iv5)*(ep(2)**(iv6-1))
|
||||
dtup(2,iv,iv5,iv6-1)=dtup(2,iv,iv5,iv6-1)+vtu2*iv6*vtu1
|
||||
endif
|
||||
10 continue
|
||||
dtu(1,iv)=dtu(1,iv)+vtu1*dtu1
|
||||
dtu(2,iv)=dtu(2,iv)+vtu1*dtu2
|
||||
return
|
||||
end
|
|
@ -1322,6 +1322,7 @@ phi_translate_1 (tree expr, bitmap_set_t set1, bitmap_set_t set2,
|
|||
gcc_unreachable ();
|
||||
}
|
||||
}
|
||||
|
||||
/* Translate EXPR using phis in PHIBLOCK, so that it has the values of
|
||||
the phis in PRED.
|
||||
Return NULL if we can't find a leader for each part of the
|
||||
|
@ -1331,7 +1332,9 @@ static tree
|
|||
phi_translate (tree expr, bitmap_set_t set1, bitmap_set_t set2,
|
||||
basic_block pred, basic_block phiblock)
|
||||
{
|
||||
return phi_translate_1 (expr, set1, set2, pred, phiblock, NULL);
|
||||
bitmap_clear (seen_during_translate);
|
||||
return phi_translate_1 (expr, set1, set2, pred, phiblock,
|
||||
seen_during_translate);
|
||||
}
|
||||
|
||||
/* For each expression in SET, translate the value handles through phi nodes
|
||||
|
@ -1356,9 +1359,7 @@ phi_translate_set (bitmap_set_t dest, bitmap_set_t set, basic_block pred,
|
|||
for (i = 0; VEC_iterate (tree, exprs, i, expr); i++)
|
||||
{
|
||||
tree translated;
|
||||
bitmap_clear (seen_during_translate);
|
||||
translated = phi_translate_1 (expr, set, NULL, pred, phiblock,
|
||||
seen_during_translate);
|
||||
translated = phi_translate (expr, set, NULL, pred, phiblock);
|
||||
|
||||
/* Don't add constants or empty translations to the cache, since
|
||||
we won't look them up that way, or use the result, anyway. */
|
||||
|
@ -3404,7 +3405,8 @@ make_values_for_stmt (tree stmt, basic_block block)
|
|||
lhsval = valvh ? valvh : get_value_handle (lhs);
|
||||
|
||||
STRIP_USELESS_TYPE_CONVERSION (rhs);
|
||||
if (can_value_number_operation (rhs))
|
||||
if (can_value_number_operation (rhs)
|
||||
&& (!lhsval || !is_gimple_min_invariant (lhsval)))
|
||||
{
|
||||
/* For value numberable operation, create a
|
||||
duplicate expression with the operands replaced
|
||||
|
|
Loading…
Add table
Reference in a new issue