public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Janus Weil <janus@gcc.gnu.org>
To: Richard Guenther <richard.guenther@gmail.com>
Cc: Paul Richard Thomas <paul.richard.thomas@gmail.com>,
	gfortran <fortran@gcc.gnu.org>,
	 	gcc-patches <gcc-patches@gcc.gnu.org>,
	salvatore.filippone@uniroma2.it
Subject: Re: [Patch, Fortran] PR 41714: [OOP] ALLOCATE SOURCE= does not  	properly copy the value from SOURCE
Date: Mon, 26 Oct 2009 09:29:00 -0000	[thread overview]
Message-ID: <854832d40910260212l7f9afb0cja33111f7ff82c143@mail.gmail.com> (raw)
In-Reply-To: <854832d40910251538s7ffd6066rfd69cdaf833fd555@mail.gmail.com>

2009/10/25 Janus Weil <janus@gcc.gnu.org>:
> 2009/10/25 Richard Guenther <richard.guenther@gmail.com>:
>> On Sun, Oct 25, 2009 at 10:58 PM, Janus Weil <janus@gcc.gnu.org> wrote:
>>>>> So, what to do? Are we back to
>>>>>
>>>>> Index: gcc/fortran/trans.c
>>>>> ===================================================================
>>>>> --- gcc/fortran/trans.c (Revision 153538)
>>>>> +++ gcc/fortran/trans.c (Arbeitskopie)
>>>>> @@ -1282,7 +1282,11 @@ gfc_trans_code (gfc_code * code)
>>>>>      if (res != NULL_TREE && ! IS_EMPTY_STMT (res))
>>>>>       {
>>>>>         if (TREE_CODE (res) == STATEMENT_LIST)
>>>>> -           tree_annotate_all_with_location (&res, input_location);
>>>>> +           {
>>>>> +             tree_stmt_iterator i;
>>>>> +             for (i = tsi_start (res); !tsi_end_p (i); tsi_next (&i))
>>>>> +               SET_EXPR_LOCATION (tsi_stmt (i), input_location);
>>>>> +           }
>>>>>         else
>>>>>           SET_EXPR_LOCATION (res, input_location);
>>>>>
>>>>> or is there a better option? (One alternative could be to set the
>>>>> location only for OpenMP cases, since all other things seem to work?)
>>>>
>>>> I suggest to find out which expressions miss a proper location and fix
>>>> it where they are generated.
>>>
>>> Ok. What about using the above patchlet (or something similar) as an
>>> ad-hoc solution (for the sake of getting this PR fixed), and opening a
>>> new PR for the issue of setting correct input locations (which is in
>>> no way connected to the original intention of this PR)? I promise to
>>> have a look at the location issue myself (later) ...
>>
>> It should never happen to be a STATEMENT_LIST in the above hunk
>> (at least not resulting from foldings).  Thus, can you check just retaining
>> the original SET_EXPR_LOCATION (res, input_location)?
>
> Good point. That seems to work much better. Also removing the stuff in
> trans-openmp.c seems to work, which means one can indeed remove
> 'tree_annotate_all_with_location' completely, and with it
> 'tree_annotate_one_with_location' and 'tree_should_carry_location_p'.
>
> Will do a full boostrap + regtest of the attached patch, and probably
> commit tomorrow if successful.

Committed as r153547. Thanks for the reviews and the help with getting
that location stuff straight.

Cheers,
Janus

  reply	other threads:[~2009-10-26  9:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-25 11:49 Janus Weil
2009-10-25 15:11 ` Paul Richard Thomas
2009-10-25 15:13   ` Richard Guenther
2009-10-25 15:45     ` Richard Guenther
2009-10-25 18:05       ` Janus Weil
2009-10-25 19:00         ` Richard Guenther
2009-10-25 19:12           ` Janus Weil
2009-10-25 21:42             ` Janus Weil
2009-10-25 21:46               ` Janus Weil
2009-10-25 21:58                 ` Richard Guenther
2009-10-25 22:10                   ` Janus Weil
2009-10-25 22:28                     ` Richard Guenther
2009-10-25 23:12                       ` Janus Weil
2009-10-26  9:29                         ` Janus Weil [this message]
2009-10-26  9:31                         ` Janus Weil

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=854832d40910260212l7f9afb0cja33111f7ff82c143@mail.gmail.com \
    --to=janus@gcc.gnu.org \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=paul.richard.thomas@gmail.com \
    --cc=richard.guenther@gmail.com \
    --cc=salvatore.filippone@uniroma2.it \
    /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).