It's not completely illegal for police departments to obtain your cellphone records from wireless carriers without a warrant. So, they do it. A lot.
Wireless carriers seem happy to comply, perhaps because they get to charge lots of money every time someone asks for something, and the ACLU has found out how much money this is.
If you're a law enforcement agency of some sort, you have a nice fat à la carte menu of wiretapping, data harvesting, and electronic tracking items to choose from. Here are the going rates as of 2009, broken down by service and then by carrier:
Wiretapping, per target
Voicemail and text message access, per target
Location information and real-time tracking, per target
Tower dumps (which provide a list of all numbers accessing a cell tower)
There are two things that we should probably mention in the carriers' defense: one is that in emergency situations, they always provide all of this information for free. And two, most of them claim that they're not actually making any money, just recouping the cost of getting the information out of their system. However, the fees are so varied that you have to wonder if that's really true, and this is potentially a huge cash cow (especially for T-Mobile, by the looks of it).
Perhaps the most ridiculous part of all this is that AT&T (as one example) apparently still maintains that "we do not sell your personal information to anyone for any purpose. Period." This is quoted directly from AT&T's privacy policy, and I guess we just have to assume that "period" really means "except when law enforcement agencies throw piles of cash at us."