public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "msebor at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug bootstrap/95970] New: gcc/go/gofrontend/types.cc:1474:34: warning: ‘this’ pointer null
Date: Mon, 29 Jun 2020 16:00:47 +0000	[thread overview]
Message-ID: <bug-95970-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 95970
           Summary: gcc/go/gofrontend/types.cc:1474:34: warning: ‘this’
                    pointer null
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: bootstrap
          Assignee: unassigned at gcc dot gnu.org
          Reporter: msebor at gcc dot gnu.org
  Target Milestone: ---

Since r11-1697 Go bootstrap fails due to the following warning turned error:

In static member function ‘static Expression* Type::type_descriptor(Gogo*,
Type*)’,
    inlined from ‘virtual Expression* Named_type::do_type_descriptor(Gogo*,
Named_type*)’ at /ssd/test/src/gcc/trunk/gcc/go/gofrontend/types.cc:11114:53,
    inlined from ‘virtual Expression* Named_type::do_type_descriptor(Gogo*,
Named_type*)’ at /ssd/test/src/gcc/trunk/gcc/go/gofrontend/types.cc:11105:1:
/ssd/test/src/gcc/trunk/gcc/go/gofrontend/types.cc:1474:34: warning: ‘this’
pointer null [-Wnonnull]
 1474 |   return type->do_type_descriptor(gogo, NULL);


The warning, issued from tree-ssa-ccp.c, is triggered by the use of the null
pointer as the first argument in the following call for the IL below.

  _31 = OBJ_TYPE_REF(_30;(struct Type)0B->12) (0B, gogo_12(D), 0B);

Named_type::do_type_descriptor (struct Named_type * const this, struct Gogo *
gogo, struct Named_type * name)
{
  struct Expression * D.404029;
  struct Expression * ret;
  bool _1;
  bool _2;
  bool _3;
  struct Type * _4;
  struct Expression * _5;
  struct Named_type * iftmp.1259_6;
  struct Expression * _14;
  struct Expression * _17;
  struct Expression * _19;
  struct Expression * _20;
  struct Named_type * iftmp.1259_21;
  struct Named_type * iftmp.1259_22;
  struct Expression * _24;
  struct Expression * _25;
  struct Expression * _27;
  struct Expression * _28;
  int (*) () * _29;
  int (*) () _30;
  struct Expression * _31;

  <bb 2> :
  _1 = this_9(D)->is_error_;
  if (_1 != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  _27 = Expression::make_error (this_9(D)->location_);
  _28 = _27;
  goto <bb 13>; [INV]

  <bb 4> :
  if (name_10(D) == 0B)
    goto <bb 5>; [INV]
  else
    goto <bb 9>; [INV]

  <bb 5> :
  _2 = this_9(D)->is_alias_;
  if (_2 != 0)
    goto <bb 6>; [INV]
  else
    goto <bb 9>; [INV]

  <bb 6> :
  _3 = this_9(D)->seen_alias_;
  if (_3 != 0)
    goto <bb 7>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 7> :
  _19 = Expression::make_error (this_9(D)->location_);
  _20 = _19;
  goto <bb 13>; [INV]

  <bb 8> :
  this_9(D)->seen_alias_ = 1;
  _29 = MEM[(struct Type *)0B]._vptr.Type;
  _30 = MEM[(int (*) () *)_29 + 96B];
  _31 = OBJ_TYPE_REF(_30;(struct Type)0B->12) (0B, gogo_12(D), 0B);
  _33 = _31;
  _14 = _33;
  ret_15 = _14;
  this_9(D)->seen_alias_ = 0;
  _17 = ret_15;
  // predicted unlikely by early return (on trees) predictor.
  goto <bb 13>; [INV]

             reply	other threads:[~2020-06-29 16:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-29 16:00 msebor at gcc dot gnu.org [this message]
2020-06-29 16:49 ` [Bug bootstrap/95970] " jamborm at gcc dot gnu.org
2020-06-29 17:14 ` msebor at gcc dot gnu.org
2020-06-29 17:33 ` msebor at gcc dot gnu.org
2020-06-29 17:38 ` ian at airs dot com
2020-06-29 17:54 ` msebor at gcc dot gnu.org
2020-06-29 21:29 ` cvs-commit at gcc dot gnu.org
2020-06-29 21:34 ` ian at airs dot com

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-95970-4@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).