summaryrefslogtreecommitdiffstats
path: root/gcc/genrecog.c
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1992-01-07 00:30:06 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1992-01-07 00:30:06 +0000
commita4245b4fe0eca620f6613063a48e6959f99354e9 (patch)
tree17c2215e2fd319aea800e4ceb1d761a48e758eac /gcc/genrecog.c
parentbe1086e9a1ccb711aeb263f1ae105031ddd0f959 (diff)
downloadppe42-gcc-a4245b4fe0eca620f6613063a48e6959f99354e9.tar.gz
ppe42-gcc-a4245b4fe0eca620f6613063a48e6959f99354e9.zip
*** empty log message ***
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/genrecog.c')
-rw-r--r--gcc/genrecog.c36
1 files changed, 26 insertions, 10 deletions
diff --git a/gcc/genrecog.c b/gcc/genrecog.c
index 15d77b973c7..a3f9184ca72 100644
--- a/gcc/genrecog.c
+++ b/gcc/genrecog.c
@@ -374,7 +374,7 @@ add_to_sequence (pattern, last, position)
{
new->code = preds[i].codes[0];
if (! strcmp ("const_int_operand", new->tests))
- new->tests = 0;
+ new->tests = 0, new->pred = -1;
}
for (j = 0; j < NUM_RTX_CODE && preds[i].codes[j] != 0; j++)
@@ -1040,6 +1040,8 @@ write_tree_1 (tree, prevpos, afterward, type)
for (p = tree; p; p = p->next)
{
enum machine_mode mode = p->enforce_mode ? p->mode : VOIDmode;
+ int need_bracket;
+ int wrote_bracket = 0;
int inner_indent;
if (p->success.first == 0 && p->insn_code_number < 0)
@@ -1296,12 +1298,19 @@ write_tree_1 (tree, prevpos, afterward, type)
else
uncond = 1;
+ need_bracket = ! uncond;
+
if (p->opno >= 0)
{
- printf ("%s{\n%sro[%d] = x%d;\n",
- indents[inner_indent], indents[inner_indent + 2],
- p->opno, depth);
- inner_indent += 2;
+ if (need_bracket)
+ {
+ printf ("%s{\n", indents[inner_indent]);
+ inner_indent += 2;
+ wrote_bracket = 1;
+ need_bracket = 0;
+ }
+
+ printf ("%sro[%d] = x%d;\n", indents[inner_indent], p->opno, depth);
}
if (p->c_test)
@@ -1309,6 +1318,7 @@ write_tree_1 (tree, prevpos, afterward, type)
printf ("%sif (%s)\n", indents[inner_indent], p->c_test);
inner_indent += 2;
uncond = 0;
+ need_bracket = 1;
}
if (p->insn_code_number >= 0)
@@ -1320,7 +1330,7 @@ write_tree_1 (tree, prevpos, afterward, type)
{
if (p->num_clobbers_to_add)
{
- if (p->opno < 0 || p->c_test)
+ if (need_bracket)
{
printf ("%s{\n", indents[inner_indent]);
inner_indent += 2;
@@ -1331,7 +1341,7 @@ write_tree_1 (tree, prevpos, afterward, type)
printf ("%sreturn %d;\n",
indents[inner_indent], p->insn_code_number);
- if (p->opno < 0 || p->c_test)
+ if (need_bracket)
{
inner_indent -= 2;
printf ("%s}\n", indents[inner_indent]);
@@ -1346,28 +1356,34 @@ write_tree_1 (tree, prevpos, afterward, type)
printf ("%sgoto L%d;\n", indents[inner_indent],
p->success.first->number);
- if (p->opno >= 0)
+ if (wrote_bracket)
printf ("%s}\n", indents[inner_indent - 2]);
}
/* We have now tested all alternatives. End any switches we have open
- and branch to the alternative node. */
+ and branch to the alternative node unless we know that we can't fall
+ through to the branch. */
if (switch_code != UNKNOWN)
{
printf ("%s}\n", indents[indent - 2]);
indent -= 4;
+ uncond = 0;
}
if (switch_mode != VOIDmode)
{
printf ("%s}\n", indents[indent - 2]);
indent -= 4;
+ uncond = 0;
}
if (indent != 2)
abort ();
+ if (uncond)
+ return;
+
if (afterward)
{
change_state (prevpos, afterward->position, 2);
@@ -1417,7 +1433,7 @@ same_modes (p, mode)
register enum machine_mode mode;
{
for (; p; p = p->next)
- if (p->mode != mode || p->tests)
+ if ((p->enforce_mode ? p->mode : VOIDmode) != mode)
return 0;
return 1;
OpenPOWER on IntegriCloud