We’re in a stock buyback binge. Companies are tripping over themselves to repurchase their own shares this year, and most investors see this as a bonanza.

But not all of these buyback programs wind up benefiting shareholders. In fact, some can be quite costly and destroy value rather than create it.

On the positive side, companies that buy back shares reduce the amount of stock they have outstanding. This has the effect of increasing earnings per share and the stakes of existing shareholders. That’s why many investors have been pushing for buybacks, especially at companies sitting on mountains of cash.

Such calls are being heeded. April was the biggest month ever for buyback announcements — $141 billion, according to data compiled by Rob Leiphart at Birinyi Associates. If these buyback plans continue at the current rate, they will reach $1.1 trillion this year, he said, well above the peak of $863 billion in repurchase announcements in 2007. In April, Apple and General Electric announced $50 billion programs. In February, Home Depot said it would buy back $18 billion of its stock, and Gilead Sciences chimed in with a $15 billion plan. Also in February, PepsiCo announced a $12 billion program.

The best buybacks occur at companies that have concluded — after careful analysis — that their stocks are cheap and that purchasing them is a wise use of their capital. But veteran investors warn that companies must combine stock repurchases with other steps if they want to unlock value in their operations.

Problems emerge when companies spend billions of stockholders’ dollars repurchasing shares with little to no effect on the amount of stock that remains outstanding. This can happen when they are buying back shares with one hand and, with the other, issuing stock options or restricted shares to executives and other employees as part of their compensation.

Consider Qualcomm, a maker of digital wireless communications equipment. Over its last five fiscal years, Qualcomm has been a big buyer of its own shares. Financial filings show that it has repurchased 238 million shares at a cost of $13.6 billion.

You might think a buyback program of that size would have diminished the total share count. In fact, Qualcomm’s average diluted share count has actually increased over the period by almost 41 million shares. That’s a 2 percent rise since 2010.

How is this possible? Mainly it’s because the company has been granting a treasure trove of stock and option awards to its executives and other employees over the last five years. In that period, Qualcomm’s financial statements show, the company issued 97 million shares to cover these grants. Two-thirds of the shares were restricted stock units; the remainder consisted of stock options.

The prices Qualcomm paid to buy back shares and the prices at which it issued them to executives and other employees raise an interesting and troubling question for shareholders.

Financial filings show that Qualcomm paid an average of $56.14 a share to buy back stock that is now priced at around $69. That may look like a good deal for shareholders. But wait.

Calculate the costs of Qualcomm’s stock-based compensation and it turns out that the company was issuing shares at an average price of $53.54 during that period. On the 97 million options and restricted shares granted by the company over the last five years, that $2.60 difference represents a net transfer from shareholders of more than $250 million. Other dilution created by past grants would increase that figure to $600 million or more.

George Davis, chief financial officer of Qualcomm, acknowledged that its return of capital to shareholders in recent years had trailed that of its peers. “We were coming out of a period where the company went through a very rapid growth phase and the focus really was on executing well,” he said in an interview on Thursday. “As the growth normalized, we saw that we had some catch-up to do, both on the dividend and on share repurchases.”

That catch-up has begun to take effect, he said, and the share count fell 2.7 percent this year. “We felt at a minimum that we should be nondilutive,” he said.

Qualcomm has told investors that its new buybacks supplement a plan to return 75 percent of its free cash flow to shareholders through stock repurchases and dividends in the coming years.

But Qualcomm shareholders should pay close attention to the impact the company’s stock and option grants have on its share repurchase programs. That scrutiny is important for two reasons.

First, the company is bounteous in its executive pay practices — Steven M. Mollenkopf, who became chief executive last year, was the eighth-highest-paid C.E.O. among the top 200 companies in the United States in 2014, according to Equilar, a compensation analysis firm in Redwood City, Calif. His $60.7 million package included $58 million worth of stock.

Over the last five years at Qualcomm, Mr. Mollenkopf has received $105 million in total compensation, Equilar said.

Second, Qualcomm has been excluding the costs of its generous share-based compensation from the financial results it uses to measure executives’ performance for pay purposes. These are not insignificant sums: Over the past three years, the compensation cost excluded from the incentive pay calculation has totaled $3.2 billion, the company proxy shows. (These figures represent the value of the grants on the date they were given and include shares that have not yet vested.)

Had Qualcomm included share-based compensation in one of the figures it uses to measure executive performance — a version of operating income that excludes certain expenses — that number would have been 12 percent lower last year. And that would clearly have diminished its top executives’ pay.

In March, Qualcomm announced that it was almost doubling its share buyback program to $15 billion; $10 billion of that is supposed to be purchased by March 2016. It borrowed $10 billion in the public debt markets in May to pay for these buybacks, the company said.

Qualcomm’s new program appears to be a response to some of the company’s larger shareholders who have criticized its management. And it may very well be a step in the right direction. But as the company executes the buybacks, shareholders will want to ensure that they reap the full benefits of them. Stock buybacks may look appealing, but they are not all created equal.