[Bug ada/16099] New: Wrong output from legal program

ludovic dot brenta at insalien dot org gcc-bugzilla@gcc.gnu.org
Sun Jun 20 11:33:00 GMT 2004


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



More information about the Gcc-bugs mailing list