public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/61466] New: Array index check optimized away
@ 2014-06-10 20:11 simon at pushface dot org
  2015-01-09  7:04 ` [Bug ada/61466] " simon at pushface dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: simon at pushface dot org @ 2014-06-10 20:11 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61466

            Bug ID: 61466
           Summary: Array index check optimized away
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: simon at pushface dot org

Created attachment 32916
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=32916&action=edit
Source code (package spec/body, main procedure)

In the attached code, the index check in procedure Violate on the “Output: out
Arr” parameter is present with -O0 but is omitted with higher levels. This is
clearly visible with -gnatG:

-O0:

      L_1 : for j in input'first .. input'last loop
         B_2 : declare
            [constraint_error when
              not (integer(j) in modifier'first .. modifier'last)
              "index check failed"]
            product : constant integer := modifier (j);
         begin
            [constraint_error when
              not (integer(j) in output'first .. output'last)
              "index check failed"]
            output (j) := product / 2;
         end B_2;
      end loop L_1;

-O1:

      L_1 : for j in input'first .. input'last loop
         B_2 : declare
            [constraint_error when
              not (integer(j) in modifier'first .. modifier'last)
              "index check failed"]
            product : constant integer := modifier (j);
         begin
            output (j) := product / 2;
         end B_2;
      end loop L_1;

The bug is present at least in GCC 4.6 on Debian and GCC 4.7 .. 4.9 on Mac OS
X, also in GNAT GPL 2012 .. 2014.
>From gcc-bugs-return-453637-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Jun 10 20:18:54 2014
Return-Path: <gcc-bugs-return-453637-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 17094 invoked by alias); 10 Jun 2014 20:18:53 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 17056 invoked by uid 48); 10 Jun 2014 20:18:48 -0000
From: "simon at pushface dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug ada/61027] gnatcmd gets SIGABRT during exception handling
Date: Tue, 10 Jun 2014 20:18:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: ada
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: simon at pushface dot org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-61027-4-YQTZNWKzSh@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-61027-4@http.gcc.gnu.org/bugzilla/>
References: <bug-61027-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-06/txt/msg00719.txt.bz2
Content-length: 282

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61027

--- Comment #1 from simon at pushface dot org ---
Same problem with “gnatchop -h” (which, in this case, exits via an exception):

[...]
exception
   when Types.Terminate_Program =>
      null;

end Gnatchop;
>From gcc-bugs-return-453638-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Jun 10 21:15:39 2014
Return-Path: <gcc-bugs-return-453638-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 20887 invoked by alias); 10 Jun 2014 21:15:38 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 20825 invoked by uid 48); 10 Jun 2014 21:15:33 -0000
From: "fdumont at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/29988] More stl_tree.h enhancements: improving operatorDate: Tue, 10 Jun 2014 21:15:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Version: 4.3.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: fdumont at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: fdumont at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.10.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc assigned_to target_milestone
Message-ID: <bug-29988-4-X2yFVNvWmZ@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-29988-4@http.gcc.gnu.org/bugzilla/>
References: <bug-29988-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-06/txt/msg00720.txt.bz2
Content-length: 687

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=29988

François Dumont <fdumont at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fdumont at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |fdumont at gcc dot gnu.org
   Target Milestone|---                         |4.10.0

--- Comment #1 from François Dumont <fdumont at gcc dot gnu.org> ---
I am working on a patch to reuse nodes. Not only for the copy assignment but
also for C++11 move assignment and assignment from initialization list.
>From gcc-bugs-return-453639-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Jun 10 23:19:51 2014
Return-Path: <gcc-bugs-return-453639-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 29587 invoked by alias); 10 Jun 2014 23:19:50 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 29536 invoked by uid 48); 10 Jun 2014 23:19:45 -0000
From: "P at draigBrady dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/53131] -Wlogical-op: ready for prime time in -Wall ?
Date: Tue, 10 Jun 2014 23:19:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c
X-Bugzilla-Version: 4.8.0
X-Bugzilla-Keywords: diagnostic
X-Bugzilla-Severity: minor
X-Bugzilla-Who: P at draigBrady dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status resolution
Message-ID: <bug-53131-4-wPJPJkSqAw@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-53131-4@http.gcc.gnu.org/bugzilla/>
References: <bug-53131-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-06/txt/msg00721.txt.bz2
Content-length: 470

https://gcc.gnu.org/bugzilla/show_bug.cgi?idS131
Bug 53131 depends on bug 43772, which changed state.

Bug 43772 Summary: Errant -Wlogical-op warning when testing limits
https://gcc.gnu.org/bugzilla/show_bug.cgi?idC772

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug ada/61466] Array index check optimized away
  2014-06-10 20:11 [Bug ada/61466] New: Array index check optimized away simon at pushface dot org
@ 2015-01-09  7:04 ` simon at pushface dot org
  2015-01-09 12:16 ` [Bug ada/61466] array index check optimized away with optimization ebotcazou at gcc dot gnu.org
  2015-02-05 11:41 ` ebotcazou at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: simon at pushface dot org @ 2015-01-09  7:04 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61466

--- Comment #1 from simon at pushface dot org ---
Still present in gcc version 5.0.0 20141228


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug ada/61466] array index check optimized away with optimization
  2014-06-10 20:11 [Bug ada/61466] New: Array index check optimized away simon at pushface dot org
  2015-01-09  7:04 ` [Bug ada/61466] " simon at pushface dot org
@ 2015-01-09 12:16 ` ebotcazou at gcc dot gnu.org
  2015-02-05 11:41 ` ebotcazou at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2015-01-09 12:16 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61466

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-01-09
                 CC|                            |ebotcazou at gcc dot gnu.org
            Summary|Array index check optimized |array index check optimized
                   |away                        |away with optimization
     Ever confirmed|0                           |1

--- Comment #2 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
Ouch.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug ada/61466] array index check optimized away with optimization
  2014-06-10 20:11 [Bug ada/61466] New: Array index check optimized away simon at pushface dot org
  2015-01-09  7:04 ` [Bug ada/61466] " simon at pushface dot org
  2015-01-09 12:16 ` [Bug ada/61466] array index check optimized away with optimization ebotcazou at gcc dot gnu.org
@ 2015-02-05 11:41 ` ebotcazou at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2015-02-05 11:41 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61466

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                URL|                            |https://gcc.gnu.org/ml/gcc-
                   |                            |patches/2015-02/msg00334.ht
                   |                            |ml
         Resolution|---                         |FIXED
   Target Milestone|---                         |5.0

--- Comment #3 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
This will be fixed in the upcoming 5.0 release.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-02-05 11:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-10 20:11 [Bug ada/61466] New: Array index check optimized away simon at pushface dot org
2015-01-09  7:04 ` [Bug ada/61466] " simon at pushface dot org
2015-01-09 12:16 ` [Bug ada/61466] array index check optimized away with optimization ebotcazou at gcc dot gnu.org
2015-02-05 11:41 ` ebotcazou at gcc dot gnu.org

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).