This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug ada/50600] New: "Illegal instruction" when using pragma Profile (Restricted)
- From: "bauhaus at futureapps dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 03 Oct 2011 15:33:09 +0000
- Subject: [Bug ada/50600] New: "Illegal instruction" when using pragma Profile (Restricted)
- Auto-submitted: auto-generated
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;