public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/105910] New: ICE: with -O1 optimization level and code calling __builtin_return_address
@ 2022-06-09 17:16 k.even-mendoza at imperial dot ac.uk
  2022-06-09 17:24 ` [Bug middle-end/105910] " pinskia at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: k.even-mendoza at imperial dot ac.uk @ 2022-06-09 17:16 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105910
           Summary: ICE: with -O1 optimization level and code calling
                    __builtin_return_address
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: k.even-mendoza at imperial dot ac.uk
  Target Milestone: ---

This code (reduced): 
===
int a;
void b() {
  a = ((long)__builtin_return_address(0) ^ (long)__builtin_return_address(0)) *
      (long)__builtin_return_address(524288);
}
int main(void) { return 0;}
===
crashed the compiler with -O1: gcc -O1 test4.c

gcc: internal compiler error: Segmentation fault signal terminated program cc1
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
See <https://gcc.gnu.org/bugs/> for instructions.

====
It works fine with other optimization levels including -O0. It happens with
gcc-11, gcc-12 and gcc-13 (tested with 20220606); with gcc-10 and below it
seems to work fine also with -O1.

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

end of thread, other threads:[~2024-04-11  2:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-09 17:16 [Bug c/105910] New: ICE: with -O1 optimization level and code calling __builtin_return_address k.even-mendoza at imperial dot ac.uk
2022-06-09 17:24 ` [Bug middle-end/105910] " pinskia at gcc dot gnu.org
2022-06-09 17:31 ` k.even-mendoza at imperial dot ac.uk
2022-06-21  5:39 ` [Bug rtl-optimization/105910] " pinskia at gcc dot gnu.org
2023-05-17 23:36 ` [Bug middle-end/105910] __builtin_return_address expansion with a large # causes a compile time issues and even ICEs sometimes pinskia at gcc dot gnu.org
2023-05-17 23:36 ` pinskia at gcc dot gnu.org
2023-05-17 23:39 ` [Bug middle-end/105910] [11/12/13/14 Regression] " pinskia at gcc dot gnu.org
2023-07-19 11:03 ` rguenth at gcc dot gnu.org
2023-10-16 14:00 ` pinskia at gcc dot gnu.org
2024-04-11  2:24 ` pinskia 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).