public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: PA specifies invalid T_ADAFLAGS
@ 2002-04-25 19:37 Robert Dewar
  2002-04-25 19:55 ` John David Anglin
  0 siblings, 1 reply; 45+ messages in thread
From: Robert Dewar @ 2002-04-25 19:37 UTC (permalink / raw)
  To: charlet, rth; +Cc: dave, gcc, kenner

Our view from when we looked at this is that there is nothing wrong with
GCC or GNAT here, it is just that the assumptions that GNAT makes about
virtual addressing require this switch to be turned off. The hardware spec
seems clear to me.

^ permalink raw reply	[flat|nested] 45+ messages in thread
* Re: PA specifies invalid T_ADAFLAGS
@ 2002-04-26 16:14 Robert Dewar
  0 siblings, 0 replies; 45+ messages in thread
From: Robert Dewar @ 2002-04-26 16:14 UTC (permalink / raw)
  To: dave, law; +Cc: gcc, willy

> No.  The semantics of Ada don't play well with the funky implicit space 
> register
> selection done on PAs.  -mdisable-indexing is really needed for Ada.

I think this is misleading, this has nothing to do with the semantics of
Ada. it has to do with implementation dependent code whose meaning is
not guaranteed by the standard, but which works fine on all architectures
we know of, except for HPUX without this switch. This switch is needed for
the GNAT front end, but not for Ada apps in general.

^ permalink raw reply	[flat|nested] 45+ messages in thread
[parent not found: <10204260954.AA16645@vlsi1.ultra.nyu.edu>]
* Re: PA specifies invalid T_ADAFLAGS
@ 2002-04-26  4:06 Richard Kenner
  0 siblings, 0 replies; 45+ messages in thread
From: Richard Kenner @ 2002-04-26  4:06 UTC (permalink / raw)
  To: dave; +Cc: gcc

    I was wondering whether on hpux-like hosts whether the gnat driver
    should automatically be run with "-mdisable-indexing" (ie., whether
    it needs a SPEC define).

No, because it's only needed when compiling GNAT.  Also, it's a *host*
option, not a target option.

^ permalink raw reply	[flat|nested] 45+ messages in thread
* Re: PA specifies invalid T_ADAFLAGS
@ 2002-04-25 22:55 Matthew Wilcox
  0 siblings, 0 replies; 45+ messages in thread
From: Matthew Wilcox @ 2002-04-25 22:55 UTC (permalink / raw)
  To: kenner; +Cc: gcc


You wrote (removing me from the cc, so i can't quote you properly):

Again, the -mdisable-indexing was not working around a *bug* but a 
fundamental problem in the PA architecture preventing virtual origins
from working if they are used.

Unless *all 8* SR's are set to consecutive memory segments, it isn't safe
to use the indexing forms.

-- end quote --

I think you're slightly confused.  Unless you modify the gcc backend,
it's just not possible to output instructions which use sr0-3.  And sr4-7
have to be set to identical, not consective values.  The top two bits
of the address which select which of sr4-7 to use are left intact and
form part of the virtual address.

-- 
Revolutions do not require corporate support.

^ permalink raw reply	[flat|nested] 45+ messages in thread
* Re: PA specifies invalid T_ADAFLAGS
@ 2002-04-25 21:14 Robert Dewar
  0 siblings, 0 replies; 45+ messages in thread
From: Robert Dewar @ 2002-04-25 21:14 UTC (permalink / raw)
  To: dave, dewar; +Cc: gcc, hainque

<I was wondering whether on hpux-like hosts whether the gnat driver
should automatically be run with "-mdisable-indexing" (ie., whether
it needs a SPEC define).
>

This is only needed for the compiler (or for any other program playing
similar virtual indexing games, which are not really well defined official
Ada :-)

^ permalink raw reply	[flat|nested] 45+ messages in thread
* Re: PA specifies invalid T_ADAFLAGS
@ 2002-04-25 20:52 Robert Dewar
  2002-04-25 21:53 ` John David Anglin
  0 siblings, 1 reply; 45+ messages in thread
From: Robert Dewar @ 2002-04-25 20:52 UTC (permalink / raw)
  To: dave, dewar; +Cc: charlet, gcc, kenner, rth

