Bug 104342 - ICE with -gnata -fcallgraph-info=su
Summary: ICE with -gnata -fcallgraph-info=su
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: ada (show other bugs)
Version: 14.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-02 12:16 UTC by simon
Modified: 2024-02-25 21:49 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2022-03-24 00:00:00


Attachments
Requested source files (23.08 KB, application/zip)
2022-02-02 12:16 UTC, simon
Details
Reproducer (14.0.1) (23.10 KB, application/zip)
2024-02-25 18:12 UTC, simon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description simon 2022-02-02 12:16:42 UTC
Created attachment 52327 [details]
Requested source files

I originally found this error compiling for STM32F4, using both
ravenscar-sfp-stm32f4 and my cortex-gnat-rts equivalent. However, it
also shows up in a native compilation.

Neither option on its own caused a problem.

Compiling from the attached source with

   gnatmake stm32-spi-dma.adb -c -u -f -gnata -fcallgraph-info=su

gives

   gcc -c -gnata -fcallgraph-info=su stm32-spi-dma.adb
     targetname: "+===========================GNAT BUG DETECTED==============================+
   | 12.0.1 20220128 (experimental) (x86_64-apple-darwin15) Assert_Failure exp_cg.adb:484|
   | No source file position information available                            |
   | Compiling stm32-spi-dma.adb                                              |
   | Please submit a bug report; see https://gcc.gnu.org/bugs/ .              |
   | 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 command that you entered.                              |
   | Also include sources listed below.                                       |
   +==========================================================================+

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

   stm32-spi-dma.adb
   stm32-spi-dma.ads
   stm32-spi.ads
   stm32.ads
   hal.ads
   stm32_svd.ads
   stm32_svd-spi.ads
   hal-spi.ads
   stm32-dma.ads
   stm32_svd-dma.ads
   stm32-dma-interrupts.ads
Comment 1 Eric Botcazou 2022-03-24 09:05:19 UTC
Indeed, best not to mix both options for now.
Comment 2 simon 2024-02-25 18:11:24 UTC
This doesn’t occur in 12.2.0 or 13.1.0, but has reappeared in gcc version 14.0.1 20240218 (experimental) (GCC).

New reproducer uploaded (same files, new content).

gcc -c -gnata -fcallgraph-info=su stm32-spi-dma.adb
  targetname: "+===========================GNAT BUG DETECTED==============================+
| 14.0.1 20240218 (experimental) (x86_64-apple-darwin21) Assert_Failure exp_cg.adb:484|
| No source file position information available                            |
| Compiling stm32-spi-dma.adb                                              |
| Please submit a bug report; see https://gcc.gnu.org/bugs/ .              |
| 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 command that you entered.                              |
| Also include sources listed below.                                       |
+==========================================================================+

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

stm32-spi-dma.adb
stm32-spi-dma.ads
stm32-spi.ads
stm32.ads
hal.ads
stm32_svd.ads
stm32_svd-spi.ads
hal-spi.ads
stm32-dma.ads
stm32_svd-dma.ads
stm32-dma-interrupts.ads

compilation abandoned
gnatmake: "stm32-spi-dma.adb" compilation error
Comment 3 simon 2024-02-25 18:12:44 UTC
Created attachment 57530 [details]
Reproducer (14.0.1)
Comment 4 Eric Botcazou 2024-02-25 19:28:31 UTC
Release branches simply do not have assertions enabled.
Comment 5 simon 2024-02-25 21:02:49 UTC
That thought occurred to me, but does that mean that if this code is compiled with a release branch Bad Things will happen? (I guess the code would probably have to get executed for that to occur)
Comment 6 Eric Botcazou 2024-02-25 21:49:27 UTC
> That thought occurred to me, but does that mean that if this code is
> compiled with a release branch Bad Things will happen? (I guess the code
> would probably have to get executed for that to occur)

It's related to -fcallgraph-info=su and this doesn't affect the generated code.