public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Aldy Hernandez <aldyh@redhat.com>
To: "Joseph S. Myers" <joseph@codesourcery.com>
Cc: "Iyer, Balaji V" <balaji.v.iyer@intel.com>,
	       gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [patch] cilkplus array notation for C (clean, independent patchset, take 1)
Date: Thu, 21 Mar 2013 14:25:00 -0000	[thread overview]
Message-ID: <514B1830.5040107@redhat.com> (raw)
In-Reply-To: <5149D62F.9070503@redhat.com>


> I have found some little nits that I will point out in a reply to this
> message.

Balaji, in Joseph's last review he mentioned:

> In find_rank you have error ("Rank Mismatch!"); - this is not a properly
> formatted error message according to the GNU Coding standards (which
> typically would not have any uppercase).  I'd also suggest that when you
> find a rank, you store (through a location_t * pointer) the location of
> the first expression found with that rank, so if you then find a
> mismatching rank you can use error_at to point to that rank and then
> inform to point to the previous rank it didn't match.

I see you have dispensed with the rank mismatch error altogether.  Was 
this on purpose?  For example, you now have:

>       for (ii_tree = array;
> 	   ii_tree && TREE_CODE (ii_tree) == ARRAY_NOTATION_REF;
> 	   ii_tree = ARRAY_NOTATION_ARRAY (ii_tree))
> 	current_rank++;
>       if (*rank == 0)
> 	*rank = current_rank;

Which is basically failing to set *rank when it's already set (with no 
error).  Is this on purpose?  If so, can you explain?

If it's on purpose, document it in the comment at the top of the 
function.  And then, why don't you exit the function immediately upon 
entry if *rank is non-zero?  It's a waste of time to do the rest of the 
analysis if you're just going to throw it away.

Furthermore, Joseph suggested you store the location of the initial rank 
so you can give a meaningful error message later and tell the user where 
the mismatch is occurring and where the original rank occurred.

Aldy

  parent reply	other threads:[~2013-03-21 14:25 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-20 15:32 Aldy Hernandez
2013-03-20 16:33 ` Aldy Hernandez
2013-03-20 22:28   ` Iyer, Balaji V
2013-03-21 12:55     ` Aldy Hernandez
2013-03-21  5:31   ` Jeff Law
2013-03-21  6:09     ` Jakub Jelinek
2013-03-21 13:01       ` Aldy Hernandez
2013-03-21 13:06         ` Iyer, Balaji V
2013-03-21 13:09           ` Aldy Hernandez
2013-03-21 13:15             ` Iyer, Balaji V
2013-03-21 16:54       ` Mike Stump
2013-03-21 23:34         ` Aldy Hernandez
2013-03-22 22:36           ` Mike Stump
2013-03-23  1:36             ` Iyer, Balaji V
2013-03-23  5:00               ` Mike Stump
2013-03-20 22:00 ` [cilkplus-merge] test for side effects Aldy Hernandez
2013-03-21 14:25 ` Aldy Hernandez [this message]
2013-03-21 19:08   ` [patch] cilkplus array notation for C (clean, independent patchset, take 1) Iyer, Balaji V
2013-03-21 23:30     ` Aldy Hernandez
2013-03-21 15:56 ` Joseph S. Myers
2013-03-22 22:04   ` Iyer, Balaji V
2013-03-25 16:45     ` Aldy Hernandez
2013-03-25 21:39       ` Iyer, Balaji V
2013-03-25 21:49         ` Aldy Hernandez
2013-03-26 17:05       ` Joseph S. Myers
2013-03-26 21:11         ` Iyer, Balaji V
2013-03-26 16:27     ` Joseph S. Myers
2013-03-21 16:48 ` Joseph S. Myers

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=514B1830.5040107@redhat.com \
    --to=aldyh@redhat.com \
    --cc=balaji.v.iyer@intel.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=joseph@codesourcery.com \
    /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).