There was plenty of talk about up-gunning the Sherman during WW2, but senior officials preferred to invest in the next generation of T-26 heavy tanks with 90 mm guns. Eventually American industry produced such huge numbers of Shermans that they over-whelmed German industry and could still spare hundreds of Shermans for British and Soviet Allies.
As "the Chieftain"(
www.youtube.com and World of Tanks) says, Shermans were perfect for their role circa 1940. Unfortunately, Germany continued building larger and larger tanks with longer guns and thicker armour, so that M4 Sherman was out-dated by 1943 or the summer of 1944.
The stock 75 mm gun was fine for infantry support, destroying dug-in troops and small bunkers and soft targets (e.g. trucks). Mind you, most Shermans carried 3/4 high explosive ammunition and only a handful of anti-tank rounds.
Some Shermans were converted to assault tanks by installing 105 mm howitzers for reducing concrete fortifications.
US Army doctrine said that Shermans were primarily supposed to support infantry and leave enemy armour to specialized tank-destroyer regiments. Unfortunately, the enemy has a vote and too many times Shermans found them selves facing Panthers and Tigers. Big German cats also seriously out-ranged Shermans by hundreds or thousands of yards (up to a kilometre), meaning that big cats could usually kill Shermans as soon as they saw them, but Shermans had to close to a few hundred yards before they could kill cats and often only by shooting at thinner armour on cats' tails.
There were a couple of attempts at up-gunning Shermans. The US Army installed longer-barrel 76 mm guns that were slightly better at tank-killing, but still struggled to penetrate Tigers. A prototype 76 mm gun was longer, but they cut off a yard (1 metre) to ease transportation. Removing that yard seriously slowed muzzle velocity, which decreased penetration.
The most successful Sherman up-gun was the Sherman Firefly modification which installed a British high-velocity 17-pounder anti-tank gun. The 17-pounder was one of the few WALLIED AT guns that could consistently penetrate German cats. It's primary advantage was faster muzzle velocity. Since they only perfected HE ammo for 17-pounders near the end of the war, most British and Canadian tank troops comprised 3 Shermans with 75 mm guns plus a Firefly.