public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Bootstrap failure on powerpc-apple-darwin8 with Ada
@ 2005-08-22 11:38 Richard Kenner
  0 siblings, 0 replies; 11+ messages in thread
From: Richard Kenner @ 2005-08-22 11:38 UTC (permalink / raw)
  To: rth; +Cc: gcc

    I disbelieve you can get this in C or C++.  The fragment above is a
    syntax error.  AFAIK, all of this is simple laziness in the Ada front
    end: generating &<constructor> is how things were done at the
    beginning of time, and it was easier to change this in the gimplifier
    than to modify the code that generated this directly.

Well, it's more that what this should get changed to is the address of a
temporary and the gimplifier already has code to make the temporaries
so why duplicate that code in Gigi?

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

* Re: Bootstrap failure on powerpc-apple-darwin8 with Ada
  2005-08-22  3:32             ` Daniel Berlin
@ 2005-08-22  4:27               ` Richard Henderson
  0 siblings, 0 replies; 11+ messages in thread
From: Richard Henderson @ 2005-08-22  4:27 UTC (permalink / raw)
  To: Daniel Berlin; +Cc: Laurent GUERBY, Chris Douty, gcc

On Sun, Aug 21, 2005 at 11:32:34PM -0400, Daniel Berlin wrote:
> See PR 23171.

Ok.

> If analyze_expr (or something) actually did that, i'd be a very happy
> man.
> It doesn't, unfortunately.
> Another perfectly reasonable solution would be to force us to not
> generate such crap in the first place.

One of these two solutions will be taken.  Since I've yet to look at
the PR, I can't comment on whether the second is difficult or impractical.


r~

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

* Re: Bootstrap failure on powerpc-apple-darwin8 with Ada
  2005-08-22  2:45           ` Richard Henderson
  2005-08-22  2:48             ` Andrew Pinski
@ 2005-08-22  3:32             ` Daniel Berlin
  2005-08-22  4:27               ` Richard Henderson
  1 sibling, 1 reply; 11+ messages in thread
From: Daniel Berlin @ 2005-08-22  3:32 UTC (permalink / raw)
  To: Richard Henderson; +Cc: Laurent GUERBY, Chris Douty, gcc

> And would that be because analyze_expr isn't implemented for Ada?

That doesn't bother me so much, actually (mainly because i don't care
about Ada). It's the fact that it's popping up in C/C++ that does.


> 
> > IE if we have something very funky like:
> > 
> > static int c;
> > static int d;
> > static struct foo *a = &{&c, &d};
> > 
> > (and if you look, andrew found a case where we are producing
> > &<constructor>, so this is a possibility, AFAICT)
> 
> I disbelieve you can get this in C or C++.

That's how this whole discussion popped up originally.

Andrew discovered an equivalent C/C++ testcase that produces
&<CONSTRUCTOR>.

See PR 23171.

Since C/C++'s analyze_expr (or whatever you want to produce that code)
doesn't produce the nice code below for that testcase, we get screwed.

>   The fragment above
> is a syntax error.  AFAIK, all of this is simple laziness in the
> Ada front end: generating &<constructor> is how things were done
> at the beginning of time, and it was easier to change this in the
> gimplifier than to modify the code that generated this directly.
> 
> > In the above case, we need to see the &c, &d part.
> > How does analyze_expr help us here?
> 
> By transforming to
> 
>   static struct foo tmp = { &c, &d };
>   static struct foo* a = &tmp;


By "gimplify static initializers", i actually meant produce the code
you've listed from whatever was generating &<constructor>.  Nothing
more. 

If analyze_expr (or something) actually did that, i'd be a very happy
man.
It doesn't, unfortunately.
Another perfectly reasonable solution would be to force us to not
generate such crap in the first place.


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

