
623 P.2d 862 (1981)
Robert Earl GODBOLD, Petitioner,
v.
The DISTRICT COURT IN AND FOR the TWENTY-FIRST JUDICIAL DISTRICT, and Charles A. Buss, One of the Judges Thereof, Respondents.
No. 80SA327.
Supreme Court of Colorado, En Banc.
February 2, 1981.
Rehearing Denied February 23, 1981.
J. Gregory Walta, Colo. State Public Defender, Harvey M. Palefsky, Deputy State Public Defender, Denver, for petitioner.
Terrance Farina, Dist. Atty., Arthur R. Smith, Chief Deputy Dist. Atty., Grand Junction, for respondents.
ERICKSON, Justice.
Robert Earl Godbold petitioned for a writ of mandamus to compel the district court to grant him credit for 174 days presentence confinement time. Godbold claims that the respondent court's failure to credit his sentence with time spent in presentence confinement violated his constitutional guarantee of equal protection of the laws. He also contends that the equal protection guarantee requires that he be afforded retroactive relief under the provisions of section 16-11-306, C.R.S.1973 (1979 Supp.). We issued a rule to show cause and now discharge the rule.
Godbold was arrested on June 20, 1979, and charged with attempted felony theft[1] and first-degree assault.[2] Shortly thereafter, Godbold was determined to be indigent. The Public Defender's office was appointed to represent him and bail was set in the amount of $5,000. Godbold did not post bail and spent the 174-day period from his arrest until sentence was imposed in confinement.[3]
In a trial to the court, Godbold was convicted of attempted felony theft[4] and third-degree assault.[5] A sentencing hearing was *863 scheduled for November 13, 1979, but was postponed so that a competency examination could be conducted.[6] The court found that Godbold was competent to proceed and on December 11, 1979, sentenced him to a term of two to four years for attempted felony theft and a concurrent term of twelve months for third-degree assault. Pursuant to section 16-11-306, C.R.S.1973 (1978 Repl.Vol. 8),[7] the sentencing judge stated that he had considered Godbold's presentence confinement, but based upon reports of his misconduct in the jail, denied him credit for the time he spent in presentence confinement.[8]
The respondent court subsequently denied Godbold's motion for the correction of sentence filed under Crim.P. 35(c)(2)(I) (1979 Supp.), which alleged that the court's refusal to grant him credit for his presentence confinement violated his right to equal protection of the laws. U.S.Const. Amend. XIV, Colo.Const. Art. II, Sec. 25. Godbold then filed an original proceeding in this Court.
Godbold asserts two reasons to support his request for a writ of mandamus. First, he claims that equal protection of the laws requires that a court grant an indigent defendant credit for presentence confinement. However, there is nothing in the record before us to indicate that Godbold was unable to make bail due to indigency.[9] Second, he asserts that equal protection of the laws requires that section 16-11-306, C.R.S.1973 (1979 Supp.) be applied retroactively to his sentence.

I.
Godbold urges us to overrule a long line of cases which have held that there is no constitutional right to credit for presentence confinement. See, e. g. Perea v. District Court, Colo., 604 P.2d 25 (1979); People *864 v. Martinez, 192 Colo. 388, 559 P.2d 228 (1977); People v. Nelson, 182 Colo. 1, 510 P.2d 441 (1973); People v. Jones, 176 Colo. 61, 489 P.2d 596 (1971).
He argues that the United States Supreme Court's decisions in Tate v. Short, 401 U.S. 395, 91 S.Ct. 668, 28 L.Ed.2d 130 (1971)[10] and Williams v. Illinois, 399 U.S. 235, 90 S.Ct. 2018, 26 L.Ed.2d 586 (1970)[11] require reconsideration of our previous opinions and that we should follow the growing trend which has recognized a constitutional right to credit for presentence confinement. We decline to do so and reaffirm People v. Jones, supra, and its progeny.
Here, the record shows that the sentencing judge considered the presentence confinement and determined that credit should not be given.[12] Under the provisions of section 16-11-306, C.R.S.1973 (1978 Repl. Vol. 8), the judge was not required to grant credit for presentence confinement.

