public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/113536] New: valid reduction expression rejected by -gnatVo
@ 2024-01-22  5:30 devotus at yahoo dot com
  2024-01-22 18:39 ` [Bug ada/113536] " devotus at yahoo dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: devotus at yahoo dot com @ 2024-01-22  5:30 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 113536
           Summary: valid reduction expression rejected by -gnatVo
           Product: gcc
           Version: 13.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: devotus at yahoo dot com
                CC: dkm at gcc dot gnu.org
  Target Milestone: ---

The legal program below fails to compile when `-gnatVo` is active. The error
message is

    test_reduction.adb:13:15: error: missing argument for parameter
"Accumulator" in call to "Do_Something" declared at line 9

The error seems to date back at least to gnat 10.2.

pragma Ada_2022;

with Ada.Text_IO;

procedure Test_Reduction is

   subtype Value is Natural range 0 .. 255;

   function Do_Something (Accumulator : Value; Symbol : Character) return Value
   is (((Accumulator + Character'Pos (Symbol)) * 17) mod 256);

   function Do_It_By_Reduction (S : String) return Value is
   (S'Reduce (Do_Something, 0));

   Test_It : constant Value := Do_It_By_Reduction ("Hello, world!");

begin

   Ada.Text_IO.Put_Line (Test_It'Image);

end Test_Reduction;

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

* [Bug ada/113536] valid reduction expression rejected by -gnatVo
  2024-01-22  5:30 [Bug ada/113536] New: valid reduction expression rejected by -gnatVo devotus at yahoo dot com
@ 2024-01-22 18:39 ` devotus at yahoo dot com
  2024-02-03 12:03 ` [Bug ada/113536] [14 regression] valid reduction expression rejected ebotcazou at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: devotus at yahoo dot com @ 2024-01-22 18:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Jack Perry <devotus at yahoo dot com> ---
Per Simon Wright, gcc 14.0.0 does not fail on this, whereas gcc 14.0.1 does, in
the same location, but with a different error: `expected type "Value"... found
type "Standard.Character"`

I edited his message to conform with the types I used in the example below, but
I've also observed it on godbolt's compiler explorer when using gnat "trunk".

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

* [Bug ada/113536] [14 regression] valid reduction expression rejected
  2024-01-22  5:30 [Bug ada/113536] New: valid reduction expression rejected by -gnatVo devotus at yahoo dot com
  2024-01-22 18:39 ` [Bug ada/113536] " devotus at yahoo dot com
@ 2024-02-03 12:03 ` ebotcazou at gcc dot gnu.org
  2024-03-04 13:17 ` rguenth at gcc dot gnu.org
  2024-05-07  7:44 ` [Bug ada/113536] [14/15 " rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2024-02-03 12:03 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.0
   Last reconfirmed|                            |2024-02-03
                 CC|                            |ebotcazou at gcc dot gnu.org
     Ever confirmed|0                           |1
            Summary|valid reduction expression  |[14 regression] valid
                   |rejected by -gnatVo         |reduction expression
                   |                            |rejected
             Status|UNCONFIRMED                 |NEW

--- Comment #2 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
Yes, it's a regression on the mainline.

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

* [Bug ada/113536] [14 regression] valid reduction expression rejected
  2024-01-22  5:30 [Bug ada/113536] New: valid reduction expression rejected by -gnatVo devotus at yahoo dot com
  2024-01-22 18:39 ` [Bug ada/113536] " devotus at yahoo dot com
  2024-02-03 12:03 ` [Bug ada/113536] [14 regression] valid reduction expression rejected ebotcazou at gcc dot gnu.org
@ 2024-03-04 13:17 ` rguenth at gcc dot gnu.org
  2024-05-07  7:44 ` [Bug ada/113536] [14/15 " rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-03-04 13:17 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4

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

* [Bug ada/113536] [14/15 regression] valid reduction expression rejected
  2024-01-22  5:30 [Bug ada/113536] New: valid reduction expression rejected by -gnatVo devotus at yahoo dot com
                   ` (2 preceding siblings ...)
  2024-03-04 13:17 ` rguenth at gcc dot gnu.org
@ 2024-05-07  7:44 ` rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-05-07  7:44 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|14.0                        |14.2

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 14.1 is being released, retargeting bugs to GCC 14.2.

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

end of thread, other threads:[~2024-05-07  7:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-22  5:30 [Bug ada/113536] New: valid reduction expression rejected by -gnatVo devotus at yahoo dot com
2024-01-22 18:39 ` [Bug ada/113536] " devotus at yahoo dot com
2024-02-03 12:03 ` [Bug ada/113536] [14 regression] valid reduction expression rejected ebotcazou at gcc dot gnu.org
2024-03-04 13:17 ` rguenth at gcc dot gnu.org
2024-05-07  7:44 ` [Bug ada/113536] [14/15 " rguenth 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).