Yes, -mdisable-indexing should most definitely be used in the C code as well

^ permalink raw reply	[flat|nested] 45+ messages in thread
* Re: PA specifies invalid T_ADAFLAGS
@ 2002-04-25 19:58 Robert Dewar
  2002-04-25 20:51 ` John David Anglin
  0 siblings, 1 reply; 45+ messages in thread
From: Robert Dewar @ 2002-04-25 19:58 UTC (permalink / raw)
  To: dave, hainque; +Cc: gcc

>>The example is not legal C

We definitely agree that the example is not legal C. However it will
in practice work on all common architectures *except* HP without the
switch. 

The gain in using virtual origins in the GNAT compiler is quite
considerable, so it is well worth taking advantage of this. Note that
it is only the compiler itself that is affected (unless some GNAT user
plays the same trick :-)

^ permalink raw reply	[flat|nested] 45+ messages in thread
* Re: PA specifies invalid T_ADAFLAGS
@ 2002-04-25 19:45 Robert Dewar
  0 siblings, 0 replies; 45+ messages in thread
From: Robert Dewar @ 2002-04-25 19:45 UTC (permalink / raw)
  To: hainque, matzmich; +Cc: dave, gcc

<<If the assembler code you showed was created by compiling the C snippet,
this indicates nothing, because this wasn't C (accessing data through vb[]
is undefined).  So, that it there SEGV's is no error, as the compiler
might apply any transformations it wants.  You need to provide an actual
Ada testcase which shows this.
>>

Right, of course this is formally undefined in C, which is why for completely
valid C code, you don't need the switch. 

Whether it is formally undefined in Ada is an interesting issue. I would
say it is in the implementation defined category.

The point is that code like this will work on virtually (:-) all architectures
but on HPUX, works only if the switch is there. I think the snippet here
should indicate the problem clearly enough. If you need Ada code, imagine
the C being transformed 1-1 into Ada at exactly the same level of abstrction.

^ permalink raw reply	[flat|nested] 45+ messages in thread
* Re: PA specifies invalid T_ADAFLAGS
@ 2002-04-25  5:35 Richard Kenner
  2002-04-26 10:54 ` law
  0 siblings, 1 reply; 45+ messages in thread
From: Richard Kenner @ 2002-04-25  5:35 UTC (permalink / raw)
  To: dave; +Cc: gcc

Again, the -mdisable-indexing was not working around a *bug* but a 
fundamental problem in the PA architecture preventing virtual origins
from working if they are used.

Unless *all 8* SR's are set to consecutive memory segments, it isn't safe
to use the indexing forms.

^ permalink raw reply	[flat|nested] 45+ messages in thread
* Re: PA specifies invalid T_ADAFLAGS
@ 2002-04-25  3:37 Richard Kenner
  0 siblings, 0 replies; 45+ messages in thread
From: Richard Kenner @ 2002-04-25  3:37 UTC (permalink / raw)
  To: dave; +Cc: gcc

The issue is that the data symbol might be in sr4, say, but when the
virtual origin is computed, it ends up in sr3.

^ permalink raw reply	[flat|nested] 45+ messages in thread
* Re: PA specifies invalid T_ADAFLAGS
@ 2002-04-24 22:08 Robert Dewar
  0 siblings, 0 replies; 45+ messages in thread
From: Robert Dewar @ 2002-04-24 22:08 UTC (permalink / raw)
  To: dave, willy; +Cc: dewar, gcc

> Your comments that the base register can end up in the wrong segment
> still suggests a bug to me.  I can't imagine the linker working with
> anything other than the standard runtime.  As I said, a fix was done
> regarding which register becomes the base register.  There were
> problems in the past with the index being selected as the base register
> and that didn't work with the segmented architecture of the PA.

OK, well indeed that might be correct. This always *sounded* like a bug
to me :-)

^ permalink raw reply	[flat|nested] 45+ messages in thread
* Re: PA specifies invalid T_ADAFLAGS
@ 2002-04-24 21:27 Robert Dewar
  0 siblings, 0 replies; 45+ messages in thread
From: Robert Dewar @ 2002-04-24 21:27 UTC (permalink / raw)
  To: dewar, willy; +Cc: dave, gcc

