
385 N.W.2d 406 (1986)
Neil Michael PLADSON, Petitioner, Appellant,
v.
STATE of Minnesota, Respondent.
No. C6-85-1706.
Court of Appeals of Minnesota.
April 22, 1986.
*407 John H. Scherer, Donohue, Rajkowski, Hansmeier, Grunke & Jovanovich, Ltd., St. Cloud, for appellant.
Hubert H. Humphrey, III, Atty. Gen., St. Paul, Michael Lynch, Co. Atty., Warren A. Kochis, Kay Javinski, Asst. Co. Attys., Willmar, for respondent.
Heard, considered and decided by POPOVICH, C.J., and FORSBERG and LESLIE, JJ.

OPINION
FORSBERG, Judge.
This is an appeal from an order denying a petition for post-conviction relief. We reverse and remand.

FACTS
Appellant Neil Michael Pladson was sentenced on November 10, 1972, to five concurrent 25-year sentences for third-degree murder for the deaths of five members of the Fremberg family in Kandiyohi County on November 14, 1970. Appellant was arrested the following day, and indicted and arraigned on November 19, 1970. At his arraignment, the trial court set bail of $25,000 for each offense, which appellant was unable to pay, and granted appellant's certificate of indigency.
On November 26, appellant's appointed counsel moved for a psychiatric examination which was generally limited to the issues of competency and appellant's mental state on the day of the crime. He did request an opinion as to whether Pladson was mentally ill "and in need of treatment, control or care." Appellant's counsel submitted an affidavit stating that Pladson's family had had him committed in 1968 and had noted similar behavior just before the crime. Appellant's counsel also moved for a commitment for the purpose of conducting the examination.
The State moved for a psychiatric examination going beyond the issue of competency, including the question whether Pladson should be committed. The motion was denied, and appellant's motion granted. The examination was thus limited to competency and legal insanity issues. It did not extend to the need for permanent commitment. Appellant was then committed for purposes of examination.
On March 4, 1971, following a hearing the court issued an Order of Commitment to the Minnesota Security Hospital at St. Peter, Minnesota. The psychiatric opinion indicated that Pladson was mentally ill, incompetent to stand trial and legally insane on the day of the crime. The court found that Pladson was insane and had "homicidal tendencies," and ordered him committed to the hospital
for safekeeping and treatment and [he] shall remain at said hospital until he shall recover, at which time he shall be *408 returned to this court to be placed on trial upon such indictments.
A warrant of commitment was signed on March 5, 1971.
On April 10, 1972, the medical director at M.S.A. wrote to the trial court certifying to him that Pladson was competent to stand trial. He requested that Pladson stay at the hospital until shortly before the trial date. Although the trial court found that appellant was returned to the county jail on July 19, 1972, there are no documents in the file showing discharge from the commitment, transfer from hospital confinement, or re-imposition of bail.
On November 8, 1972, appellant was arraigned a second time on the indictments. The State offered to reduce the charges to 3rd degree murder, which Pladson accepted. A guilty plea was accepted on the record. On November 10, 1972, Pladson was sentenced. No mention was made of jail credit or credit for the hospital confinement either at arraignment or on sentencing.
Appellant filed a petition for post-conviction relief on August 28, 1975, claiming that he should be permitted to withdraw his guilty plea because of the breach of an alleged promise prior to or at the sentencing hearing that he would serve all of his time in a treatment facility. Denial of this petition was affirmed in State v. Pladson, 311 Minn. 564, 250 N.W.2d 183 (1977).
Appellant claims on this petition that he was denied credit for jail time and time spent in hospital confinement in violation of equal protection because he failed to post bail due to his indigency. He also claims he is entitled to retroactive application of current sentencing law requiring credit for such time in custody.
The trial court denied the petition, finding that Pladson failed to show that his release would not present a danger to the public.

ISSUE
Did the trial court err in declining to order appellant's sentence reduced by time spent before sentencing in jail and in the security hospital?