* Re: Bootstrap failure on powerpc-apple-darwin8 with Ada
  2005-08-22  2:45           ` Richard Henderson
@ 2005-08-22  2:48             ` Andrew Pinski
  2005-08-22  3:32             ` Daniel Berlin
  1 sibling, 0 replies; 11+ messages in thread
From: Andrew Pinski @ 2005-08-22  2:48 UTC (permalink / raw)
  To: Richard Henderson; +Cc: Daniel Berlin, Laurent GUERBY, Chris Douty, gcc

> Sure.  So far I don't see a problem though.
> 
> 
> > IE if we have something very funky like:
> > 
> > static int c;
> > static int d;
> > static struct foo *a = &{&c, &d};
> > 
> > (and if you look, andrew found a case where we are producing
> > &<constructor>, so this is a possibility, AFAICT)
> 
> I disbelieve you can get this in C or C++.  The fragment above
> is a syntax error.  AFAIK, all of this is simple laziness in the
> Ada front end: generating &<constructor> is how things were done
> at the beginning of time, and it was easier to change this in the
> gimplifier than to modify the code that generated this directly.

Actually we do get it for C++.  See PR 23171.

Thanks,
Andrew Pinski

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

* Re: Bootstrap failure on powerpc-apple-darwin8 with Ada
  2005-08-21  2:33         ` Daniel Berlin
@ 2005-08-22  2:45           ` Richard Henderson
  2005-08-22  2:48             ` Andrew Pinski
  2005-08-22  3:32             ` Daniel Berlin
  0 siblings, 2 replies; 11+ messages in thread
From: Richard Henderson @ 2005-08-22  2:45 UTC (permalink / raw)
  To: Daniel Berlin; +Cc: Laurent GUERBY, Chris Douty, gcc

On Sat, Aug 20, 2005 at 10:33:21PM -0400, Daniel Berlin wrote:
> > No.  How could that possibly be?
> >  We can't execute code for static
> > variable initializers, so how can we gimplify?
> What do you mean by this, exactly?

If you turn a static initializer into a code sequence, then it isn't a
static initializer.  By definition, it's now a dynamic initializer.

Which would be a *serious* code quality regression.

> Because analyze_expr doesn't give us any of the info we want.

And would that be because analyze_expr isn't implemented for Ada?

> The docs for analyze_expr says:
> 
>       This function is responsible for lowering tree nodes not
> understood by
>       generic code into understandable ones or alternatively marking
>       callgraph and varpool nodes referenced by the as needed.
> 
> It's the "alternatively" part that makes it useless.

Not likely in this case.  The variable has to exist in order to be
marked, and in this case the whole problem is that it doesn't exist.
The Ada front end would have to create the variable at minimum, and
the it's the matter of one pointer store to produce the GENERIC form
that you want.

> cxx_callgraph_analyze_expr, an implementation of this hook, simply marks
> a bunch of varpool nodes as "used" (and it doesn't even tell us which
> ones).
> 
> We don't care to know whether or not it should be marked used.
> We want to know what's actually in the trees on the initializer them so
> we can do analysis.

Sure.  So far I don't see a problem though.


> IE if we have something very funky like:
> 
> static int c;
> static int d;
> static struct foo *a = &{&c, &d};
> 
> (and if you look, andrew found a case where we are producing
> &<constructor>, so this is a possibility, AFAICT)

I disbelieve you can get this in C or C++.  The fragment above
is a syntax error.  AFAIK, all of this is simple laziness in the
Ada front end: generating &<constructor> is how things were done
at the beginning of time, and it was easier to change this in the
gimplifier than to modify the code that generated this directly.

> In the above case, we need to see the &c, &d part.
> How does analyze_expr help us here?

By transforming to

  static struct foo tmp = { &c, &d };
  static struct foo* a = &tmp;



r~

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

* Re: Bootstrap failure on powerpc-apple-darwin8 with Ada
  2005-08-21  2:16       ` Richard Henderson
@ 2005-08-21  2:33         ` Daniel Berlin
  2005-08-22  2:45           ` Richard Henderson
  0 siblings, 1 reply; 11+ messages in thread
From: Daniel Berlin @ 2005-08-21  2:33 UTC (permalink / raw)
  To: Richard Henderson; +Cc: Laurent GUERBY, Chris Douty, gcc

On Sat, 2005-08-20 at 19:15 -0700, Richard Henderson wrote:
> On Fri, Aug 19, 2005 at 09:34:35PM -0400, Daniel Berlin wrote:
> > But for general IPA working on the cgraph + GIMPLE level, as is what is
> > happening here, I think we really need to do something about static
> > variable initializers so they are in GIMPLE.
> 
> No.  How could that possibly be?
>  We can't execute code for static
> variable initializers, so how can we gimplify?
What do you mean by this, exactly?

