public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/108340] New: compiler segfault
@ 2023-01-09 11:56 julien.staub at se dot com
  2023-01-09 12:15 ` [Bug c/108340] " julien.staub at se dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: julien.staub at se dot com @ 2023-01-09 11:56 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 108340
           Summary: compiler segfault
           Product: gcc
           Version: 12.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: julien.staub at se dot com
  Target Milestone: ---

Created attachment 54216
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54216&action=edit
minimal file to reproduce

To reproduce :
1. Downloaded arm-gnu-toolchain-12.2.rel1-mingw-w64-i686-arm-none-eabi.zip from
https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads
2. In attached zip, modify and run compilerBug.bat (will just compile 1 faulty
file known to work)
3. observe segmentation fault in compiler

Actual Results: What happened after performing the above steps.

```
C:\FW>"C:\GIT\FW_Toolchain\GNU Tools ARM
Embedded\12.2.rel1\bin\arm-none-eabi-gcc.exe" -DSTM32U575xx=1
-IC:/FW/minimalInc -O3 -DNDEBUG -freport-bug -mcpu=cortex-m33 -mthumb
-mfpu=fpv5-sp-d16 -mfloat-abi=hard --specs=nano.specs -ffunction-sections
-fdata-sections -fno-builtin -Wall -Wfatal-errors -O3 -std=gnu17 -o
stm32u5xx_hal_dma_ex.c.obj -c C:/FW/minimalInc/stm32u5xx_hal_dma_ex.c
during GIMPLE pass: evrp
C:/FW/minimalInc/stm32u5xx_hal_dma_ex.c: In function
'HAL_DMAEx_List_ReplaceNode_Head':
C:/FW/minimalInc/stm32u5xx_hal_dma_ex.c:4689:1: internal compiler error:
Segmentation fault
 4689 | }
      | ^
Please submit a full bug report, with preprocessed source.
See <https://bugs.linaro.org/> for instructions.
The bug is not reproducible, so it is likely a hardware or OS problem.
```

It's possible to reproduce issue with only godbolt :
https://godbolt.org/z/oG8rGfG4E
and GCC 11.x to 12.2 seem affected. -O0 will not show the bug.

I also opened the bug on Linaro for arm-none-aebi-gcc build but it seems this
is a GCC issue and I did not find it bug list.
https://bugs.linaro.org/show_bug.cgi?id=5924

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

* [Bug c/108340] compiler segfault
  2023-01-09 11:56 [Bug c/108340] New: compiler segfault julien.staub at se dot com
@ 2023-01-09 12:15 ` julien.staub at se dot com
  2023-01-09 12:24 ` marxin at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: julien.staub at se dot com @ 2023-01-09 12:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Julien <julien.staub at se dot com> ---
striped even more : https://godbolt.org/z/YqoPKqoKK

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

* [Bug c/108340] compiler segfault
  2023-01-09 11:56 [Bug c/108340] New: compiler segfault julien.staub at se dot com
  2023-01-09 12:15 ` [Bug c/108340] " julien.staub at se dot com
@ 2023-01-09 12:24 ` marxin at gcc dot gnu.org
  2023-01-09 12:33 ` marxin at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2023-01-09 12:24 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |marxin at gcc dot gnu.org

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Working on that, it's fixed on master, so bisecting now.

Reduced test-case:

int DMA_List_CheckNodesBaseAddresses_pNode1,
    DMA_List_CheckNodesBaseAddresses_pNode2;
int DMA_List_CheckNodesBaseAddresses() {
  unsigned temp = ((int)&DMA_List_CheckNodesBaseAddresses_pNode1 |
                   (int)&DMA_List_CheckNodesBaseAddresses_pNode2) &
                  65535 << 16;
  int ref = (int)&DMA_List_CheckNodesBaseAddresses_pNode1;
  if (temp != (ref & 65535 << 16))
    return 1;
}

$ arm-suse-linux-gnueabi-gcc-11 pr108340.i -c -O2
during GIMPLE pass: evrp
pr108340.i: In function 'DMA_List_CheckNodesBaseAddresses':
pr108340.i:10:1: internal compiler error: Segmentation fault
   10 | }
      | ^
0x7ffff78b78df ???
       
/usr/src/debug/glibc-2.36/signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0x7ffff78a15af __libc_start_call_main
        ../sysdeps/nptl/libc_start_call_main.h:58
0x7ffff78a1678 __libc_start_main_impl
        ../csu/libc-start.c:381
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://bugs.opensuse.org/> for instructions.

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

* [Bug c/108340] compiler segfault
  2023-01-09 11:56 [Bug c/108340] New: compiler segfault julien.staub at se dot com
  2023-01-09 12:15 ` [Bug c/108340] " julien.staub at se dot com
  2023-01-09 12:24 ` marxin at gcc dot gnu.org
@ 2023-01-09 12:33 ` marxin at gcc dot gnu.org
  2023-01-09 13:46 ` julien.staub at se dot com
  2023-01-09 14:53 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2023-01-09 12:33 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
Dup.

*** This bug has been marked as a duplicate of bug 106878 ***

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

* [Bug c/108340] compiler segfault
  2023-01-09 11:56 [Bug c/108340] New: compiler segfault julien.staub at se dot com
                   ` (2 preceding siblings ...)
  2023-01-09 12:33 ` marxin at gcc dot gnu.org
@ 2023-01-09 13:46 ` julien.staub at se dot com
  2023-01-09 14:53 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: julien.staub at se dot com @ 2023-01-09 13:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Julien <julien.staub at se dot com> ---
Thank you. 
Can you please confirm if this will be fixed in 12.2.x or only in 13.0 ?

Are fixes ported to 12.x along the way or are patches chosen just before
release ?

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

* [Bug c/108340] compiler segfault
  2023-01-09 11:56 [Bug c/108340] New: compiler segfault julien.staub at se dot com
                   ` (3 preceding siblings ...)
  2023-01-09 13:46 ` julien.staub at se dot com
@ 2023-01-09 14:53 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-01-09 14:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
The trunk change caused various regressions and needed multiple follow-ups, I'm
afraid it is not a good idea to backport that.
r13-2658, r13-2709, r13-2891 at least.
Perhaps backporting the 2 match.pd hunks from r13-2658 and nothing else could
work for 12.3, provided it fixes the testcases.

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

end of thread, other threads:[~2023-01-09 14:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-09 11:56 [Bug c/108340] New: compiler segfault julien.staub at se dot com
2023-01-09 12:15 ` [Bug c/108340] " julien.staub at se dot com
2023-01-09 12:24 ` marxin at gcc dot gnu.org
2023-01-09 12:33 ` marxin at gcc dot gnu.org
2023-01-09 13:46 ` julien.staub at se dot com
2023-01-09 14:53 ` jakub 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).