public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "baldrick at free dot fr" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug ada/19409] ACATS c460010 - valgrind detects wrong code Date: Thu, 20 Jan 2005 12:16:00 -0000 [thread overview] Message-ID: <20050120121527.21854.qmail@sourceware.org> (raw) In-Reply-To: <20050112224926.19409.baldrick@free.fr> ------- Additional Comments From baldrick at free dot fr 2005-01-20 12:15 ------- Here is a simpler example: with Ada.Text_IO; use Ada.Text_IO; procedure T is type Index_Type is range 0 .. 4; -- does not fail if lower bound is 1 type Unconstrained_Array_Type is array (Index_Type range <>) of Integer; subtype Array_Type is Unconstrained_Array_Type (2..4); Target : array (1 .. 1) of Array_Type; procedure Check (Index : Index_Type; Value : Integer) is begin if Target (1) (Index) /= Value then Put_Line ("Expected " & Integer'Image (Value) & ", found " & Integer'Image (Target (1) (Index))); end if; end Check; begin Target := (1 => (1 => 20, 2 => 30, 3 => 40)); -- the assignment requires sliding Check (2, 20); Check (3, 30); Check (4, 40); end; > gnatmake -s -g t ... > ./t Expected 20, found 30 Expected 30, found 40 Expected 40, found 134596128 This seems to be a front-end problem. In the dump t.adb.t02.original the assignment is: A15b[1]{lb: 1 sz: 12}[1]{lb: 2 sz: 4} = 20; A15b[1]{lb: 1 sz: 12}[2]{lb: 2 sz: 4} = 30; A15b[1]{lb: 1 sz: 12}[3]{lb: 2 sz: 4} = 40; For the first assignment, notice the lower bound of 2, but the assignment to element 1. All the assignments are off by one index. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19409
next prev parent reply other threads:[~2005-01-20 12:16 UTC|newest] Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top 2005-01-12 22:49 [Bug ada/19409] New: " baldrick at free dot fr 2005-01-12 22:56 ` [Bug ada/19409] " pinskia at gcc dot gnu dot org 2005-01-20 12:16 ` baldrick at free dot fr [this message] 2005-01-25 20:59 ` laurent at guerby dot net 2005-02-10 23:16 ` pinskia at gcc dot gnu dot org 2005-07-19 13:17 ` baldrick at free dot fr 2005-07-19 21:37 ` pinskia at gcc dot gnu dot org [not found] <bug-19409-8622@http.gcc.gnu.org/bugzilla/> 2007-04-30 9:45 ` charlet at gcc dot gnu dot org 2007-04-30 9:46 ` charlet at gcc dot gnu dot org 2007-05-02 9:14 ` baldrick at gcc dot gnu dot org 2007-05-02 9:16 ` charlet at gcc dot gnu dot org 2007-12-07 13:01 ` sam at gcc dot gnu dot org 2007-12-08 9:42 ` baldrick at gcc dot gnu dot org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20050120121527.21854.qmail@sourceware.org \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).