> 
> > Or do you have another idea?
> 
> You didn't say why analyze_expr was wrong.  I still think it's right.

Because analyze_expr doesn't give us any of the info we want.

The call that was failing in our case was a get_base_var of an
ADDR_EXPR<CONSTRUCTOR> in a static variable initial, called from static
variable address taken analysis.

analyze_expr would not help here.

The docs for analyze_expr says:

      This function is responsible for lowering tree nodes not
understood by
      generic code into understandable ones or alternatively marking
      callgraph and varpool nodes referenced by the as needed.

It's the "alternatively" part that makes it useless.

cxx_callgraph_analyze_expr, an implementation of this hook, simply marks
a bunch of varpool nodes as "used" (and it doesn't even tell us which
ones).

We don't care to know whether or not it should be marked used.
We want to know what's actually in the trees on the initializer them so
we can do analysis.

IE if we have something very funky like:

static int c;
static int d;
static struct foo *a = &{&c, &d};

(and if you look, andrew found a case where we are producing
&<constructor>, so this is a possibility, AFAICT)

In the above case, we need to see the &c, &d part.
How does analyze_expr help us here?

> 
> r~


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

* Re: Bootstrap failure on powerpc-apple-darwin8 with Ada
  2005-08-20  1:34     ` Daniel Berlin
@ 2005-08-21  2:16       ` Richard Henderson
  2005-08-21  2:33         ` Daniel Berlin
  0 siblings, 1 reply; 11+ messages in thread
From: Richard Henderson @ 2005-08-21  2:16 UTC (permalink / raw)
  To: Daniel Berlin; +Cc: Laurent GUERBY, Chris Douty, gcc

On Fri, Aug 19, 2005 at 09:34:35PM -0400, Daniel Berlin wrote:
> But for general IPA working on the cgraph + GIMPLE level, as is what is
> happening here, I think we really need to do something about static
> variable initializers so they are in GIMPLE.

No.  How could that possibly be?  We can't execute code for static
variable initializers, so how can we gimplify?

> Or do you have another idea?

You didn't say why analyze_expr was wrong.  I still think it's right.


r~

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

* Re: Bootstrap failure on powerpc-apple-darwin8 with Ada
  2005-08-19 22:44   ` Laurent GUERBY
@ 2005-08-20  1:34     ` Daniel Berlin
  2005-08-21  2:16       ` Richard Henderson
  0 siblings, 1 reply; 11+ messages in thread
From: Daniel Berlin @ 2005-08-20  1:34 UTC (permalink / raw)
  To: Laurent GUERBY; +Cc: Chris Douty, gcc, Richard Henderson

On Sat, 2005-08-20 at 00:44 +0200, Laurent GUERBY wrote:
> On Sat, 2005-08-20 at 00:36 +0200, Laurent GUERBY wrote:
> > A patch by Andrew Pinski is there:
> > 
> > http://gcc.gnu.org/ml/gcc-patches/2005-07/msg01666.html
> > 
> > But review was negative, so it was not commited.
> > 
> > Hope this helps,
> > 
> > Laurent
> > 
> > PS: is there a PR for this one?
> 
> Thanks to Andrew Pinski for the tip:
> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22533

I actually believe Richard may have come up with the wrong idea (using
the analyze_expr hook) because Andrew didn't fully explain what is going
on.

What happens is that the IPA passes, not cgraph, want to analyze
variables, including statics.

If it was just cgraph, i would agree that modifying analyze_expr, is
probably the right solution.

But for general IPA working on the cgraph + GIMPLE level, as is what is
happening here, I think we really need to do something about static
variable initializers so they are in GIMPLE.

Richard, I assume you'd rather have us hack around this for stage3
somehow, and come up with a way to gimplify the static var constructors
for 4.2? (i guess that means creating a new init function and shoving
them in there, and marking it special somehow)
Or do you have another idea?

