public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/115535] New: Image attribute on arrays incorrectly prints a signed representation under certain conditions
@ 2024-06-18  8:34 liam at liampwll dot com
  2024-06-18 22:35 ` [Bug ada/115535] negative value returned by 'Image applied to array with nonnegative integer component ebotcazou at gcc dot gnu.org
  2024-06-19  7:30 ` [Bug ada/115535] negative value returned by 'Image for " ebotcazou at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: liam at liampwll dot com @ 2024-06-18  8:34 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 115535
           Summary: Image attribute on arrays incorrectly prints a signed
                    representation under certain conditions
           Product: gcc
           Version: 13.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: liam at liampwll dot com
                CC: dkm at gcc dot gnu.org
  Target Milestone: ---

When calling 'Image on arrays containing range 0 .. 2**32 - 1 the output does
not match the output of 'Image for each element and instead outputs the value
interpreted as a signed 32 bit number.

GCC version: x64 13.2.0 from Alire on Linux and trunk on godbolt.org

Example built with gcc -c -I/app/ -g -fdiagnostics-color=always -S
-fverbose-asm -masm=intel -gnat2022 -o /app/example.s -I-:

with Ada.Text_IO; use Ada.Text_IO;
with System;

procedure Example is
    type Client_ID_Part is range 0 .. 2**32 - 1 with
      Size => 32;
   type Client_ID is array (1 .. 2) of Client_ID_Part;
    A : Client_ID := (1479222903, 3163714999);
begin
   Put_Line (A'Image);
   Put_Line (A (1)'Image);
   Put_Line (A (2)'Image);
end Example;

Actual output:

[ 1479222903, -1131252297]
 1479222903
 3163714999

Expected output:

[ 1479222903, 3163714999]
 1479222903
 3163714999

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

* [Bug ada/115535] negative value returned by 'Image applied to array with nonnegative integer component
  2024-06-18  8:34 [Bug ada/115535] New: Image attribute on arrays incorrectly prints a signed representation under certain conditions liam at liampwll dot com
@ 2024-06-18 22:35 ` ebotcazou at gcc dot gnu.org
  2024-06-19  7:30 ` [Bug ada/115535] negative value returned by 'Image for " ebotcazou at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2024-06-18 22:35 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2024-06-18
            Summary|Image attribute on arrays   |negative value returned by
                   |of unsigned values          |'Image applied to array
                   |incorrectly prints a signed |with nonnegative integer
                   |representation under        |component
                   |certain conditions          |
                 CC|                            |ebotcazou at gcc dot gnu.org

--- Comment #1 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
Build_Elementary_Put_Image_Call uses the signedness of the base type but the
size of the first subtype, hence the discrepancy.

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

* [Bug ada/115535] negative value returned by 'Image for array with nonnegative integer component
  2024-06-18  8:34 [Bug ada/115535] New: Image attribute on arrays incorrectly prints a signed representation under certain conditions liam at liampwll dot com
  2024-06-18 22:35 ` [Bug ada/115535] negative value returned by 'Image applied to array with nonnegative integer component ebotcazou at gcc dot gnu.org
@ 2024-06-19  7:30 ` ebotcazou at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2024-06-19  7:30 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |ebotcazou at gcc dot gnu.org

--- Comment #2 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
I'll have a closer look.

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

end of thread, other threads:[~2024-06-19  7:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-18  8:34 [Bug ada/115535] New: Image attribute on arrays incorrectly prints a signed representation under certain conditions liam at liampwll dot com
2024-06-18 22:35 ` [Bug ada/115535] negative value returned by 'Image applied to array with nonnegative integer component ebotcazou at gcc dot gnu.org
2024-06-19  7:30 ` [Bug ada/115535] negative value returned by 'Image for " 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).