public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jan Hubicka <hubicka@ucw.cz>
To: Richard Biener <richard.guenther@gmail.com>
Cc: "Jan Hubicka" <hubicka@ucw.cz>, "Jeff Law" <law@redhat.com>,
	"Martin Liška" <mliska@suse.cz>,
	"Marek Polacek" <polacek@redhat.com>,
	"GCC Patches" <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] Fix PR ipa/65318
Date: Fri, 06 Mar 2015 15:39:00 -0000	[thread overview]
Message-ID: <20150306153934.GC36862@kam.mff.cuni.cz> (raw)
In-Reply-To: <CAFiYyc1pxEsymWE-Dj4Oes=pROtnpOW2R_yy7UVHBs9FgctB2A@mail.gmail.com>

> 
> Yes - but I said that having an alias should have the same effect as
> the MEM_REF wrapping we do in LTO (to not barf on stmt verification
> if symbol merging merges an int and a float for example).

Yep, though alias is bit different from LTO - in LTO we replace the decl in place,
while alias still has its oriignal type only its constructor is not necessarily
cooperating. (We sort of do that with -fmerge-constants for CONST_DECL and in constant
pool vairables for ages)
> 
> >
> > Concerning callers handling mismatches, the VIEW_CONVERT_EXPR thing seems valid
> > thing to do for all uses except for fold_const_aggregate_ref_1. So perhaps
> > we can just inline rest of get_symbol_constant_value in there and document that
> > get_symbol_constant_value returns value in correct type.
> >
> > Or am I missing something obvious?
> 
> Yeah, that looks good.  Note that we can as well change all callers
> of get_symbol_constant_value to use fold_const_aggregate_ref, no?
> So reduce the number of APIs.

Yes, that seems like good idea.  As I recall, we used to have get_symbol_constant_value
first and introduced aggregate folding later.

Honza
> 
> Richard.
> 
> >
> > Thanks!
> > Honza
> >>
> >> >+              val = fold_unary (VIEW_CONVERT_EXPR, TREE_TYPE (sym), val);
> >> >+            }
> >> >+          return val;
> >> >+        }
> >> >       else
> >> >         return NULL_TREE;
> >> >     }
> >>

  reply	other threads:[~2015-03-06 15:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-05 13:54 Martin Liška
2015-03-05 14:29 ` Marek Polacek
2015-03-05 14:37   ` Martin Liška
2015-03-05 16:15     ` Jeff Law
2015-03-05 18:08       ` Jan Hubicka
2015-03-05 18:26         ` Richard Biener
2015-03-05 18:27         ` Richard Biener
2015-03-05 18:38           ` Jan Hubicka
2015-03-06 12:04             ` Richard Biener
2015-03-06 15:39               ` Jan Hubicka [this message]
2015-03-05 17:23     ` Jan Hubicka
2015-03-05 17:24       ` Jan Hubicka

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=20150306153934.GC36862@kam.mff.cuni.cz \
    --to=hubicka@ucw.cz \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=law@redhat.com \
    --cc=mliska@suse.cz \
    --cc=polacek@redhat.com \
    --cc=richard.guenther@gmail.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).