ANALYSIS
The trial court denied the petition for post-conviction relief because there was no showing that appellant does not present a danger to the public under Minn.Stat. § 590.01, subd. 3 (1984). This showing is required only if the petitioner is seeking retroactive application of the sentencing guidelines. Bixby v. State, 344 N.W.2d 390, 392 (Minn.1984) (petitioner challenged computation of 1982 criminal history score based on 1977 offenses). Such a showing was not required before the guidelines resentencing provision, and is not applicable here. See Laws 1981, c. 366, § 1 (adding subd. 3).
The State contends that appellant's petition should be denied because he failed to raise the jail-credit issue in the prior post-conviction proceeding. The supreme court in State v. Knaffla, 309 Minn. 246, 243 N.W.2d 737 (1976), held that all claims known but not raised on direct appeal will not be considered on a petition for post-conviction relief. Knaffla did not address limitations on the right to a second post-conviction proceeding. See id. We believe, however, that the prior petition does not bar relief on the grounds presented here.
Appellant brought his first petition on August 28, 1975. The case on which he relies for his claim that failure to give credit for jail time is a denial of equal protection was decided in May, 1975. King v. Wyrick, 516 F.2d 321 (8th Cir.1975). The Minnesota Rules of Criminal Procedure, mandating credit for jail time and other presentence confinement, were effective July 1, 1975. Although the U.S. Supreme Court had earlier established the basis for the equal protection argument, it did so where the burden on the indigent was more direct. Williams v. Illinois, 399 U.S. 235, 90 S.Ct. 2018, 26 L.Ed.2d 586 (1970) (statute requiring a defendant who could not pay his fine to "work off" the fine by an extension of his term of imprisonment). *409 Thus, the decision and the procedural rules on which he relies were only months old at the time of the petition. To deny relief on this ground is too strict an application of a remedial statute.
Appellant's equal protection claim is that he was confined due to his indigency from his arrest until his sentencing because he was unable to post bail. This claim ignores the civil commitment, and the length of time appellant was confined pursuant to the commitment order. Although that order is not part of the agreed statement of the record, it is included in the criminal file transmitted on appeal, and forms part of the record. Minn.R.Crim.P. 28.02, subd. 8.
Appellant's entitlement to credit for presentence confinement need not be decided on constitutional grounds. Our rules of criminal procedure automatically give credit for "all time spent in custody in connection with the offense or behavioral incident for which sentence is imposed." Minn.R. Crim.P. 27.03, subd. 4(B). Credit is also given for time spent in a hospital for a competency examination. Rule 20.01, subd. 9. Credit is not required for hospital confinement pursuant to a civil commitment. See id.; Rule 20.01, subd. 4(2)(a), (b).
The U.S. Supreme Court has held that a defendant committed solely because he is incompetent to stand trial cannot be held more than a reasonable time. Jackson v. Indiana, 406 U.S. 715, 738, 92 S.Ct. 1845, 1858, 32 L.Ed.2d 435 (1972). In Jackson the Court held that a longer confinement may be a denial of equal protection because the defendant is subject to a more lenient standard of commitment than one not charged with a criminal offense. Id. at 730, 92 S.Ct. at 1854. It was also held to be a violation of due process to commit a defendant without a consideration of the grounds for civil commitment. Id. at 731, 92 S.Ct. at 1854-1855.
Appellant here was committed following a psychiatric examination limited to questions of his competency and mental state at the time of the offenses, and a hearing of which there is no transcript in the record. The trial court had earlier expressly rejected questioning as to his present need for civil commitment. Cf. State v. Bauer, 299 N.W.2d 493 (Minn.1980) (no violation of Jackson where court used same factors in committing defendant as would be used for a non-defendant). Psychiatric opinion testimony was received at the commitment hearing, but its scope is not apparent from the record.
Appellant is entitled to credit on his sentence for time spent in jail or hospital confinement up until March 5, 1971, when the warrant of commitment was signed. The record is inadequate to determine what credit, if any, appellant is entitled to for confinement after that date. Not only is the constitutional validity of appellant's commitment unclear, but it is not possible from this record to determine appellant's custody status following the certification of his competency to stand trial. There is no indication whether appellant was discharged from the commitment or whether he was confined pursuant to that order.
We remand these issues to the trial court for determination based on the commitment file and any other documents not included in the record here.

DECISION
The trial court erred in requiring appellant to show that his release would not present a danger to the public. Appellant is entitled to credit for jail and hospital time from November 15, 1970 until March 5, 1971. He is not entitled to time spent in a hospital pursuant to a constitutionally valid civil commitment. The validity of the commitment and calculation of time to be credited following March 5, 1971, are remanded to the trial court.
Reversed and remanded.
