public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/97283] New: GNAT rejects valid formal type definition with -gnat2020
@ 2020-10-04  5:08 colton.w.lewis at protonmail dot com
  2020-10-04  5:27 ` [Bug ada/97283] " colton.w.lewis at protonmail dot com
  2020-10-04  8:01 ` charlet at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: colton.w.lewis at protonmail dot com @ 2020-10-04  5:08 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 97283
           Summary: GNAT rejects valid formal type definition with
                    -gnat2020
           Product: gcc
           Version: 10.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: colton.w.lewis at protonmail dot com
  Target Milestone: ---

Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/10/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap
--enable-languages=c,c++,fortran,objc,obj-c++,ada,go,d,lto --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info
--with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared
--enable-threads=posix --enable-checking=release --enable-multilib
--with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions
--enable-gnu-unique-object --enable-linker-build-id
--with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin
--enable-initfini-array --with-isl --enable-offload-targets=nvptx-none
--without-cuda-driver --enable-gnu-indirect-function --enable-cet
--with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.2.1 20200723 (Red Hat 10.2.1-1) (GCC) 


I noticed this problem compiling wisi and ada-mode for Emacs. See the mailing
list here:
https://lists.nongnu.org/archive/html/ada-mode-users/2020-10/msg00002.html

This is the file with the error referenced in the mailing list:
https://git.savannah.nongnu.org/cgit/ada-mode.git/tree/gen_run_wisi_lr_parse.ads?h=org.emacs.ada-mode

Other files in that project produce the same error. The exact gcc arguments
are:

/usr/bin/gcc -c -x ada -gnatA -fstack-check -g -gnat2012 -gnatfqQ -gnatw.d
-gnatwaBCeJL -gnatyO -gnaty3abcefhiklnOprtx -gnatyM120 -fstack-check -g
-gnat2012 -gnatfqQ -gnatw.d -gnatwaBCeJL -gnatyO -O3
-fno-var-tracking-assignments -gnatyO -gnatn -gnat2020
-gnatec=/tmp/GNAT-TEMP-000003.TMP -gnatem=/tmp/GNAT-TEMP-000004.TMP
/home/clewis/.emacs.d/elpa/ada-mode-7.1.4/ada_mode_wisi_lalr_parse.ads

I have not been able to create a smaller example to reproduce the error outside
that project. However, at gcc/ada/par-ch12.adb:793, I found an obvious logic
error that must be the culprit.

     if Token = Tok_With then

         if Ada_Version >= Ada_2020 and Token /= Tok_Private then
            --  Formal type has aspect specifications, parsed later.
            return Def_Node;

Token /= Tok_Private will always be true because Token = Tok_With and was not
updated in between. This explains why the problem only happens with -gnat2020.

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

* [Bug ada/97283] GNAT rejects valid formal type definition with -gnat2020
  2020-10-04  5:08 [Bug ada/97283] New: GNAT rejects valid formal type definition with -gnat2020 colton.w.lewis at protonmail dot com
@ 2020-10-04  5:27 ` colton.w.lewis at protonmail dot com
  2020-10-04  8:01 ` charlet at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: colton.w.lewis at protonmail dot com @ 2020-10-04  5:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from colton.w.lewis at protonmail dot com ---
Never mind.

I just updated master and see the logic bug is fixed. Feel free to close this.

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

* [Bug ada/97283] GNAT rejects valid formal type definition with -gnat2020
  2020-10-04  5:08 [Bug ada/97283] New: GNAT rejects valid formal type definition with -gnat2020 colton.w.lewis at protonmail dot com
  2020-10-04  5:27 ` [Bug ada/97283] " colton.w.lewis at protonmail dot com
@ 2020-10-04  8:01 ` charlet at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: charlet at gcc dot gnu.org @ 2020-10-04  8:01 UTC (permalink / raw)
  To: gcc-bugs

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

Arnaud Charlet <charlet at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |11.0
         Resolution|---                         |FIXED
                 CC|                            |charlet at gcc dot gnu.org
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #2 from Arnaud Charlet <charlet at gcc dot gnu.org> ---
Right, closing accordingly.

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

end of thread, other threads:[~2020-10-04  8:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-04  5:08 [Bug ada/97283] New: GNAT rejects valid formal type definition with -gnat2020 colton.w.lewis at protonmail dot com
2020-10-04  5:27 ` [Bug ada/97283] " colton.w.lewis at protonmail dot com
2020-10-04  8:01 ` charlet 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).