This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/66590] switch statement: incorrect warning "reaches end of non-void function"


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66590

Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-06-19
                 CC|                            |manu at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #2 from Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> ---
The gimple we build is very strange:

            switch (xD.2336) <default: <D.2342>, case 1: <D.2340>>
            {
              <D.2340>:
              {
                struct AD.2324 tmpD.2341;

                try
                  {
                    try
                      {
                        D.2345 = 1;
                        return D.2345;
                      }
                    finally
                      {
                        # USE = anything
                        # CLB = anything
                        __comp_dtor D.2329 (&tmpD.2341);
                      }
                  }
                finally
                  {
                    tmpD.2341 = {CLOBBER};
                  }
              }
              goto <D.2343>;
              <D.2342>:
              D.2345 = 0;
              return D.2345;
            }
            <D.2343>:
          }
        }

That goto doesn't make much sense.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]