diff options
author | Kenneth Zadeck <zadeck@naturalbridge.com> | 2007-10-09 14:00:11 +0000 |
---|---|---|
committer | H.J. Lu <hjl@gcc.gnu.org> | 2007-10-09 07:00:11 -0700 |
commit | 23e7aeeac72859a7bd8d73f62ea60dc18acd326e (patch) | |
tree | eeef3678f2859457c4c3866b5af872f488458bdf | |
parent | 56a51b00a9168b86275a492fced5c948b575cf10 (diff) | |
download | gcc-23e7aeeac72859a7bd8d73f62ea60dc18acd326e.zip gcc-23e7aeeac72859a7bd8d73f62ea60dc18acd326e.tar.gz gcc-23e7aeeac72859a7bd8d73f62ea60dc18acd326e.tar.bz2 |
re PR rtl-optimization/33669 (Revision 128957 miscompiles 481.wrf)
gcc/
2007-10-09 Kenneth Zadeck <zadeck@naturalbridge.com>
PR middle-end/33669
* ra-conflict.c (record_one_conflict_between_regnos,
set_conflicts_for_earlyclobber, global_conflicts): Improved
logging.
(global_conflicts): Removed incorrect check.
gcc/testsuite/
2007-10-09 Kenneth Zadeck <zadeck@naturalbridge.com>
PR middle-end/33669
* gcc.c-torture/execute/pr33669.c: New.
From-SVN: r129166
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/ra-conflict.c | 12 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/pr33669.c | 40 |
4 files changed, 59 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 43c2c9d..d10a6c5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2007-10-09 Kenneth Zadeck <zadeck@naturalbridge.com> + + PR middle-end/33669 + * ra-conflict.c (record_one_conflict_between_regnos, + set_conflicts_for_earlyclobber, global_conflicts): Improved + logging. + (global_conflicts): Removed incorrect check. + 2007-10-09 Richard Sandiford <rsandifo@nildram.co.uk> PR tree-optimization/33615 diff --git a/gcc/ra-conflict.c b/gcc/ra-conflict.c index 27a9fcc..a184443 100644 --- a/gcc/ra-conflict.c +++ b/gcc/ra-conflict.c @@ -196,7 +196,7 @@ record_one_conflict_between_regnos (enum machine_mode mode1, int r1, int allocno2 = reg_allocno[r2]; if (dump_file) - fprintf (dump_file, " rocbr adding %d<=>%d\n", r1, r2); + fprintf (dump_file, " rocbr adding %d<=>%d\n", r1, r2); if (allocno1 >= 0 && allocno2 >= 0) set_conflict (allocno1, allocno2); @@ -401,9 +401,6 @@ set_conflicts_for_earlyclobber (rtx insn) recog_data.operand[use + 1]); } } - - if (dump_file) - fprintf (dump_file, " finished early clobber conflicts.\n"); } @@ -983,8 +980,7 @@ global_conflicts (void) set_renumbers_live (&renumbers_live, live_subregs, live_subregs_used, allocnum, renumber); } - - else if (!sparseset_bit_p (allocnos_live, allocnum)) + else { if (dump_file) fprintf (dump_file, " dying pseudo\n"); @@ -1071,6 +1067,8 @@ global_conflicts (void) FIXME: We should consider either adding a new kind of clobber, or adding a flag to the clobber distinguish these two cases. */ + if (dump_file && VEC_length (df_ref_t, clobbers)) + fprintf (dump_file, " clobber conflicts\n"); for (k = VEC_length (df_ref_t, clobbers) - 1; k >= 0; k--) { struct df_ref *def = VEC_index (df_ref_t, clobbers, k); @@ -1132,6 +1130,8 @@ global_conflicts (void) if (GET_CODE (PATTERN (insn)) == PARALLEL && multiple_sets (insn)) { int j; + if (dump_file) + fprintf (dump_file, " multiple sets\n"); for (j = VEC_length (df_ref_t, dying_regs) - 1; j >= 0; j--) { int used_in_output = 0; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 61dd6de..c37814b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-10-09 Kenneth Zadeck <zadeck@naturalbridge.com> + + PR middle-end/33669 + * gcc.c-torture/execute/pr33669.c: New. + 2007-10-09 Richard Sandiford <rsandifo@nildram.co.uk> PR tree-optimization/33615 diff --git a/gcc/testsuite/gcc.c-torture/execute/pr33669.c b/gcc/testsuite/gcc.c-torture/execute/pr33669.c new file mode 100644 index 0000000..69d8625 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr33669.c @@ -0,0 +1,40 @@ +extern void abort (void); + +typedef struct foo_t +{ + unsigned int blksz; + unsigned int bf_cnt; +} foo_t; + +#define _RNDUP(x, unit) ((((x) + (unit) - 1) / (unit)) * (unit)) +#define _RNDDOWN(x, unit) ((x) - ((x)%(unit))) + +long long +foo (foo_t *const pxp, long long offset, unsigned int extent) +{ + long long blkoffset = _RNDDOWN(offset, (long long )pxp->blksz); + unsigned int diff = (unsigned int)(offset - blkoffset); + unsigned int blkextent = _RNDUP(diff + extent, pxp->blksz); + + if (pxp->blksz < blkextent) + return -1LL; + + if (pxp->bf_cnt > pxp->blksz) + pxp->bf_cnt = pxp->blksz; + + return blkoffset; +} + +int +main () +{ + foo_t x; + long long xx; + + x.blksz = 8192; + x.bf_cnt = 0; + xx = foo (&x, 0, 4096); + if (xx != 0LL) + abort (); + return 0; +} |