> I think there's a misunderstanding.  If GNAT simply uses standard
> addresses from 0 to 2^32-1 there is no problem.  If GNAT tries to take
> advantage of PA's space register facilities to address more than 4GB
> simultaneously, then it simply won't work under PA Linux.

ok, well then you are saying that virtual indexing should always
work on Linux, unlike HPUX, and it sounds like you are right :-)

^ permalink raw reply	[flat|nested] 45+ messages in thread
* Re: PA specifies invalid T_ADAFLAGS
@ 2002-04-24 20:37 Robert Dewar
  2002-04-24 20:44 ` Matthew Wilcox
  2002-04-24 21:44 ` John David Anglin
  0 siblings, 2 replies; 45+ messages in thread
From: Robert Dewar @ 2002-04-24 20:37 UTC (permalink / raw)
  To: dewar, willy; +Cc: dave, gcc

I see nothing in GNAT's use of virtual indexing that would guarantee
avoidance of sr 1, 2 or 3 in the base address (i.e. the address BEFORE
indexing). Perhaps you are right, but it would take careful analysis.

^ permalink raw reply	[flat|nested] 45+ messages in thread
* Re: PA specifies invalid T_ADAFLAGS
@ 2002-04-24 20:09 Robert Dewar
  0 siblings, 0 replies; 45+ messages in thread
From: Robert Dewar @ 2002-04-24 20:09 UTC (permalink / raw)
  To: charlet, dave; +Cc: gcc, willy


> Is this a bug in the PA backend?  Without fixing the problem, it will not
> be possible to correctly build GNAT under hppa-linux, except by starting
> with a working hpux port.  It's been some time since I tried it but
> starting from the last binary release for hpux was very difficult because
> there are major problems building the current source with 2.8.1x.

No, it is not a bug in the PA backend, it is just that the segmentation
in HPPA works on the base address before indexing. This means that if you
use virtual indexing (an important part of the data structure approach
used by GNAT), then the virual origin can be in the "wrong" segment.

^ permalink raw reply	[flat|nested] 45+ messages in thread
* Re: PA specifies invalid T_ADAFLAGS
@ 2002-04-24 20:06 Robert Dewar
  2002-04-24 20:26 ` Matthew Wilcox
  0 siblings, 1 reply; 45+ messages in thread
From: Robert Dewar @ 2002-04-24 20:06 UTC (permalink / raw)
  To: dave, gcc; +Cc: willy

> I suspect using "-mdisable-indexing" dates from a time when indexing
> didn't work very well.  This was reworked a year or two ago.

No, this is definitely needed for Ada, due to its use of virtual array
indexing, which otherwise fails on the PA, due to its odd segmentation
semantics.

^ permalink raw reply	[flat|nested] 45+ messages in thread
* Re: PA specifies invalid T_ADAFLAGS
@ 2002-04-24 19:59 Richard Kenner
  2002-04-24 22:07 ` John David Anglin
  0 siblings, 1 reply; 45+ messages in thread
From: Richard Kenner @ 2002-04-24 19:59 UTC (permalink / raw)
  To: dave; +Cc: gcc

The -mdisable-indexing flag is very much still needed for PA due to
the use of virtual arrays in GNAT.

^ permalink raw reply	[flat|nested] 45+ messages in thread
* Re: PA specifies invalid T_ADAFLAGS
@ 2002-04-24 12:07 John David Anglin
  2002-04-24 12:43 ` Matthew Wilcox
                   ` (2 more replies)
  0 siblings, 3 replies; 45+ messages in thread
From: John David Anglin @ 2002-04-24 12:07 UTC (permalink / raw)
  To: gcc; +Cc: willy

The use of T_ADAFLAGS stems from this change:

2001-10-08  Zack Weinberg  <zack@codesourcery.com>

        * aclocal.m4 (gcc_AC_PROG_GNAT): New.
	* configure.in: Use it.
	* configure: Regenerated.
	* config/pa/t-linux, config/pa/t-pa, config/pa/t-pa64,
	config/pa/t-pro: Set T_ADAFLAGS, not ADA_CFLAGS.

I suspect using "-mdisable-indexing" dates from a time when indexing
didn't work very well.  This was reworked a year or two ago.

