public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/66590] switch statement: incorrect warning "reaches end of non-void function"
Date: Tue, 10 Aug 2021 00:53:18 +0000	[thread overview]
Message-ID: <bug-66590-4-sLmB8iz7Sd@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-66590-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This is what we have now:

;; Function f (_Z1fi, funcdef_no=0, decl_uid=2362, cgraph_uid=1,
symbol_order=0)

Removing basic block 6
Removing basic block 8
Merging blocks 3 and 4
Removing basic block 11
Merging blocks 12 and 14
Merging blocks 3 and 5
;; 1 loops found
;;
;; Loop 0
;;  header 0, latch 1
;;  depth 0, outer -1
;;  nodes: 0 1 2 3 4 5 6 7 8 9
;; 2 succs { 4 3 }
;; 3 succs { 5 }
;; 4 succs { 5 }
;; 5 succs { 8 6 }
;; 6 succs { 7 }
;; 7 succs { 1 }
;; 8 succs { 9 }
;; 9 succs { 1 }
int f (int x)
{
  int finally_tmp.0;
  struct A tmp;
  struct A a;
  int D.2384;

  <bb 2> :
  if (x == 1)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
<L0>:
  D.2384 = 1;
  A::~A (&tmp);
  tmp = {CLOBBER};
  finally_tmp.0 = 0;
  goto <bb 5>; [INV]

  <bb 4> :
<L3>:
  D.2384 = 0;
  finally_tmp.0 = 0;

  <bb 5> :
  A::~A (&a);
  if (finally_tmp.0 == 1)
    goto <bb 6>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 6> :
<L6>:

  <bb 7> :
  a = {CLOBBER};
  return;

  <bb 8> :
  a = {CLOBBER};

  <bb 9> :
<L11>:
  return D.2384;

}


Looks like there was a case where we thought finally_tmp.0 could be equal to 1.
 Note this is all internal.

  parent reply	other threads:[~2021-08-10  0:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-18 18:29 [Bug c++/66590] New: " brutus at free dot fr
2015-06-19  0:24 ` [Bug c++/66590] " pinskia at gcc dot gnu.org
2015-06-19  7:47 ` manu at gcc dot gnu.org
2015-09-23 18:06 ` miyuki at gcc dot gnu.org
2021-08-10  0:53 ` pinskia at gcc dot gnu.org [this message]
2021-08-10  1:00 ` pinskia at gcc dot gnu.org
2021-08-10  1:04 ` pinskia at gcc dot gnu.org
2021-08-10  1:31 ` pinskia at gcc dot gnu.org
2021-08-25 21:28 ` cvs-commit at gcc dot gnu.org
2021-08-25 21:29 ` pinskia at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-66590-4-sLmB8iz7Sd@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).