In a private conversation, haiyan lin notified me of a potential bug in ivreg2. The same problem occurs in ivregress, so I will use the latter to demonstrate it.

In the following simplified example, I want to estimate a linear dynamic panel data model with 2 lags of the dependent variable instrumented by 2 lags of the first-differenced dependent variable.
(Using first differences as instruments is a standard procedure as part of a system GMM estimator in dynamic panel models, where it is assumed that the levels are correlated with the unobserved unit-specific effects, but the first differences are not.)
Code:
. webuse abdata, clear
. ivregress 2sls n (L.n L2.n = DL.n DL2.n)
note: LD.n dropped due to collinearity
equation not identified; must have at least as many instruments not in
the regression as there are instrumented variables
r(481);
As you can see, ivregress drops one of the instruments, reportedly due to collinearity. As a consequence, the model becomes underidentified and ivregress exits with error.

Yet, if you manually run the first-stage regressions, there is no evidence of any collinearity problem:
Code:
. regress L.n DL.n DL2.n

      Source |       SS           df       MS      Number of obs   =       611
-------------+----------------------------------   F(2, 608)       =      5.50
       Model |  19.4241409         2  9.71207047   Prob > F        =    0.0043
    Residual |  1074.20669       608  1.76678733   R-squared       =    0.0178
-------------+----------------------------------   Adj R-squared   =    0.0145
       Total |  1093.63084       610  1.79283744   Root MSE        =    1.3292

------------------------------------------------------------------------------
         L.n |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
           n |
         LD. |   .7793204   .4007435     1.94   0.052    -.0076892     1.56633
        L2D. |   .9261032   .4324795     2.14   0.033     .0767682    1.775438
             |
       _cons |   1.101659   .0575023    19.16   0.000     .9887318    1.214586
------------------------------------------------------------------------------

. regress L2.n DL.n DL2.n

      Source |       SS           df       MS      Number of obs   =       611
-------------+----------------------------------   F(2, 608)       =      2.29
       Model |  8.10427021         2  4.05213511   Prob > F        =    0.1018
    Residual |  1074.20669       608  1.76678733   R-squared       =    0.0075
-------------+----------------------------------   Adj R-squared   =    0.0042
       Total |  1082.31096       610  1.77428027   Root MSE        =    1.3292

------------------------------------------------------------------------------
        L2.n |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
           n |
         LD. |  -.2206796   .4007435    -0.55   0.582    -1.007689    .5663299
        L2D. |   .9261032   .4324795     2.14   0.033     .0767682    1.775438
             |
       _cons |   1.101659   .0575023    19.16   0.000     .9887318    1.214586
------------------------------------------------------------------------------
Also, if you estimate the same model with xtdpdgmm, there is no problem and all coefficients are identified:
Code:
. xtdpdgmm n L.n L2.n, iv(DL.n DL2.n)
note: standard errors may not be valid

Generalized method of moments estimation

Fitting full model:
Step 1         f(b) =  1.545e-27

Group variable: id                           Number of obs         =       751
Time variable: year                          Number of groups      =       140

Moment conditions:     linear =       3      Obs per group:    min =         5
                    nonlinear =       0                        avg =  5.364286
                        total =       3                        max =         7

------------------------------------------------------------------------------
           n |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
           n |
         L1. |    1.25092   .0366347    34.15   0.000     1.179117    1.322722
         L2. |  -.2253948    .050786    -4.44   0.000    -.3249334   -.1258561
             |
       _cons |  -.0743238   .0497764    -1.49   0.135    -.1718837    .0232362
------------------------------------------------------------------------------
Instruments corresponding to the linear moment conditions:
 1, model(level):
   LD.n L2D.n
 2, model(level):
   _cons
The reason why ivregress flags the instrument DL.n as collinear is the following:
There is a perfect linear relationship between the two (!) endogenous variables and the instruments: L.n - L2.n = DL.n.

However, I would argue that it should not be of concern that the instrument is collinear with a combination of endogenous regressors. There should only be a concern if there is collinearity among the instruments themselves (or among the regressors themselves), or if any single endogenous regressor is perfectly predicted by one or more of the instruments. The latter is not the case as we could see above in the first-stage regressions.

Hence, I would call this a bug in ivregress.

I am already in private conversation with KitBaum and Mark Schaffer about the same problem in ivreg2, but I want to invite others on Statalist to add your opinion to the discussion before I send an e-mail to StataCorp Tech Support.