public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/53766] New: ICE in build_binary_op when using pragma Suppress (All_Checks)
@ 2012-06-25 10:36 baldrick at gcc dot gnu.org
  2012-06-27 10:39 ` [Bug ada/53766] ICE in build_binary_op on Max_Size_In_Storage_Elements with -gnatp ebotcazou at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: baldrick at gcc dot gnu.org @ 2012-06-25 10:36 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53766
           Summary: ICE in build_binary_op when using pragma Suppress
                    (All_Checks)
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: baldrick@gcc.gnu.org


At a guess, the code that inserts runtime checks adds a need type conversion
that is forgotten when checks are suppressed.  I see this with gcc-4.7 and
with mainline.

$ gcc-4.8 -c p.adb
+===========================GNAT BUG DETECTED==============================+
| 4.8.0 20120624 (experimental) (x86_64-unknown-linux-gnu) GCC error:      |
| in build_binary_op, at ada/gcc-interface/utils2.c:1134                   |
| Error detected at p.adb:7:57                                             |
| Please submit a bug report; see http://gcc.gnu.org/bugs.html.            |
| Use a subject line meaningful to you and us to track the bug.            |
| Include the entire contents of this bug box in the report.               |
| Include the exact gcc or gnatmake command that you entered.              |
| Also include sources listed below in gnatchop format                     |
| (concatenated together with no headers between files).                   |
+==========================================================================+

Please include these source files with error report
Note that list may not be accurate in some cases,
so please double check that the problem can still
be reproduced with the set of files listed.
Consider also -gnatd.n switch (see debug.adb).

p.adb
p.ads

compilation abandoned

-- chop here --

with System.Storage_Elements;
package P is
   procedure A (Offset : System.Storage_Elements.Storage_Offset);
end;

with Ada.Strings.Unbounded;
package body P is
   use System.Storage_Elements;
   procedure A (Offset : Storage_Offset) is
      pragma Suppress (All_Checks);
   begin
      if Offset +
Ada.Strings.Unbounded.Unbounded_String'Max_Size_In_Storage_Elements >= 123 then
         raise Program_Error;
      end if;
   end;
end;


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

* [Bug ada/53766] ICE in build_binary_op on Max_Size_In_Storage_Elements with -gnatp
  2012-06-25 10:36 [Bug ada/53766] New: ICE in build_binary_op when using pragma Suppress (All_Checks) baldrick at gcc dot gnu.org
@ 2012-06-27 10:39 ` ebotcazou at gcc dot gnu.org
  2012-12-15 18:12 ` ebotcazou at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2012-06-27 10:39 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-06-27
                 CC|                            |ebotcazou at gcc dot
                   |                            |gnu.org
            Summary|ICE in build_binary_op when |ICE in build_binary_op on
                   |using pragma Suppress       |Max_Size_In_Storage_Element
                   |(All_Checks)                |s with -gnatp
     Ever Confirmed|0                           |1

--- Comment #1 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2012-06-27 10:39:19 UTC ---
The expanded code without -gnatp looks quite different.


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

* [Bug ada/53766] ICE in build_binary_op on Max_Size_In_Storage_Elements with -gnatp
  2012-06-25 10:36 [Bug ada/53766] New: ICE in build_binary_op when using pragma Suppress (All_Checks) baldrick at gcc dot gnu.org
  2012-06-27 10:39 ` [Bug ada/53766] ICE in build_binary_op on Max_Size_In_Storage_Elements with -gnatp ebotcazou at gcc dot gnu.org
@ 2012-12-15 18:12 ` ebotcazou at gcc dot gnu.org
  2012-12-15 18:13 ` [Bug ada/53766] [4.7/4.8 regression] " ebotcazou at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2012-12-15 18:12 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #2 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2012-12-15 18:11:43 UTC ---
Author: ebotcazou
Date: Sat Dec 15 18:11:38 2012
New Revision: 194521

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=194521
Log:
    PR ada/53766
    * gnat.dg/controlled7.ad[sb]: New test.

Added:
    trunk/gcc/testsuite/gnat.dg/controlled7.adb
    trunk/gcc/testsuite/gnat.dg/controlled7.ads
Modified:
    trunk/gcc/testsuite/ChangeLog


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

* [Bug ada/53766] [4.7/4.8 regression] ICE in build_binary_op on Max_Size_In_Storage_Elements with -gnatp
  2012-06-25 10:36 [Bug ada/53766] New: ICE in build_binary_op when using pragma Suppress (All_Checks) baldrick at gcc dot gnu.org
  2012-06-27 10:39 ` [Bug ada/53766] ICE in build_binary_op on Max_Size_In_Storage_Elements with -gnatp ebotcazou at gcc dot gnu.org
  2012-12-15 18:12 ` ebotcazou at gcc dot gnu.org
