public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/50600] New: "Illegal instruction" when using pragma Profile (Restricted)
@ 2011-10-03 15:34 bauhaus at futureapps dot de
  0 siblings, 0 replies; only message in thread
From: bauhaus at futureapps dot de @ 2011-10-03 15:34 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 50600
           Summary: "Illegal instruction" when using pragma Profile
                    (Restricted)
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: bauhaus@futureapps.de


The program below will fail as indicated (or not run
correctly, depending on platform) when pragma profile
(Restricted) is in effect. Failures vary a little.
On Mac OS X 10.6.8, GCC 4.7.0 x86_64-apple-darwin10.8.0
from 20111002:

$ ./rstr 
rsrt
Illegal instruction
$

A seemingly hanging program (Debian 6, GCC 4.7.0
i686-pc-linux-gnu from 20110610). Stack traces in the debugger
have varied a bit (on Mac), but mostly list subprograms to do
with PO entry calls (waiting) and (pthread) mutex locking,
judging by the names. Program receives SIGSEGV in debugger.

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/opt/GCC-4.7/libexec/gcc/x86_64-apple-darwin10.8.0/4.7.0/lto-wrapper
Target: x86_64-apple-darwin10.8.0
Configured with: /Users/bauhaus/src/GCC/configure --enable-languages=c,ada
--disable-nls --prefix=/opt/GCC-4.7
Thread model: posix
gcc version 4.7.0 20111002 (experimental) (GCC)

If the program text is in file "rstr.ada", then

$ gnatchop -r -w rstr.ada && gnatmake rstr



pragma Profile (Restricted);
package Tsk is
   task Nop is
      pragma Priority (5);
   end Nop;
end Tsk;

with Report;
package body Tsk is
   task body Nop is
   begin
      Report.Put_Line ("Nop");
   end Nop;
end Tsk;

with Tsk;
with Report;
procedure Rstr is
begin
   Report.Put_Line ("rsrt");
end Rstr;

package Report is

   procedure Put_Line (Message : String);

private
   protected Output is
      entry Wait;
      procedure Release;
   private
      Available : Boolean := True;
   end Output;
end Report;

with Ada.Text_IO;

package body Report is
   procedure Put_Line (Message : String) is
   begin
      Output.Wait;
      Ada.Text_IO.Put_Line (Message);
      Ada.Text_IO.Flush;
      Output.Release;
   end Put_Line;

   protected body Output is
      entry Wait when Available is
      begin
         Available := False;
      end Wait;
      procedure Release is
      begin
         Available := True;
      end Release;
   end Output;
end Report;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-10-03 15:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-03 15:34 [Bug ada/50600] New: "Illegal instruction" when using pragma Profile (Restricted) bauhaus at futureapps dot de

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