[Bug c++/35602] Bogus warning with -Wsign-conversion

manu at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sun Jun 8 15:37:00 GMT 2008



------- Comment #3 from manu at gcc dot gnu dot org  2008-06-08 15:36 -------
Confirmed.

The relevant gimple dump is:

int main(int, const char* const*) (D.2050, D.2051)
{
  struct stringD.2032[0] * retval.0D.2067;
  struct stringD.2032[0] * D.2055;
  struct stringD.2032[0] * D.2056;
  long intD.5 D.2057;
  struct stringD.2032 * D.2070;
  struct stringD.2032 * retval.1D.2071;
  struct stringD.2032 * D.2061;
  struct stringD.2032 * D.2062;
  long intD.5 D.2063;
  long intD.5 D.2072;
  long unsigned intD.7 D.2073;
  intD.2 D.2076;
  struct stringD.2032 * x.2D.2081;

  [/home/manuel/src/pr35602.C : 27] {
    struct stringD.2032 xD.2054[0][0];
    struct stringD.2032 yD.2060[0];
    intD.2 zD.2066[0][0];

    [/home/manuel/src/pr35602.C : 17] D.2055 = &xD.2054[0];
    [/home/manuel/src/pr35602.C : 17] D.2056 = D.2055;
    [/home/manuel/src/pr35602.C : 17] D.2057 = -1;
    [/home/manuel/src/pr35602.C : 17] try
      {

      }
    catch
      {
        [/home/manuel/src/pr35602.C : 17] {
          register struct stringD.2032 * D.2058;

          [/home/manuel/src/pr35602.C : 17] if (D.2055 != 0B)
            {
              [/home/manuel/src/pr35602.C : 17] D.2058 = &(*D.2055)[0];
              <D.2068>:;
              [/home/manuel/src/pr35602.C : 17] D.2070 = &(*D.2055)[0];
              [/home/manuel/src/pr35602.C : 17] if (D.2058 == D.2070)
                {
                  [/home/manuel/src/pr35602.C : 17] goto <D.2069>;
                }
              else
                {

                }
              [/home/manuel/src/pr35602.C : 17] D.2058 = D.2058 + -1;
              [/home/manuel/src/pr35602.C : 17] __comp_dtor  (D.2058);
              [/home/manuel/src/pr35602.C : 17] goto <D.2068>;
              <D.2069>:;
            }
          else
            {

            }
        }
      }
    [/home/manuel/src/pr35602.C : 17] retval.0D.2067 = D.2055;

However, the warning seems to be given by some bit_not_expr applied to long
int, whose result is implicitly converted to unsigned long. I don't know why
that is done at all.

Also, I can't see how to dump that code and check what is going on here.


-- 

manu at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-06-08 15:36:21
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35602



More information about the Gcc-bugs mailing list