@ 2012-12-15 18:13 ` ebotcazou at gcc dot gnu.org
  2012-12-15 18:16 ` ebotcazou at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2012-12-15 18:13 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.7.3
            Summary|ICE in build_binary_op on   |[4.7/4.8 regression] ICE in
                   |Max_Size_In_Storage_Element |build_binary_op on
                   |s with -gnatp               |Max_Size_In_Storage_Element
                   |                            |s with -gnatp


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

* [Bug ada/53766] [4.7/4.8 regression] ICE in build_binary_op on Max_Size_In_Storage_Elements with -gnatp
  2012-06-25 10:36 [Bug ada/53766] New: ICE in build_binary_op when using pragma Suppress (All_Checks) baldrick at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2012-12-15 18:13 ` [Bug ada/53766] [4.7/4.8 regression] " ebotcazou at gcc dot gnu.org
@ 2012-12-15 18:16 ` ebotcazou at gcc dot gnu.org
  2012-12-15 18:17 ` ebotcazou at gcc dot gnu.org
  2012-12-15 20:04 ` baldrick at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2012-12-15 18:16 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #3 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2012-12-15 18:16:33 UTC ---
Author: ebotcazou
Date: Sat Dec 15 18:16:28 2012
New Revision: 194522

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=194522
Log:
    PR ada/53766
    Backport from mainline

    2012-07-17  Hristian Kirtchev  <kirtchev@adacore.com>

    * exp_attr.adb (Expand_N_Attribute_Reference): Add local variables Attr
    and Conversion_Added.  Add local constant Typ.
    Retrieve the original attribute after the arithmetic check
    machinery has modified the node. Add a conversion to the target
    type when the prefix of attribute Max_Size_In_Storage_Elements
    is a controlled type.

Added:
    branches/gcc-4_7-branch/gcc/testsuite/gnat.dg/controlled7.adb
      - copied unchanged from r194521,
trunk/gcc/testsuite/gnat.dg/controlled7.adb
    branches/gcc-4_7-branch/gcc/testsuite/gnat.dg/controlled7.ads
      - copied unchanged from r194521,
trunk/gcc/testsuite/gnat.dg/controlled7.ads
Modified:
    branches/gcc-4_7-branch/gcc/ada/ChangeLog
    branches/gcc-4_7-branch/gcc/ada/exp_attr.adb
    branches/gcc-4_7-branch/gcc/testsuite/ChangeLog


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

* [Bug ada/53766] [4.7/4.8 regression] ICE in build_binary_op on Max_Size_In_Storage_Elements with -gnatp
  2012-06-25 10:36 [Bug ada/53766] New: ICE in build_binary_op when using pragma Suppress (All_Checks) baldrick at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2012-12-15 18:16 ` ebotcazou at gcc dot gnu.org
@ 2012-12-15 18:17 ` ebotcazou at gcc dot gnu.org
  2012-12-15 20:04 ` baldrick at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2012-12-15 18:17 UTC (permalink / raw)
  To: gcc-bugs


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

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

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

--- Comment #4 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2012-12-15 18:17:30 UTC ---
Thanks for reporting the problem.


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

* [Bug ada/53766] [4.7/4.8 regression] ICE in build_binary_op on Max_Size_In_Storage_Elements with -gnatp
  2012-06-25 10:36 [Bug ada/53766] New: ICE in build_binary_op when using pragma Suppress (All_Checks) baldrick at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2012-12-15 18:17 ` ebotcazou at gcc dot gnu.org
@ 2012-12-15 20:04 ` baldrick at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: baldrick at gcc dot gnu.org @ 2012-12-15 20:04 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #5 from Duncan Sands <baldrick at gcc dot gnu.org> 2012-12-15 20:04:16 UTC ---
Thanks for fixing the problem!


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

end of thread, other threads:[~2012-12-15 20:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-25 10:36 [Bug ada/53766] New: ICE in build_binary_op when using pragma Suppress (All_Checks) baldrick at gcc dot gnu.org
2012-06-27 10:39 ` [Bug ada/53766] ICE in build_binary_op on Max_Size_In_Storage_Elements with -gnatp ebotcazou at gcc dot gnu.org
2012-12-15 18:12 ` ebotcazou at gcc dot gnu.org
2012-12-15 18:13 ` [Bug ada/53766] [4.7/4.8 regression] " ebotcazou at gcc dot gnu.org
2012-12-15 18:16 ` ebotcazou at gcc dot gnu.org
2012-12-15 18:17 ` ebotcazou at gcc dot gnu.org
2012-12-15 20:04 ` baldrick 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).