[Bug sanitizer/91389] [7/8/9/10 Regression] error: control reaches end of non-void function with -fsanitize=thread since r219201

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Aug 8 08:27:00 GMT 2019


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Martin Liška from comment #4)
> (In reply to Jakub Jelinek from comment #3)
> > I see dead code everywhere in the function, they must have some weirdo macro
> > for cases that wraps everything in case something { ... } break;
> 
> Is the 'break;' really dead in such situation (when you don't have a return
> or another break within the {} block)?
> 
> > Many of those break; statements are dead code.

It is dead when you do have an unconditional return in there.  As I said in the
other PR, we try hard to do a good job with block_may_fallthru and
gimple_seq_may_fallthru, but it can't handle everything, feel free to improve
those.  And all -fsanitize=thread does is it adds a cleanup code, the same
thing as you get if you have an automatic variable with a destructor.

*** This bug has been marked as a duplicate of bug 86899 ***


More information about the Gcc-bugs mailing list