Could you try removing the defines for T_ADAFLAGS and see what happens?

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

^ permalink raw reply	[flat|nested] 45+ messages in thread
* PA specifies invalid T_ADAFLAGS
@ 2002-04-24 10:27 Matthew Wilcox
  0 siblings, 0 replies; 45+ messages in thread
From: Matthew Wilcox @ 2002-04-24 10:27 UTC (permalink / raw)
  To: gcc


I'm trying to bootstrap an Ada hppa-linux crosscompiler.  Here's my
latest problem, which doesn't appear to be PEBCAK this time :-)

Downloaded the 20020423 3.1 snapshot.  Made bootstrap (on i386-linux),
installed.  Configured with:

../gcc-3.1-20020423/configure --prefix=/opt/palinux --target=hppa-linux --enable-languages=c,ada --disable-shared --disable-nls |tee configure.out

Dies when it tries to compile:

gcc -c -g -O2  -mdisable-indexing -W -Wall -gnatpg -gnata -I- -I. -I../../../gcc-3.1-20020423/gcc/ada ../../../gcc-3.1-20020423/gcc/ada/ada.ads

since gcc (native i386 compiler) doesn't grok -mdisable-indexing which
is an HPPA specific option.  This is picked up from T_ADAFLAGS, which
is defined in:

gcc/config/pa/t-linux
gcc/config/pa/t-pa
gcc/config/pa/t-pa64
gcc/config/pa/t-pro

I'm not terribly familiar with gcc's configure / build system, so I don't
know who's at fault here.  Should PA be specifying this in X_ADAFLAGS?
Should Ada not be using T_ADAFLAGS like this?

-- 
Revolutions do not require corporate support.

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

end of thread, other threads:[~2002-04-26 23:12 UTC | newest]

Thread overview: 45+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-25 19:37 PA specifies invalid T_ADAFLAGS Robert Dewar
2002-04-25 19:55 ` John David Anglin
  -- strict thread matches above, loose matches on Subject: below --
2002-04-26 16:14 Robert Dewar
     [not found] <10204260954.AA16645@vlsi1.ultra.nyu.edu>
2002-04-26  8:11 ` Matthew Wilcox
2002-04-26  4:06 Richard Kenner
2002-04-25 22:55 Matthew Wilcox
2002-04-25 21:14 Robert Dewar
2002-04-25 20:52 Robert Dewar
2002-04-25 21:53 ` John David Anglin
2002-04-25 19:58 Robert Dewar
2002-04-25 20:51 ` John David Anglin
2002-04-25 19:45 Robert Dewar
2002-04-25  5:35 Richard Kenner
2002-04-26 10:54 ` law
2002-04-25  3:37 Richard Kenner
2002-04-24 22:08 Robert Dewar
2002-04-24 21:27 Robert Dewar
2002-04-24 20:37 Robert Dewar
2002-04-24 20:44 ` Matthew Wilcox
2002-04-24 21:44 ` John David Anglin
2002-04-24 20:09 Robert Dewar
2002-04-24 20:06 Robert Dewar
2002-04-24 20:26 ` Matthew Wilcox
2002-04-24 21:39   ` John David Anglin
2002-04-24 19:59 Richard Kenner
2002-04-24 22:07 ` John David Anglin
2002-04-25  0:18   ` Arnaud Charlet
2002-04-25  0:49     ` Richard Henderson
2002-04-26 10:51       ` law
2002-04-25  2:47   ` Olivier Hainque
2002-04-25  2:58     ` Michael Matz
2002-04-25  9:25     ` John David Anglin
2002-04-24 12:07 John David Anglin
2002-04-24 12:43 ` Matthew Wilcox
2002-04-25 15:04   ` John David Anglin
2002-04-26 10:56     ` law
2002-04-26 11:28       ` John David Anglin
2002-04-24 13:27 ` Arnaud Charlet
2002-04-24 13:38   ` John David Anglin
2002-04-24 14:28     ` Arnaud Charlet
2002-04-24 22:47       ` John David Anglin
2002-04-26  9:35 ` law
2002-04-26  9:39   ` John David Anglin
2002-04-26 10:43     ` law
2002-04-24 10:27 Matthew Wilcox

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