II.
Godbold argues that equal protection requires that he be afforded retroactive relief under section 16-11-306, C.R.S.1973 (1979 Supp.), which provides that a person who is confined prior to the imposition of sentence is entitled to credit against the term of his sentence for the entire period of such confinement.[13] We disagree.
We have concluded that there is no constitutional right to credit for presentence confinement. See People v. Jones, supra. Additionally, section 16-11-306, C.R.S.1973 (1979 Supp.) provides that the act applies to offenses committed on or after July 1, 1979, and notwithstanding any other provision of law or court rule, does not apply to offenses committed prior to that date. See People v. McKenna, Colo., 611 P.2d 574 (1980).
In People v. Johnson, 185 Colo. 285, 523 P.2d 1403 (1974), we addressed the issue of whether Johnson was entitled to be sentenced under the amended provisions of C.R.S.1963, 39-11-306,[14] which required the sentencing judge to take into consideration a defendant's presentence confinement. C.R.S.1963, 39-11-306, provided that this section was to be applied retroactively. Because no constitutional or statutory requirement dictated that the sentencing judge consider the presentence confinement at the time that Johnson was sentenced, we concluded that:
"To the extent that the statute and its amendment authorizes a court to alter or reduce, after a final conviction, a defendant's *865 sentence to reflect credit for presentence confinement, when such was not constitutionally or statutorily required at the time sentence was imposed, it falls within the principles announced in People v. Herrera [Colo., 516 P.2d 626], and is an unconstitutional infringement on the executive power of commutation." Id. at 287-8, 523 P.2d 1403.
People v. Johnson, supra, is dispositive of the issue before us. Not only does section 16-11-306, C.R.S.1973 (1979 Supp.) provide that its application is not retroactive, but the principle of Johnson mandates that it cannot be applied retroactively.
Accordingly, we discharge the rule to show cause.
DUBOFSKY and QUINN, JJ., dissent.
QUINN, Justice, dissenting:
I respectfully dissent. The prior decisions of this court notwithstanding, the petitioner in this case has a constitutional right under equal protection of the laws, U.S.Const. Amend. XIV; Colo.Const. Art. II, Sec. 25,[1] to credit for 174 days of presentence confinement on the minimum and maximum terms of his sentence.

