This is the mail archive of the gcc-bugs@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]

[Bug tree-optimization/30911] VRP fails to eliminate range checks in Ada code



------- Comment #30 from rguenth at gcc dot gnu dot org  2007-02-23 17:32 -------
Ok, I have too little Ada skills ;)  What is missing in the following?


with test;

package test is
  type Count is range 0 .. Natural'Last;
  subtype Positive_Count is Count range 1 .. Count'Last;
  procedure Set_Col (To : Positive_Count);
end test;

procedure Set_Col
  (To  : Positive_Count)
is
begin
  if not To'Valid then
    raise Constraint_Error;
  end if;
end Set_Col;


$ gnatchop -w Set_Col.adb
splitting Set_Col.adb into:
   test.ads
   set_col.adb
$ gnatmake set_col.adb
gcc-4.1 -c set_col.adb
set_col.ads:2:25: "Positive_Count" is undefined (more references follow)
gnatmake: "set_col.adb" compilation error


-- 


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


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