diff --git a/VERSION b/VERSION index b9bf45db..3a29efb7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.3.478 +8.3.479 diff --git a/extract/ExtUnique.c b/extract/ExtUnique.c index 81cf6587..05645a3e 100644 --- a/extract/ExtUnique.c +++ b/extract/ExtUnique.c @@ -154,9 +154,31 @@ extUniqueCell(def, option) } if (lastreg != lp && lastreg != &processedLabel) { - nwarn += extMakeUnique(def, ll, lp, lregList, + LabelList *lltest = NULL; + + /* If the last label is a port and this label is not, then + * run extMakeUnique on the port (since extMakeUnique() causes + * all other nodes to be made unique). This preserves the port + * name whenever a port name disagrees with an internal name. + */ + + if (!(ll->ll_label->lab_flags & PORT_DIR_MASK)) + for (lltest = lastreg->lreg_labels; lltest; lltest = lltest->ll_next) + if (!strcmp(lltest->ll_label->lab_text, text)) + if (lltest->ll_label->lab_flags & PORT_DIR_MASK) + break; + + if (lltest != NULL) + { + nwarn += extMakeUnique(def, lltest, lastreg, lregList, &labelHash, option); - HashSetValue(he, (ClientData) &processedLabel); + } + else + { + nwarn += extMakeUnique(def, ll, lp, lregList, + &labelHash, option); + HashSetValue(he, (ClientData) &processedLabel); + } } } } @@ -199,7 +221,7 @@ extMakeUnique(def, ll, lreg, lregList, labelHash, option) if (option == EXT_UNIQ_ALL) goto makeUnique; else if ((option == EXT_UNIQ_NOPORTS || option == EXT_UNIQ_NOTOPPORTS) && - !(ll->ll_label->lab_flags & PORT_DIR_MASK)) + (ll->ll_label->lab_flags & PORT_DIR_MASK)) goto makeUnique; cpend = strchr(text, '\0'); @@ -207,7 +229,7 @@ extMakeUnique(def, ll, lreg, lregList, labelHash, option) if (*cpend == '#') goto makeUnique; if (*cpend == '!') return 0; if (((option == EXT_UNIQ_NOPORTS) || (option == EXT_UNIQ_NOTOPPORTS)) - && (ll->ll_label->lab_flags & PORT_DIR_MASK)) + && !(ll->ll_label->lab_flags & PORT_DIR_MASK)) return 0; /* Generate a warning for each occurrence of this label */ @@ -250,7 +272,7 @@ makeUnique: { if (ll2->ll_label == (Label *) NULL) continue; - if (strcmp(ll2->ll_label->lab_text, name) != 0) + if (strcmp(ll2->ll_label->lab_text, name)) continue; /*