This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GNAT SVN trunk on PowerPC and SPARC


Eric Botcazou wrote:
Thanks. That doesn't appear to be as bad as
what I am seeing.

Quite good actually.


Have you seen anything like the gnat1 compile
time I reported yesterday?

Try to configure with --enable-checking=release.
No. I will add that to the list of things to do.
But it was confirmed on a native bsd build
by Krister Walfridsson.
You know.. I turned the optimization of the Ada
run-time from -O2 -> -O0 to work around the
huge compile time. Is it possible that that
is breaking the run-time?

That should not, in any cases.
Unfortunately I am nearly 100% sure that
it did break the run-time.  Attached is a very
simple Ada program that works correctly
when the run-time is compiled at -O2 and
breaks when the run-time is at -O0.  I tracked
it down to somehow pthread_cond_timedwait
is not being passed the Id it was given by
pthread_cond_init.  This resulted in
pthread_cond_timedwait returning immediately
with EINVAL and the tasking not working
right.  I didn't recompile RTEMS between the
two builds.

FWIW the attached program calls an empty
C function.  There is also code in there to
obtain the native RTEMS task priority so
I could confirm that the Ada task priorities
were making it down to RTEMS correctly.
But there is nothing critical to that being
in the example.

--joel

--
--  Demonstrate Task Priority
--
--
--High:  17
--HighNative: ID=0x0B010004
-- 238
--Low:  16
--LowNative: ID=0x0B010003
-- 239


with Text_IO; use Text_IO;
with Ada.Dynamic_Priorities; use Ada.Dynamic_Priorities;
with System;
with Interfaces.C;

procedure Task_Priority is

   procedure Put_Priority is
     function getPriority return Interfaces.C.int;
     pragma Import (C, getPriority, "getPriority");
   begin
     Put_Line (Interfaces.C.int'Image (getPriority));
   end Put_Priority;

   -- I think 16 > 17 to Ada
   task Low_Task is
     pragma Priority(16);
   end Low_Task;

   task High_Task is
     pragma Priority(17);
   end High_Task;

   task body High_Task is
   begin
     Put_Line ( "High: " & System.Any_Priority'Image (Get_Priority));
     Put ( "HighNative: " );
     Put_Priority;
     loop
       delay 1.0;
       Put_Line ("High - Waking up");
     end loop;
   end High_Task;

   task body Low_Task is
     procedure empty;
     pragma Import (C, empty, "empty");
   begin
     Put_Line ( "Low: " & System.Any_Priority'Image (Get_Priority));
     Put ( "LowNative: " );
     Put_Priority;
     delay 0.1;
     loop
       empty;
     end loop;
   end Low_Task;

begin
   NULL;
end Task_Priority;
#if defined(__rtems__)
#include <rtems.h>
#endif

int getPriority()
{
#if defined(__rtems__)
  printk( "ID=0x%08x\n", _Thread_Executing->Object.id );

  return (int)_Thread_Executing->current_priority;
#endif
  return 0;
}

void empty()
{
  #if defined(__rtems__)
    // printk(".");
  #endif
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]