
178 N.W.2d 723 (1970)
Henry Albert STEEVES, Appellant,
v.
STATE of Minnesota, Respondent.
No. 41739.
Supreme Court of Minnesota.
June 30, 1970.
*724 C. Paul Jones, Public Defender, Roberta K. Levy, Asst. Public Defender, Minneapolis, for appellant.
Douglas M. Head, Atty. Gen., St. Paul, George M. Scott, County Atty., David G. Roston, Asst. County Atty., Minneapolis, for respondent.
Heard before KNUTSON, C. J., and NELSON, WILLIAM P. MURPHY, OTIS, and JAMES F. MURPHY, JJ.

OPINION
JAMES F. MURPHY, Justice.[*]
Appeal from an order of the district court denying defendant's petition for postconviction relief.
The petition was based principally upon the grounds that (1) the plea of guilty should have been rejected because defendant, Henry A. Steeves, had not committed acts sufficient to constitute a violation of Minn.St. 618.01, 618.02, and 618.21, subd. 1; (2) the sentence imposed was invalid and void in that it constituted cruel and unusual punishment in violation of the Eighth Amendment to the United States Constitution; and (3) the defendant's rights under the Fourth Amendment of the United States Constitution were violated due to an illegal search and seizure.
On October 28, 1966, Minneapolis police officers, pursuant to a search warrant, were searching the home of Mrs. Joanne Kelly for narcotics. During the search defendant and Mrs. Kelly came up to the front door and noticed it had been forced open. As defendant approached, the police officers observed that he had a gun in his possession. As defendant and Mrs. Kelly entered the house, there was a struggle with the police. Defendant ran from the house into the street where he was felled by a police bullet. While still conscious he was searched. The police found in his possession, and seized, a pistol, an injection implement, and a round, pink pill known commercially as Percodan-Demi. Defendant was charged with possession of narcotics in violation of Minn.St. 618.01, 618.02, and 618.21. On November 29, 1966, defendant with his privately retained counsel appeared in court, entered a plea of guilty to the crime charged in the information, and was sentenced to an indeterminate term.[1] The execution of the sentence was stayed for 5 years and defendant placed on probation. It was his first felony conviction, although he had been treated at Willmar State Hospital for drug addiction prior to this time.
*725 On March 29, 1967, defendant pleaded guilty to a charge of burglary. On that same day his probation on the narcotic conviction was revoked and his sentence was amended to imprisonment for a term not to exceed 10 years to run concurrently with the sentence imposed for the burglary conviction. On October 30, 1967, defendant filed a petition for postconviction relief alleging errors in the court's acceptance of his guilty plea on the narcotic charge. The postconviction court denied any relief.
1. Defendant first contends that Percodan-Demi is codeine and that possession of codeine is covered by Minn.St. 618.081.[2] The evidence produced at the postconviction hearing clearly shows that Percodan-Demi is the trade name of the chemical preparation oxycodone, more technically known as dihydrohydroxycodinone, and that this compound or preparation is a derivative of an alkaloid of the narcotic drug opium; that it is a class A narcotic; that oxycodone is not a derivative of codeine; and that percodan is a stronger narcotic, milligram per milligram, than is codeine. The expert testimony distinguishes and separates the drug codeine from oxycodone and establishes that Percodan-Demi was not derived from codeine. Part of defendant's dilemma is that he tries to infer that codinone, the last part of dihydrohydroxycodinone, is similar to codeine, but the testimony of expert witness called by the state makes it perfectly clear that codinone is another narcotic substance separate from codeine.
In the light of the record this court can only hold that Percodan-Demi is an entirely different and separate drug from codeine and that if the legislature had intended to include Percodan-Demi (oxycodone) within Minn.St. 618.081, it would have included it by name.
2-3. Defendant contends that his sentence of 10 years' imprisonment is cruel and unusual punishment, in violation of the Eighth Amendment to the United States Constitution. He first bases his contention upon the fact that he was a first offender and that he was in possession of only a small amount of narcotics, although he is an admitted drug addict. These facts were taken into consideration by the trial court at defendant's original sentencing. He was given an indeterminate term. The length of an indeterminate term is limited by the penalty that the statute imposes, in this case 20 years. But the execution of the sentence was stayed for 5 years and defendant placed on probation. It was only after he violated his probation that he was placed in prison. Actually, the amendment of his sentence to a term of 10 years was to his advantage because it limited the time he would be held in prison to 10 years rather than the possible 20 years which the indeterminate sentence would have allowed. Although the sentence may seem quite severe under the circumstances, the trial court has great discretion in the imposition of a sentence and the appellate court cannot substitute its judgment for that of the trial court. State v. Gamelgard, Minn., 177 N.W.2d 404.
This court has said with reference to cruel and unusual punishment:
"It is the province of the legislature to declare what acts deemed by the lawmakers inimical to the public welfare shall constitute crimes, and to prohibit the same and provide the penalties therefor. State v. Shevlin-Carpenter Co., 99 Minn. 158, 108 N.W. 935. The wisdom of such acts of the legislature is not for *726 the courts, State v. Moilen, 140 Minn. 112, 167 N.W. 345, 1 A.L.R. 331; 5A Dunnell, Dig. (3 ed.) § 2407, unless the punishment provided is out of all proportion to the crime so as to constitute a violation of the constitutional proscription against cruel and inhuman punishment. Ordinarily, cruel and inhuman punishment relates to something that involves mental or physical agony, or a sentence of such duration that it is out of all proportion to the nature of the crime. Trop v. Dulles, 356 U.S. 86, 78 S.Ct. 590, 2 L.Ed.2d 630." State v. Anderson, 280 Minn. 461, 462, 159 N.W.2d 892, 894.
The sentence herein was in fact limited to one-half of what defendant could lawfully receive under the statute. Such is not cruel and unusual punishment.
The main thrust of defendant's appeal is that the sentence imposed upon him is cruel and unusual in contravention of the Eighth Amendment to the United States Constitution because his "status" as a drug addict is the reason for his punishment. Defendant relies upon Robinson v. California, 370 U.S. 660, 82 S.Ct. 1417, 8 L.Ed.2d 758, and United States v. Watson.[3]
In Robinson, the United States Supreme Court reversed a conviction under a California statute which made it a misdemeanor to be addicted to the use of narcotics. The court held that it was a violation of the Eighth Amendment to punish as criminal the "status" of a person. Robinson, an addict, was arrested in Los Angeles County and charged with being an addict. There was no evidence that Robinson had ever had narcotics in his possession in Los Angeles County or that he violated any California law. Under these circumstances, the court held that punishing a person for being an addict is like punishing him for being insane or a leper. Under the foregoing facts and law, the Robinson case is not applicable to the instant case.
This case is much like Powell v. Texas, 392 U.S. 514, 88 S.Ct. 2145, 20 L.Ed.2d 1254, in which the United States Supreme Court refused to apply Robinson to the case of an alcoholic convicted of public drunkenness. The majority did not agree that punishment for public drunkenness is a punishment of a "status," but were of the opinion, rather, that it is punishment for an individual's public behavior, which historically has been subject to criminal sanction.
The sentence imposed upon defendant herein was within the limits provided by statute and rested upon conviction for a criminal offense based on defendant's actions and not on his status as a drug addict.
4. Lastly, defendant claims the evidence seizeda Percodan-Demi pillwas the result of an illegal search and seizure. This issue was not briefed by defendant, but was presented to this court in the oral argument.
In the order appealed from, the postconviction court found that the search was reasonable and constitutionally valid as an incident to a lawful arrest. The court also noted that defendant, while represented by able, competent, privately retained counsel, waived his right to contest the validity of the search and seizure. At the arraignment the following occurred:
"Q. Mr. Steeves, apparently there was a search made pursuant to your arrest, and also you made some statement to the police officers at the time of the arrest. You would have had the right to a hearing to test the constitutional validity of these two acts by the police, one *727 in obtaining the evidence by a search, and two, obtaining the confession or any statements that you made. Do you wish to waive that hearing at this time?
"A. Yes."
Whether the search and seizure were legal or not, defendant, having specifically waived his right to contest the validity of the search and seizure after having been given the opportunity to do so, will be held to his waiver.
The determination by the district court in the postconviction proceedings is affirmed.
Affirmed.
NOTES
[*]  Acting as Justice of the Supreme Court by appointment pursuant to Minn.Const. art. 6, § 2, and Minn.St. 2.724, subd. 2.
[1]  Minn.St. 618.21 provides for penalties of not less than 5 nor more than 20 years' imprisonment. A fine not exceeding $10,000 may also be imposed.
[2]  Minn.St. 618.081 provides: "* * * [N]o person shall, within any 48 consecutive hours, purchase or have in his possession medicinal preparations containing more than six grains of codeine or any of its salts, except pursuant to a lawful prescription * * *. Notwithstanding the provisions of Minnesota Statutes 1961, Section 618.21, and acts amendatory thereof to the contrary, any person violating the terms of this section shall, upon conviction therefor, be punished by a fine of not more than $100 or imprisonment for not more than 90 days."
[3]  United States v. Watson, No. 21186, Appeal Cases, District of Columbia, argued Jan. 26, 1968. However, the court has been informed that the opinion filed December 13, 1968, has been returned to the Court of Appeals for examination and is subject to change by the court. The facts in Watson are somewhat similar to the facts in the instant case, but the court does not at this time consider it an official opinion.