I.
Beginning with People v. Jones, 176 Colo. 61, 489 P.2d 596 (1971), this court has held that while sentencing courts should consider the length of presentence confinement, there is no constitutional right to credit for that period of confinement. See, e. g., Perea v. District Court, Colo., 604 P.2d 25 (1979); People v. Martinez, 192 Colo. 388, 559 P.2d 228 (1977); People v. Nelson, 182 Colo. 1, 510 P.2d 441 (1973); section 16-11-306, C.R.S.1973 (1978 Repl.Vol. 8). However, a careful consideration of the holdings of the United States Supreme Court in Williams v. Illinois, 399 U.S. 235, 90 S.Ct. 2018, 26 L.Ed.2d 586 (1970), and Tate v. Short, 401 U.S. 395, 91 S.Ct. 668, 28 L.Ed.2d 130 (1971), leads inexorably to the conclusion that the denial of credit to an accused, such as petitioner, who is subject to presentence confinement because of financial inability to make bail,[2] is a discrimination which deprives him of a basic liberty interest because of poverty and such discrimination is not necessary to the attainment of any compelling governmental interest.
In Williams v. Illinois, supra, the United States Supreme Court held that a convicted indigent defendant could not be held in confinement beyond the statutory maximum term of imprisonment authorized by an Illinois statute because of his failure to pay a fine imposed conjointly with his sentence. The Illinois statute provided that a person who was unable to pay the fine could "work it off" at the rate of five dollars per day by remaining in jail after the expiration of his sentence. The Supreme Court held that the statutory scheme worked an invidious discrimination based solely on economic status:
"On its face the statute extends to all defendants an apparently equal opportunity for limiting confinement to the statutory maximum simply by satisfying a money judgment. In fact, this is an illusory choice for Williams or any indigent who, by definition, is without funds. Since only a convicted person with access to funds can avoid the increased imprisonment, the Illinois statute in operative effect exposes only indigents to the risk of imprisonment beyond the statutory maximum. By making the maximum confinement contingent upon one's ability to pay, the State has visited different consequences on two categories of persons since the result is to make incarceration *866 in excess of the statutory maximum applicable only to those without the requisite resources to satisfy the money portion of the judgment." 399 U.S. at 242, 90 S.Ct. at 2023, 26 L.Ed.2d at 593-94.
Tate v. Short, supra, extended the Williams rationale to a "fines only" penalty scheme which nevertheless required incarceration for a sufficient time to satisfy the fine at a per diem rate. The Supreme Court held that the statutory ceiling on the fine amount "cannot, consistently with the Equal Protection Clause, limit the punishment to payment of the fine if one is able to pay it, yet convert the fine into a prison term for an indigent defendant without the means to pay his fine." 401 U.S. at 399, 91 S.Ct. at 671, 28 L.Ed.2d at 133-34.
Both Williams and Tate attest to a constitutional prohibition of discriminatory treatment of indigent defendants that has been consistently applied over the years. See, e. g., Douglas v. California, 372 U.S. 353, 83 S.Ct. 814, 9 L.Ed.2d 811 (1963) (indigent defendant's right to counsel on first appeal); Gideon v. Wainwright, 372 U.S. 335, 83 S.Ct. 792, 9 L.Ed.2d 799 (1963) (indigent defendant's right to counsel at trial); Griffin v. Illinois, 351 U.S. 12, 76 S.Ct. 585, 100 L.Ed. 891 (1956) (indigent defendant's right to free transcript on appeal). It is but a logical extension of this prohibitory principle to the rule that an indigent defendant may not be confined longer than a non-indigent because of economic inability to post bail. Under equal protection analysis any distinction between the post-conviction incarceration of an indigent beyond the expiration of a sentence because of an inability to pay a fine and the refusal to credit a convicted indigent with presentence confinement incurred because of an inability to post bail is illusory. In both instances the indigent is forced to serve a longer term in prison than the non-indigent solely because of his poverty. Such a differential in treatment is an invidious discrimination that flouts one of the central aims of our criminal justice systemequal treatment under law.
The majority of federal and state courts that have considered this issue in recent years have accorded presentence credit as a matter of constitutional right. See, e. g., Matthews v. Dees, 579 F.2d 929 (5th Cir. 1978); Johnson v. Prast, 548 F.2d 699 (7th Cir. 1977); King v. Wyrick, 516 F.2d 321 (8th Cir. 1975); Ham v. North Carolina, 471 F.2d 406 (4th Cir. 1973); United States v. Gaines, 449 F.2d 143 (2d Cir. 1971); Durkin v. Davis, 390 F.Supp. 249 (E.D.Va.1975), rev'd on other grounds, 538 F.2d 1037 (4th Cir. 1976); Monsour v. Gray, 375 F.Supp. 786 (E.D.Wis.1973); Mohr v. Jordan, 370 F.Supp. 1149 (D.Md.1974); White v. Gilligan, 351 F.Supp. 1012 (S.D.Ohio 1972); In re Young, 32 Cal.App.3d 68, 107 Cal.Rptr. 915 (1973); Laden v. Warden, 169 Conn. 540, 363 A.2d 1063 (1975); Anglin v. State, 90 Nev. 287, 525 P.2d 34 (1974); State v. Lohnes, 266 N.W.2d 109 (S.D.1978); Martin v. Leverette 244 S.E.2d 39 (W.Va.1978); Wilson v. State, 82 Wis.2d 657, 264 N.W.2d 234 (1978); Klimas v. State, 75 Wis.2d 244, 249 N.W.2d 285 (1977).
The doctrine of stare decisis affords no protection to a rule of law that is no longer constitutionally viable. United States v. Gaines, supra, stands as a paradigm in this respect. Gaines was convicted of a federal narcotics violation and, while on bail pending sentence, he was arrested and charged with state crimes. Shortly after his state arrest he was brought before the federal court for sentencing on the narcotics offense and then returned to state custody for prosecution of the outstanding charges. Bail later was set on the state charges but Gaines was financially unable to post it. The state charges were ultimately dismissed and Gaines was returned to federal custody. He sought credit against his federal sentence for time spent in state custody after state bail had been set. The federal district court denied credit and that decision was affirmed by the Second Circuit Court of Appeals. United States v. Gaines, 436 F.2d 1069 (2d Cir. 1971). The United States Supreme Court granted certiorari, vacated the judgment, and remanded the case "for reconsideration in light of position asserted by the Solicitor General in the Memorandum for the United States." Gaines v. United States, 402 U.S. 1006, 91 S.Ct. 2195, 29 L.Ed.2d 428 (1971). Upon remand the *867 Second Circuit this time concluded that "Gaines' lack of wealth has resulted in his having to serve a sentence that a richer man would not have had to serve, an impermissible discrimination according to Tate and Williams" and ordered that he be credited "with the time spent in state custody after bail was set." 449 F.2d at 144. We should follow a similar course here and accord a quiet burial to People v. Jones, supra, and its progeny. The constitutional imperative of equal protection requires no less.[3]

II.
The petitioner's alleged misbehavior in jail furnishes no justification for denial of credit.[4] Where, as here, the operative effect of state action is to expose the liberty interests of indigents only to the risk of an increased sentence, equal protection demands that the state action be necessarily related to the attainment of a compelling governmental interest. Williams v. Illinois, supra; Tate v. Short, supra; see also, e. g., Williams v. Oklahoma City, 395 U.S. 458, 89 S.Ct. 1818, 23 L.Ed.2d 440 (1969); Rinaldi v. Yeager, 384 U.S. 305, 86 S.Ct. 1497, 16 L.Ed.2d 577 (1966); Smith v. Bennett, 365 U.S. 708, 81 S.Ct. 895, 6 L.Ed.2d 39 (1961). Assuming arguendo the governmental interest in institutional discipline and security is a compelling one, Laden v. Warden, supra, the denial of credit for presentence confinement because of institutional misconduct is not necessarily related to the realization of that interest. The state, in other words, has available less drastic but equally effective alternatives to achieve prison discipline and security. For example, inmates can be prosecuted for acts of misconduct amounting to criminal offenses. For less serious infractions administrative sanctions are readily available in the form of more restrictive confinement, withdrawal of privileges, or assigned work duties. In view of the wide latitude of alternatives at the disposal of prison authorities, the denial of credit for presentence confinement is not a constitutionally permissible means to achieve the legitimate governmental objective of prison discipline and security. Laden v. Warden, supra.[5]

III.
The argument that the petitioner has no real grievance because the sum of presentence *868 confinement and the sentence actually imposed is less than the statutory maximum is similarly untenable. The short answer to this argument is that the petitioner's constitutional entitlement to credit is not affected by this fact. What the court did here was to impose a sentence and then extend it because of the petitioner's indigency. Such a sentence is a discrimination on the basis of poverty and cannot be constitutionally justified. See Schornhorst, Presentence Confinement and the Constitution: The Burial of Dead Time, 23 Hastings L.J. 1041 (1972); Note, Sentence Crediting for the State Criminal DefendantA Constitutional Requirement, 34 Ohio St.L.J. 586 (1973).
Accordingly, I would make the rule absolute and remand the cause to the district court with directions to grant the petitioner credit for 174 days on the minimum and maximum terms of his sentence.
DUBOFSKY, Justice, dissenting:
For the reasons set forth in my dissent in Perea v. District Court, Colo., 604 P.2d 25 (1979), I join Justice QUINN'S dissenting opinion.
NOTES
[1]  Sections 18-2-101 and 18-4-401, C.R.S.1973 (1978 Repl.Vol. 8).
[2]  Section 18-3-202, C.R.S.1973 (1978 Repl.Vol. 8).
[3]  Godbold did not file a request or motion for modification or reduction of bail.
[4]  Sections 18-2-101 and 18-4-401, C.R.S.1973 (1978 Repl.Vol. 8).
[5]  Section 18-3-204, C.R.S.1973 (1978 Repl.Vol. 8).
[6]  The competency examination was ordered pursuant to section 16-8-111, C.R.S.1973 (1978 Repl.Vol. 8).
[7]  Prior to July 1, 1979, section 16-11-306, C.R. S.1973 (1978 Repl.Vol. 8), provided:

"(1) In sentencing a defendant to imprisonment, the sentencing judge shall take into consideration that part of any presentence confinement which the defendant has undergone with respect to the transaction for which he is to be sentenced.
"(2) The judge shall state in pronouncing sentence, and the judgment shall recite, that such consideration has been given, but no sentence shall be set aside or modified on review because of alleged failure to give such consideration unless the record clearly shows that the judge did not, in fact, consider the presentence confinement when imposing sentence.
"(3) If the maximum sentence imposed is longer than the statutory maximum for the offense less the amount of allowable presentence confinement, it shall be presumed that the judge did not consider the presentence confinement.
"(4) The provisions of this section shall apply to all defendants, whether sentenced before or after April 11, 1974."
The general assembly has amended section 16-11-306, C.R.S.1973 (1979 Supp.) to provide credit for presentence confinement:
"A person who is confined prior to the imposition of sentence is entitled to credit against the term of his sentence for the entire period of such confinement. At the time of sentencing, the court shall make a finding of the amount of presentence confinement to which the offender is entitled and shall include such finding in the mittimus. Such period of confinement shall be deducted from the sentence by the department of corrections."
Colo.Sess.Laws 1979, Ch. 157, 16-11-306 at 665. That section, however, does not apply to offenses committed prior to July 1, 1979.
[8]  The sentencing judge stated:

"The Court will not grant credit for time served in this case because Mr. Godbold's behavior in the jail, which was admitted to the doctor ... Mr. Godbold [at the jail] stopped up the toilet, set some fires, he says maybe three or four fires, also assaulted an officer by throwing water on the officer. I feel that granting credit for time served is discretionary with the Court, and those are the reasons I am not going to grant it."
[9]  In Stack v. Boyle, 342 U.S. 1, 72 S.Ct. 1, 96 L.Ed. 3 (1951), the United States Supreme Court stated: "The right to release before trial is conditioned upon the accused's giving adequate assurance that he will stand trial and submit to sentence if found guilty." Id. at 4, 72 S.Ct. at 3. In those cases where the facts warrant that bail be set in a high amount in order to insure the defendant's presence at trial, it cannot be said that indigency is the sole reason for presentence confinement. In those cases, the amount of bail may be such that even a "man of means" cannot or will not post the required bond.
[10]  In Tate v. Short, supra, the United States Supreme Court held that it was a denial of equal protection of the laws to impose a fine as a sentence and then to automatically convert it into a jail term solely because the defendant is indigent and cannot pay the fine in full.
[11]  In Williams v. Illinois, supra, the United States Supreme Court concluded that an indigent criminal defendant could not be imprisoned for default in the payment of a fine imposed in conjunction with a sentence beyond the maximum term of imprisonment authorized by the statute.

We note that here, Godbold was sentenced to a term of two to four years for attempted felony theft and a concurrent term of twelve months for third-degree assault. The crime of attempt to commit felony theft as charged is a class 5 felony and on the date of the offense carried an indeterminate penalty of one day to five years. Section 18-1-105(1), C.R.S.1973 (1978 Repl.Vol. 8). Because Godbold had been previously convicted of a felony within five years prior to the date of the attempted felony theft, he was not eligible for an indeterminate sentence. The authorized minimum sentence for a class 5 felony in such a case was not less than one year. Section 16-11-101(1)(d), C.R.S. 1973 (1978 Repl.Vol. 8). The crime of assault in the third-degree is a class 1 misdemeanor and was punishable by a sentence of six months to twenty-four months. Section 18-1-106, C.R.S.1973 (1978 Repl.Vol. 8). Considering the statutory maximum imprisonment authorized by the statutes regulating the substantive offenses along with the 174 days that Godbold spent in presentence confinement, we note that the total sentence was less than the maximum imprisonment authorized by both the attempted felony theft and third-degree assault statutes.
[12]  See n. 8, supra.
[13]  See n. 7, supra.
[14]  Now section 16-11-306, C.R.S.1973 (1978 Repl.Vol. 8).
[1]  The right to equal protection of the laws is incorporated in the due process clause of the Colorado Constitution, Colo.Const. Art. II, Sec. 25. See, e. g., Heninger v. Charnes, Colo., 613 P.2d 884 (1980); Vanderhoof v. People, 152 Colo. 147, 380 P.2d 903 (1963); People v. Max, 70 Colo. 100, 198 P. 150 (1921).
[2]  The petitioner was represented by the public defender during all stages of the case. There is no evidence that the petitioner remained in presentence confinement by choice rather than necessity. Under such circumstances there is only one reasonable inference: the cause of the petitioner's presentence confinement was his indigency.
[3]  Granting an accused credit for presentence confinement as a matter of constitutional right would not implicate in any manner the constitutionality of the money bail system. Although money bail may discriminate implicitly against the indigent, justification for the system lies in the state's compelling interest in assuring that all defendants are present at subsequent court appearances. Klimas v. State, 75 Wis.2d 244, 249 N.W.2d 285 (1977). However, once the defendant has been convicted, the state no longer has a legitimate, much less compelling, interest in requiring an indigent to remain incarcerated longer than the affluent defendant who was able to make bail but was convicted of an identical offense and sentenced to an identical term as the indigent.

"There is no constitutionally sufficient reason to permit the pre-trial discrimination on the basis of wealth to go unrectified, if it is at all possible to do so. The obvious method of rectifying the inequality is to credit the preconviction time in partial fulfillment of the sentence imposed upon conviction." Klimas v. State, 75 Wis.2d at 249, 249 N.W.2d at 288 (1977).
See White v. Gilligan, 351 F.Supp. 1012 (1972); In re Young, 32 Cal.App.3d 68, 107 Cal.Rptr. 915 (1973); Wilson v. State, 82 Wis.2d 657, 264 N.W.2d 234 (1978).
[4]  The presentence report does not contain any reference to the petitioner's misbehavior. The source of the reports on the petitioner's misconduct apparently was the petitioner's statements to a psychiatric examiner during a competency examination. When the judge sentenced the petitioner he stated that he was denying credit because of "Mr. Godbold's behavior in the jail, which was admitted to the doctor." The misbehavior purportedly consisted of stopping up a toilet, setting fires, and throwing water on an officer.
[5]  The sentencing judge properly may consider the character of the offender and all aggravating circumstances surrounding the offender. Section 18-1-105(1)(b), C.R.S.1973 (1979 Supp.). Misconduct during presentence confinement, therefore, may be pertinent to the sentencing decision and the sentencing judge may elect to consider it in fixing the term of the sentence. So long as the sentencing judge grants credit for presentence confinement in such a case, the offender will have received his constitutional entitlement. It is quite another matter, however, for the sentencing judge to use the same institutional misbehavior as the basis for denying the offender his constitutional right to credit for such confinement. The latter course of action is precisely the one the sentencing judge took in this case to the constitutional detriment of the petitioner.
