A rapist who has spent 25 years in detention because of his uncontrollable sexual instincts should be in a nursing home, the man's barrister has told South Australia's Supreme Court.

Peter Charles Deering, 59, was convicted of four rapes in 1986 and is currently detained at Glenside Hospital.

Barrister David Stokes says Deering is ill and will not be able to get the care he needs when the hospital is redeveloped.

Outside court, he said Deering is in limbo because a nursing home would be unlikely to accept him, given his criminal history.

"The dilemma is that because, as I understand it, the government's cutting funding to Glenside and it's being, I think the appropriate bureaucratic term is downsized, to an institution that will not be appropriate for someone of his age and health," he said.

But Justice Trish Kelly ruled that Deering should not be released from detention because he would pose a risk to the community and could not live independently.