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/15401] New: [3.15p/3.4 regression] -O2 or higher generates wrong code


with text_io;
   procedure Test_103 is
      function one return integer is
      begin
         return 1;
      end;

      type T1 is record
         name : string (1..4);
      end record;

       x : T1 := (name => "bill");
   begin
      x.name(one) := 'j';
      if x.name /= "jill"
         then text_io.put_line("failed");
      end if;
      text_io.put_line(x.name);
   end Test_103;


With GNAT 3.15p, I get the correct answer "jill" with -O0, -O1, -O2 and -O3.

With 3.4, at -O2 or higher, the output is "failed".

-- 
           Summary: [3.15p/3.4 regression] -O2 or higher generates wrong
                    code
           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
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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