This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[itanium-sched-branch] Fixing a minor bug in reservation transformation [patch]
- From: Vladimir Makarov <vmakarov at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 20 Sep 2002 18:15:08 -0400
- Subject: [itanium-sched-branch] Fixing a minor bug in reservation transformation [patch]
- References: <3D88F38F.AB0F1273@redhat.com> <3D8B73A6.94D0BD4A@redhat.com> <3D8B7892.BFD85E38@redhat.com>
The following patch fixes a minor bug of complex reservations.
Vlad
2002-09-20 Vladimir Makarov <vmakarov@redhat.com>
* genautomata.c (transform_3): Process a missing case (nothing
on
unit place).
Index: genautomata.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/genautomata.c,v
retrieving revision 1.24.8.3
diff -c -p -r1.24.8.3 genautomata.c
*** genautomata.c 20 Sep 2002 19:10:05 -0000 1.24.8.3
--- genautomata.c 20 Sep 2002 19:28:06 -0000
*************** transform_3 (regexp)
*** 5067,5076 ****
}
else if (regexp->mode == rm_allof)
{
! regexp_t oneof = NULL, seq;
! int oneof_index = 0, max_seq_length, allof_length;
regexp_t result;
! regexp_t allof = NULL, allof_op = NULL;
int i, j;
for (i = 0; i < REGEXP_ALLOF (regexp)->regexps_num; i++)
--- 5067,5079 ----
}
else if (regexp->mode == rm_allof)
{
! regexp_t oneof = NULL;
! regexp_t seq;
! int oneof_index = 0;
! int max_seq_length, allof_length;
regexp_t result;
! regexp_t allof = NULL;
! regexp_t allof_op = NULL;
int i, j;
for (i = 0; i < REGEXP_ALLOF (regexp)->regexps_num; i++)
*************** transform_3 (regexp)
*** 5117,5135 ****
max_seq_length = 0;
if (regexp->mode == rm_allof)
for (i = 0; i < REGEXP_ALLOF (regexp)->regexps_num; i++)
! {
! if (REGEXP_ALLOF (regexp)->regexps [i]->mode == rm_sequence)
! {
! seq = REGEXP_ALLOF (regexp)->regexps [i];
! if (max_seq_length < REGEXP_SEQUENCE (seq)->regexps_num)
! max_seq_length = REGEXP_SEQUENCE (seq)->regexps_num;
! }
! else if (REGEXP_ALLOF (regexp)->regexps [i]->mode !=
rm_unit)
! {
! max_seq_length = 0;
! break;
! }
! }
if (max_seq_length != 0)
{
if (max_seq_length == 1 || REGEXP_ALLOF (regexp)->regexps_num
<= 1)
--- 5120,5137 ----
max_seq_length = 0;
if (regexp->mode == rm_allof)
for (i = 0; i < REGEXP_ALLOF (regexp)->regexps_num; i++)
! if (REGEXP_ALLOF (regexp)->regexps [i]->mode == rm_sequence)
! {
! seq = REGEXP_ALLOF (regexp)->regexps [i];
! if (max_seq_length < REGEXP_SEQUENCE (seq)->regexps_num)
! max_seq_length = REGEXP_SEQUENCE (seq)->regexps_num;
! }
! else if (REGEXP_ALLOF (regexp)->regexps [i]->mode != rm_unit
! && REGEXP_ALLOF (regexp)->regexps [i]->mode !=
rm_nothing)
! {
! max_seq_length = 0;
! break;
! }
if (max_seq_length != 0)
{
if (max_seq_length == 1 || REGEXP_ALLOF (regexp)->regexps_num
<= 1)
*************** transform_3 (regexp)
*** 5154,5160 ****
}
else if (i == 0
&& (REGEXP_ALLOF (regexp)->regexps [j]->mode
! == rm_unit))
{
allof_op = REGEXP_ALLOF (regexp)->regexps [j];
allof_length++;
--- 5156,5164 ----
}
else if (i == 0
&& (REGEXP_ALLOF (regexp)->regexps [j]->mode
! == rm_unit
! || (REGEXP_ALLOF (regexp)->regexps
[j]->mode
! == rm_nothing)))
{
allof_op = REGEXP_ALLOF (regexp)->regexps [j];
allof_length++;
*************** transform_3 (regexp)
*** 5186,5192 ****
}
else if (i == 0
&& (REGEXP_ALLOF (regexp)->regexps
[j]->mode
! == rm_unit))
{
allof_op = REGEXP_ALLOF (regexp)->regexps [j];
REGEXP_ALLOF (allof)->regexps [allof_length]
--- 5190,5198 ----
}
else if (i == 0
&& (REGEXP_ALLOF (regexp)->regexps
[j]->mode
! == rm_unit
! || (REGEXP_ALLOF (regexp)->regexps
[j]->mode
! == rm_nothing)))
{
allof_op = REGEXP_ALLOF (regexp)->regexps [j];
REGEXP_ALLOF (allof)->regexps [allof_length]