public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* IMA vs tree-ssa
@ 2004-02-26 22:49 Dale Johannesen
  2004-02-26 22:52 ` law
  2004-02-26 23:20 ` Richard Henderson
  0 siblings, 2 replies; 53+ messages in thread
From: Dale Johannesen @ 2004-02-26 22:49 UTC (permalink / raw)
  To: GCC List

.When compiling intermodule (IMA), objects that are defined in multiple
files have their types unified so that all copies of the object refer 
to the
same TYPE_DECL.  This is not done for objects local to a function,
which has the effect that the same type can have multiple TYPE_DECL
nodes used for it, even within the same function.  The example at  the
end demonstrates; compile with IMA, and the first assignment statement
winds up referring to different nodes for struct rtx_def on the two 
sides.
(This causes no problem in this particular example.)

There are several places where tree-ssa does type comparison by
comparing TYPE_MAIN_VARIANT() for equality.  This doesn't work with
IMA, and leads to several different ICEs in various SPECmarks (you
can probably figure out which one the example came from :)

Has anyone else run into this, and thought about fixing it?

My first thought was that this should be fixed by having IMA unify all
copies of the type.  But looking at the code, I don't think this would 
be easy
to get right, and Geoff, the author of IMA, doesn't like it:

> I don't think that would work:
>
> - You'd need to be sure it doesn't change language semantics
> - You'd need to make debugging information correct
> - I'd like to get rid of this final 'merging' pass; it's slow, it 
> doesn't work with -fno-unit-at-a-time, and now that we've thrown out 
> the GCC-specific features that required it, it's not necessary.
>
> I would ask why code in tree-ssa seems to need to compare types.  
> Maybe it needs a language-independent comptypes() that looks at things 
> like field sizes and offsets.  Maybe the language frontend, should be 
> responsible for casting types so that the middle-end doesn't need to 
> be concerned by any of this.

Now I'm thinking along these lines:  make a langhook that calls 
comptypes() for C-based languages,
and devolves to x==y for the others (or calls the comptype-equivalent 
if there is one; I know nothing
about those language FEs).  That will not make the non-C languages any 
worse, and since IMA isn't
implemented for them, there isn't currently a problem there.  Whoever 
implements it for those languages
will need to provide a comptypes() equivalent.

Comments?

/**  s1.c  */
#include "s1.h"
extern rtx recog_operand;

/** s1.h **/
typedef struct rtx_def { int a; int b; } *rtx;
extern rtx recog_operand;

/** s2.c  */
rtx recog_operand;
int foo() {
   rtx *r0, t1;
   r0 = &recog_operand;
   t1 = *r0;
   return t1->a;
}

^ permalink raw reply	[flat|nested] 53+ messages in thread

end of thread, other threads:[~2004-04-03  1:17 UTC | newest]

Thread overview: 53+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-26 22:49 IMA vs tree-ssa Dale Johannesen
2004-02-26 22:52 ` law
2004-02-26 23:12   ` Dale Johannesen
2004-02-26 23:20     ` Richard Henderson
2004-02-26 23:34     ` law
2004-02-26 23:47       ` Dale Johannesen
2004-02-26 23:57         ` law
2004-02-27  0:21           ` Dale Johannesen
2004-02-27  1:05             ` law
2004-02-27  7:26               ` Dale Johannesen
2004-02-27 18:44                 ` Dale Johannesen
2004-03-04 18:38                   ` Dale Johannesen
2004-03-08 22:32                     ` Mark Mitchell
2004-03-08 22:46                       ` Dale Johannesen
2004-03-08 22:49                         ` Mark Mitchell
2004-02-27  8:28             ` Richard Henderson
2004-02-26 23:20 ` Richard Henderson
2004-02-26 23:26   ` Dale Johannesen
2004-02-26 23:50   ` Geoff Keating
2004-02-27  9:08     ` Richard Henderson
2004-02-27 22:00     ` Neil Booth
2004-02-27 22:04       ` Geoff Keating
2004-02-27 22:08         ` Neil Booth
2004-03-08 22:29           ` Mark Mitchell
2004-03-08 23:07             ` Gabriel Dos Reis
2004-03-08 23:32               ` Joe Buck
2004-03-09  0:07                 ` Dale Johannesen
2004-03-09  0:17                   ` Joseph S. Myers
2004-03-09  0:34                   ` Mark Mitchell
2004-03-09  0:49                     ` Joseph S. Myers
2004-03-09  0:54                       ` Joe Buck
2004-03-09  1:37                       ` Mark Mitchell
2004-03-09  2:43                         ` Gabriel Dos Reis
2004-03-09  2:53                           ` Paul Jarc
2004-03-09  3:09                             ` Gabriel Dos Reis
2004-03-09  3:15                               ` Paul Jarc
2004-03-09  3:22                                 ` Gabriel Dos Reis
2004-03-09  9:39                         ` Joseph S. Myers
2004-03-09  9:59                           ` Mark Mitchell
2004-03-09 10:41                             ` Joseph S. Myers
2004-03-09 11:14                               ` Mark Mitchell
2004-03-09 11:54                                 ` Joseph S. Myers
2004-03-09 17:26                                   ` Mark Mitchell
2004-03-09 17:37                                     ` Joseph S. Myers
2004-03-09 17:46                                       ` Mark Mitchell
2004-03-09 14:00                               ` Gabriel Dos Reis
2004-03-09 21:17                               ` Matthias Benkmann
2004-04-02  0:35                   ` Geoff Keating
2004-04-02  0:53                     ` Dale Johannesen
2004-04-02 18:18                       ` Geoff Keating
2004-04-02 19:41                         ` Dale Johannesen
2004-04-03  1:17                           ` Geoff Keating
2004-03-08 23:43               ` Mark Mitchell

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).