public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "fengwang at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/22290] Optimize Assigned GOTO to cause error with -O1 or higher
Date: Tue, 05 Jul 2005 08:39:00 -0000	[thread overview]
Message-ID: <20050705083927.19511.qmail@sourceware.org> (raw)
In-Reply-To: <20050704082324.22290.fengwang@gcc.gnu.org>


------- Additional Comments From fengwang at gcc dot gnu dot org  2005-07-05 08:39 -------
(In reply to comment #3)
> "int4 nz.0 = -2;"  look line an INIT_EXPR.  It should be 
>  
> "int4 nz.0; 
>  nz.0 = -2" 

Shall we add an assignment explicitly? Just give an initial value. I don't 
think we should defer doing this when generate function codes.

And another question, all the variables which have initial values are treat as 
static. Is this reasonable?

Back to this topic, in fact, the error is not caused by nz.0. It is used to 
judge if we assign a target label. And the output is "Assigned label is not in 
the list".  So it has passed the judgement of nz.0.

>From the trees dumped, I found the CCP pass is wrong:
$cat as.f.t22.ccp
;; Function MAIN__ (MAIN__)

Removing basic block 3
Merging blocks 2 and 4
Merging blocks 2 and 5
MAIN__ ()
{
  void * gotovar.2;
  void * nz.1;
  int4 nz.0 = -2;
  int4 nz;
  <unnamed type> D.476;
  logical4 D.475;

<bb 0>:
  nz.0_1 = -1;
  nz.1_2 = &__label_000093;
  D.475_3 = 0;
  D.476_4 = 0;
  if (D.476_4 != 0) goto <L0>; else goto <L1>;

<L0>:;
  _gfortran_runtime_error ("Assigned label is not a target label", "as.f", 2);

__label_000093:;      <<<<<<<<<<<<<<<<<<<< Wrong here.
<L1>:;
  _gfortran_runtime_error ("Assigned label is not in the list", "as.f", 2
  return;

}

Before this pass, it it correct.

-- 


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


  parent reply	other threads:[~2005-07-05  8:39 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-04  8:23 [Bug tree-optimization/22290] New: " fengwang at gcc dot gnu dot org
2005-07-04 10:00 ` [Bug fortran/22290] " pinskia at gcc dot gnu dot org
2005-07-04 12:38 ` fengwang at gcc dot gnu dot org
2005-07-04 15:28 ` steven at gcc dot gnu dot org
2005-07-05  8:39 ` fengwang at gcc dot gnu dot org [this message]
2005-07-05  8:44 ` fengwang at gcc dot gnu dot org
2005-07-06  7:42 ` fengwang at gcc dot gnu dot org
2005-07-07 22:16 ` tkoenig at gcc dot gnu dot org
2005-09-13 10:27 ` steven at gcc dot gnu dot org
2005-09-13 14:53 ` fengwang at gcc dot gnu dot org
     [not found] <bug-22290-10258@http.gcc.gnu.org/bugzilla/>
2005-10-25 13:44 ` cvs-commit at gcc dot gnu dot org
2005-10-25 14:06 ` cvs-commit at gcc dot gnu dot org
2005-10-25 14:09 ` fengwang at gcc dot gnu dot org
2005-10-25 15:02 ` pinskia at gcc dot gnu dot 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=20050705083927.19511.qmail@sourceware.org \
    --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).