public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jan Hubicka <hubicka@ucw.cz>
To: Bernd Schmidt <bschmidt@redhat.com>
Cc: Jan Hubicka <hubicka@ucw.cz>,
	Eric Botcazou <ebotcazou@adacore.com>,
	gcc-patches@gcc.gnu.org, Richard Biener <rguenther@suse.de>,
	law@redhat.com
Subject: Re: Do not use TYPE_CANONICAL in useless_type_conversion
Date: Mon, 05 Oct 2015 15:35:00 -0000	[thread overview]
Message-ID: <20151005153458.GB9972@kam.mff.cuni.cz> (raw)
In-Reply-To: <56126C73.4070205@redhat.com>

> >+  /* For aggregates compare only the size and mode.  Accesses to fields do have
> >+     a type information by themselves and thus we only care if we can i.e.
> >+     use the types in move operations.  */
> >    else if (AGGREGATE_TYPE_P (inner_type)
> >  	   && TREE_CODE (inner_type) == TREE_CODE (outer_type))
> >-    return false;
> >+    return (!TYPE_SIZE (outer_type)
> >+	    || (TYPE_SIZE (inner_type)
> >+		&& operand_equal_p (TYPE_SIZE (inner_type),
> >+				    TYPE_SIZE (outer_type), 0)));
> >+
> >+  else if (TREE_CODE (inner_type) == OFFSET_TYPE
> >+	   && TREE_CODE (inner_type) == TREE_CODE (outer_type))
> >+    return useless_type_conversion_p (TREE_TYPE (outer_type),
> >+				      TREE_TYPE (inner_type))
> >+	   && useless_type_conversion_p
> >+	        (TYPE_OFFSET_BASETYPE (outer_type),
> >+		 TYPE_OFFSET_BASETYPE (inner_type));
> >
> 
> The comment says the mode is compared, but I don't see that in the
> code. Which is right?
> 
> Also, wouldn't the final condition be clearer written as
> 
> > +  else if (TREE_CODE (inner_type) == OFFSET_TYPE
> > +	   && TREE_CODE (outer_type) == OFFSET_TYPE)

Updated in my local copy, thanks!

Honza
> 
> 
> Bernd

  reply	other threads:[~2015-10-05 15:35 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-30 22:11 Jan Hubicka
2015-10-01  8:33 ` Richard Biener
2015-10-01 17:51   ` Jan Hubicka
2015-10-02  7:45     ` Richard Biener
2015-10-02  6:43   ` Jan Hubicka
2015-10-02  7:56     ` Richard Biener
2015-10-02 16:02       ` Jan Hubicka
2015-10-02 18:00         ` Jan Hubicka
2015-10-02 21:16           ` Eric Botcazou
2015-10-02 21:41             ` Jan Hubicka
2015-10-02 21:52               ` Jan Hubicka
2015-10-05 12:54                 ` Bernd Schmidt
2015-10-05 15:35                   ` Jan Hubicka [this message]
2015-10-06 11:18                     ` Richard Biener
2015-10-06 17:54                       ` Jan Hubicka
2015-10-07  6:00                         ` Jan Hubicka
2015-10-07  8:52                           ` Richard Biener
2015-10-08  3:49                             ` Jan Hubicka
2015-10-08  7:48                               ` Richard Biener
2015-10-08 16:20                                 ` Jan Hubicka
2015-10-08 10:51                               ` Richard Biener
2015-10-08 20:30                                 ` Jan Hubicka
2015-10-08 23:24                                   ` Jan Hubicka
2015-10-09  8:19                                     ` Richard Biener
2015-10-09  8:29                                       ` Eric Botcazou
2015-10-09  7:36                                   ` Eric Botcazou
2015-10-09 17:55                                     ` Jan Hubicka
2015-10-13  8:09                                       ` Alexandre Oliva
2015-10-13  8:39                                         ` Richard Biener
2015-10-13  9:20                                         ` Eric Botcazou
2015-10-13 16:36                                           ` Alexandre Oliva
2015-10-14  4:34                                             ` Jan Hubicka
2015-10-14 20:15                                               ` Alexandre Oliva
2015-10-08 10:54                               ` Eric Botcazou
2015-10-08 16:03                                 ` Jan Hubicka
2015-10-08 16:10                                 ` Andreas Schwab
2015-10-08 23:05                                   ` Jan Hubicka
2015-10-09  9:18                                     ` Andreas Schwab
2015-10-09 18:34                                       ` Jan Hubicka
2015-10-16  6:45                                       ` Jan Hubicka
2015-10-16 15:08                                         ` Andreas Schwab
2015-10-01 14:11 ` Eric Botcazou
2015-10-01 14:28   ` Richard Biener
2015-10-01 14:39     ` Eric Botcazou
2015-10-01 17:44       ` Jan Hubicka
2015-10-02  7:43         ` Eric Botcazou
2015-10-02  8:00           ` Richard Biener
2015-10-02  8:37             ` Eric Botcazou
2015-10-02  7:39       ` Richard Biener
2015-10-02  7:48         ` Eric Botcazou
2015-10-02  8:03           ` Richard Biener
2015-10-02 11:30 Bernd Edlinger
2015-10-02 21:31 ` Eric Botcazou
2015-10-03 16:23   ` Bernd Edlinger
2015-10-03 21:31     ` Eric Botcazou

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=20151005153458.GB9972@kam.mff.cuni.cz \
    --to=hubicka@ucw.cz \
    --cc=bschmidt@redhat.com \
    --cc=ebotcazou@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=law@redhat.com \
    --cc=rguenther@suse.de \
    /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).