This is not a case we can just ignore the constructors, they contain
addressof operations we need to be able to see to come up with the right
answers for type escape analysis, static variable address taken, etc :(

--Dan


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

* Re: Bootstrap failure on powerpc-apple-darwin8 with Ada
  2005-08-19 22:37 ` Laurent GUERBY
@ 2005-08-19 22:44   ` Laurent GUERBY
  2005-08-20  1:34     ` Daniel Berlin
  0 siblings, 1 reply; 11+ messages in thread
From: Laurent GUERBY @ 2005-08-19 22:44 UTC (permalink / raw)
  To: Chris Douty; +Cc: gcc

On Sat, 2005-08-20 at 00:36 +0200, Laurent GUERBY wrote:
> A patch by Andrew Pinski is there:
> 
> http://gcc.gnu.org/ml/gcc-patches/2005-07/msg01666.html
> 
> But review was negative, so it was not commited.
> 
> Hope this helps,
> 
> Laurent
> 
> PS: is there a PR for this one?

Thanks to Andrew Pinski for the tip:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22533

Laurent


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

* Re: Bootstrap failure on powerpc-apple-darwin8 with Ada
  2005-08-19 22:17 Chris Douty
@ 2005-08-19 22:37 ` Laurent GUERBY
  2005-08-19 22:44   ` Laurent GUERBY
  0 siblings, 1 reply; 11+ messages in thread
From: Laurent GUERBY @ 2005-08-19 22:37 UTC (permalink / raw)
  To: Chris Douty; +Cc: gcc

A patch by Andrew Pinski is there:

http://gcc.gnu.org/ml/gcc-patches/2005-07/msg01666.html

But review was negative, so it was not commited.

Hope this helps,

Laurent

PS: is there a PR for this one?

On Fri, 2005-08-19 at 15:16 -0700, Chris Douty wrote:
> Howdy,
> 
> My last two attempts to build mainline on darwin8 have failed with a  
> bugbox in Ada.
> 
> +===========================GNAT BUG  
> DETECTED==============================+
> | 4.1.0 20050819 (experimental) (powerpc-apple-darwin8.3.0) GCC  
> error:     |
> | tree check: expected class expression, have  
> exceptional                  |
> |    (constructor) in get_base_var, at ipa-utils.c: 
> 224                     |
> | Error detected at a-except.adb: 
> 1411:4                                    |
> | Please submit a bug report; see http://gcc.gnu.org/ 
> bugs.html.            |
> | Use a subject line meaningful to you and us to track the  
> bug.            |
> | Include the entire contents of this bug box in the  
> report.               |
> | Include the exact gcc or gnatmake command that you  
> entered.              |
> | Also include sources listed below in gnatchop  
> format                     |
> | (concatenated together with no headers between  
> files).                   |
> +======================================================================= 
> ===+
> 
> Please include these source files with error report
> Note that list may not be accurate in some cases,
> so please double check that the problem can still
> be reproduced with the set of files listed.
> 
> 
> 
> raised TYPES.UNRECOVERABLE_ERROR : comperr.adb:380
> make[2]: *** [ada/a-except.o] Error 1
> make[1]: *** [stage2_build] Error 2
> make: *** [bootstrap] Error 2
> 
> 
> Previously I got this:
> 
> +===========================GNAT BUG  
> DETECTED==============================+
> | 4.1.0 20050817 (experimental) (powerpc-apple-darwin8.3.0) Bus  
> error      |
> | Error detected at a-except.adb: 
> 1411:4                                    |
> | Please submit a bug report; see http://gcc.gnu.org/ 
> bugs.html.            |
> | Use a subject line meaningful to you and us to track the  
> bug.            |
> | Include the entire contents of this bug box in the  
> report.               |
> | Include the exact gcc or gnatmake command that you  
> entered.              |
> | Also include sources listed below in gnatchop  
> format                     |
> | (concatenated together with no headers between  
> files).                   |
> +======================================================================= 
> ===+
> 
> Please include these source files with error report
> Note that list may not be accurate in some cases,
> so please double check that the problem can still
> be reproduced with the set of files listed.
> 
> 
> 
> raised TYPES.UNRECOVERABLE_ERROR : comperr.adb:380
> make[2]: *** [ada/a-except.o] Error 1
> make[1]: *** [stage2_build] Error 2
> make: *** [bootstrap] Error 2
> 
> 
> Clearly the same error, but different message.
> 
> I am bootstrapping with gcc 4.0.0.  This is the configure line:
> /Volumes/Playland/projects/gnu/gcc-stuff/gcc-HEAD/configure --prefix=/ 
> opt/gcc410 --enable-shared \
>   --with-mpfr=/opt/local --with-gmp=/opt/local --enable- 
> languages=c,ada,c++,f95,objc
> 
> Thanks,
>      Chris
> 

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

* Bootstrap failure on powerpc-apple-darwin8 with Ada
@ 2005-08-19 22:17 Chris Douty
  2005-08-19 22:37 ` Laurent GUERBY
  0 siblings, 1 reply; 11+ messages in thread
From: Chris Douty @ 2005-08-19 22:17 UTC (permalink / raw)
  To: gcc

Howdy,

My last two attempts to build mainline on darwin8 have failed with a  
bugbox in Ada.

+===========================GNAT BUG  
DETECTED==============================+
| 4.1.0 20050819 (experimental) (powerpc-apple-darwin8.3.0) GCC  
error:     |
| tree check: expected class expression, have  
exceptional                  |
|    (constructor) in get_base_var, at ipa-utils.c: 
224                     |
| Error detected at a-except.adb: 
1411:4                                    |
| Please submit a bug report; see http://gcc.gnu.org/ 
bugs.html.            |
| Use a subject line meaningful to you and us to track the  
bug.            |
| Include the entire contents of this bug box in the  
report.               |
| Include the exact gcc or gnatmake command that you  
entered.              |
| Also include sources listed below in gnatchop  
format                     |
| (concatenated together with no headers between  
files).                   |
+======================================================================= 
===+

Please include these source files with error report
Note that list may not be accurate in some cases,
so please double check that the problem can still
be reproduced with the set of files listed.



raised TYPES.UNRECOVERABLE_ERROR : comperr.adb:380
make[2]: *** [ada/a-except.o] Error 1
make[1]: *** [stage2_build] Error 2
make: *** [bootstrap] Error 2


Previously I got this:

+===========================GNAT BUG  
DETECTED==============================+
| 4.1.0 20050817 (experimental) (powerpc-apple-darwin8.3.0) Bus  
error      |
| Error detected at a-except.adb: 
1411:4                                    |
| Please submit a bug report; see http://gcc.gnu.org/ 
bugs.html.            |
| Use a subject line meaningful to you and us to track the  
bug.            |
| Include the entire contents of this bug box in the  
report.               |
| Include the exact gcc or gnatmake command that you  
entered.              |
| Also include sources listed below in gnatchop  
format                     |
| (concatenated together with no headers between  
files).                   |
+======================================================================= 
===+

Please include these source files with error report
Note that list may not be accurate in some cases,
so please double check that the problem can still
be reproduced with the set of files listed.



raised TYPES.UNRECOVERABLE_ERROR : comperr.adb:380
make[2]: *** [ada/a-except.o] Error 1
make[1]: *** [stage2_build] Error 2
make: *** [bootstrap] Error 2


Clearly the same error, but different message.

I am bootstrapping with gcc 4.0.0.  This is the configure line:
/Volumes/Playland/projects/gnu/gcc-stuff/gcc-HEAD/configure --prefix=/ 
opt/gcc410 --enable-shared \
  --with-mpfr=/opt/local --with-gmp=/opt/local --enable- 
languages=c,ada,c++,f95,objc

Thanks,
     Chris

-- 
Christopher Douty <Chris_Douty@ampexdata.com> +1-650-367-3129
Senior Engineer, Software & Systems  - AMPEX Data Systems Corp.


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

end of thread, other threads:[~2005-08-22 11:38 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-22 11:38 Bootstrap failure on powerpc-apple-darwin8 with Ada Richard Kenner
  -- strict thread matches above, loose matches on Subject: below --
2005-08-19 22:17 Chris Douty
2005-08-19 22:37 ` Laurent GUERBY
2005-08-19 22:44   ` Laurent GUERBY
2005-08-20  1:34     ` Daniel Berlin
2005-08-21  2:16       ` Richard Henderson
2005-08-21  2:33         ` Daniel Berlin
2005-08-22  2:45           ` Richard Henderson
2005-08-22  2:48             ` Andrew Pinski
2005-08-22  3:32             ` Daniel Berlin
2005-08-22  4:27               ` Richard Henderson

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