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 ada/16099] New: Wrong output from legal program


with text_io;
procedure Test_248684 is
   type T1 is delta 1.0 range -256.0..255.0;
begin
   for i in 1..10 loop
      declare
         x: T1 := T1(i);
         y: T1 := (-2.0) * x;
      begin
         if y = -2.0 * x
         then text_io.put_line("passed");
         else text_io.put_line("failed: " & T1'image(y));
         end if;
      end;
   end loop;
end Test_248684;


The program should print "passed", but it prints:

failed:  2.0
failed:  4.0
failed:  6.0
failed:  8.0
failed:  10.0
failed:  12.0
failed:  14.0
failed:  16.0
failed:  18.0
failed:  20.0

-- 
           Summary: Wrong output from legal program
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: ada
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ludovic dot brenta at insalien dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


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