Bug 83670 - [11/12/13/14/15 Regression] m32c ICE in leaf_function_p, at final.c:4368
Summary: [11/12/13/14/15 Regression] m32c ICE in leaf_function_p, at final.c:4368
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 8.0
: P4 normal
Target Milestone: 11.5
Assignee: Not yet assigned to anyone
Keywords: ice-on-valid-code
: 81804 89515 95099 109026 (view as bug list)
Depends on:
Reported: 2018-01-03 14:19 UTC by Sebastian Huber
Modified: 2024-04-26 10:32 UTC (History)
5 users (show)

See Also:
Target: m32c-rtems5
Known to work: 4.8.3
Known to fail: 8.0
Last reconfirmed: 2019-02-26 00:00:00

Test program. (126 bytes, text/plain)
2018-01-03 14:19 UTC, Sebastian Huber
Prevent the ICE (249 bytes, patch)
2022-11-25 16:55 UTC, Andre Vehreschild
Details | Diff
ICE report (868 bytes, text/x-csrc)
2023-02-22 22:19 UTC, Michael N. Moran

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Huber 2018-01-03 14:19:25 UTC
Created attachment 43016 [details]
Test program.

m32c-rtems5-gcc -O2 test.i
during RTL pass: pro_and_epilogue
test.c: In function 'main':
test.c:16:1: internal compiler error: in leaf_function_p, at final.c:4368
0x103e7b8b leaf_function_p()
0x10c3c61f m32c_leaf_function_p
0x10c3c61f m32c_emit_prologue()
0x10dfb8e3 gen_prologue()
0x10c35e57 target_gen_prologue
0x1044e9d3 make_prologue_seq
0x1044ed67 thread_prologue_and_epilogue_insns()
0x1044f7af rest_of_handle_thread_prologue_and_epilogue
0x1044f7af execute
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Comment 1 Andrew Pinski 2019-02-26 22:16:26 UTC
*** Bug 89515 has been marked as a duplicate of this bug. ***
Comment 2 Andrew Pinski 2019-02-26 22:24:57 UTC
Exposed by https://gcc.gnu.org/ml/gcc-patches/2017-05/msg01027.html .
The value might already be cached by the time we call leaf_function_p in crtl->is_leaf which can be used here instead.

Related to the similar issue on mmix: PR 85666.
Comment 3 Andrew Pinski 2020-05-13 12:28:24 UTC
*** Bug 95099 has been marked as a duplicate of this bug. ***
Comment 4 Jakub Jelinek 2021-05-14 09:49:37 UTC
GCC 8 branch is being closed.
Comment 5 Richard Biener 2021-06-01 08:09:47 UTC
GCC 9.4 is being released, retargeting bugs to GCC 9.5.
Comment 6 Andrew Pinski 2022-02-12 21:34:53 UTC
*** Bug 81804 has been marked as a duplicate of this bug. ***
Comment 7 Richard Biener 2022-05-27 09:37:56 UTC
GCC 9 branch is being closed
Comment 8 Jakub Jelinek 2022-06-28 10:34:06 UTC
GCC 10.4 is being released, retargeting bugs to GCC 10.5.
Comment 9 Andre Vehreschild 2022-11-25 16:55:29 UTC
Created attachment 53966 [details]
Prevent the ICE

I have no clue whether the attached patch is any good. It makes compile of libgcc continue somewhat further, but then it fails when assigning registers for a jump_ins.
Comment 10 Michael N. Moran 2023-02-22 22:19:39 UTC
Created attachment 54511 [details]
ICE report

This is the -freport-bug output for an m32c build on GCC 12.1.0
Comment 11 Andrew Pinski 2023-03-05 08:03:54 UTC
*** Bug 109026 has been marked as a duplicate of this bug. ***
Comment 12 Richard Biener 2023-07-07 10:32:50 UTC
GCC 10 branch is being closed.