public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/105950] New: >  O2 optimization causes runtime (SIGILL) during main initialization
@ 2022-06-13 14:17 jkanapes at yahoo dot com
  2022-06-13 15:35 ` [Bug c/105950] " redi at gcc dot gnu.org
                   ` (38 more replies)
  0 siblings, 39 replies; 40+ messages in thread
From: jkanapes at yahoo dot com @ 2022-06-13 14:17 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105950
           Summary: >  O2 optimization causes runtime (SIGILL) during main
                    initialization
           Product: gcc
           Version: 9.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jkanapes at yahoo dot com
  Target Milestone: ---

Created attachment 53128
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53128&action=edit
gcc -v -save -temps

Recently upgraded to Ubuntu 20.04, and a program that compiled & ran fine in
Ubuntu 14.04, now coredumps in execution when optimization greater than -O2 is
used during compilation. No warnings in compilation.
When compiled with -O3 -g flags I get gdb output to the offending code
(SIGILL):
size_t channel = 0;
uhd_stream_args_t stream_args =
                      {
                         .cpu_format = "fc32",
                         .otw_format = "sc16",
                         .args = "",
                         .channel_list = &channel,
                         .n_channels = 1
                      };
uhd_stream_atgs_t is defined in the included header:
typedef struct {
    //! Format of host memory
    char* cpu_format;
    //! Over-the-wire format
    char* otw_format;
    //! Other stream args
    char* args;
    //! Array that lists channels
    size_t* channel_list;
    //! Number of channels
    int n_channels;
} uhd_stream_args_t;

The offending code is the next block. This initialization code used to work
fine. It bow works fine with -O2 or less optimization. It compiles fine. Why
does gcc create the wrong executable?

Attaching the gcc -v -save-temps output

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

end of thread, other threads:[~2022-06-15 14:29 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-13 14:17 [Bug c/105950] New: > O2 optimization causes runtime (SIGILL) during main initialization jkanapes at yahoo dot com
2022-06-13 15:35 ` [Bug c/105950] " redi at gcc dot gnu.org
2022-06-13 16:40 ` jkanapes at yahoo dot com
2022-06-13 17:02 ` jakub at gcc dot gnu.org
2022-06-13 17:18 ` jkanapes at yahoo dot com
2022-06-13 17:21 ` jkanapes at yahoo dot com
2022-06-13 19:31 ` redi at gcc dot gnu.org
2022-06-13 19:32 ` redi at gcc dot gnu.org
2022-06-14  4:13 ` jkanapes at yahoo dot com
2022-06-14  8:16 ` rguenth at gcc dot gnu.org
2022-06-14  9:14 ` redi at gcc dot gnu.org
2022-06-14  9:27 ` jkanapes at yahoo dot com
2022-06-14  9:36 ` jakub at gcc dot gnu.org
2022-06-14 10:04 ` jkanapes at yahoo dot com
2022-06-14 10:15 ` jkanapes at yahoo dot com
2022-06-14 11:35 ` redi at gcc dot gnu.org
2022-06-14 12:05 ` jkanapes at yahoo dot com
2022-06-14 12:12 ` jakub at gcc dot gnu.org
2022-06-14 12:19 ` redi at gcc dot gnu.org
2022-06-14 12:32 ` jkanapes at yahoo dot com
2022-06-14 12:42 ` jkanapes at yahoo dot com
2022-06-14 12:52 ` redi at gcc dot gnu.org
2022-06-14 13:02 ` jkanapes at yahoo dot com
2022-06-14 14:42 ` jkanapes at yahoo dot com
2022-06-14 15:30 ` sam at gentoo dot org
2022-06-14 15:36 ` redi at gcc dot gnu.org
2022-06-14 16:56 ` jkanapes at yahoo dot com
2022-06-15 11:18 ` jkanapes at yahoo dot com
2022-06-15 11:30 ` jakub at gcc dot gnu.org
2022-06-15 12:19 ` jkanapes at yahoo dot com
2022-06-15 12:26 ` jkanapes at yahoo dot com
2022-06-15 12:27 ` sam at gentoo dot org
2022-06-15 12:29 ` jkanapes at yahoo dot com
2022-06-15 12:32 ` sam at gentoo dot org
2022-06-15 12:42 ` jkanapes at yahoo dot com
2022-06-15 12:48 ` jkanapes at yahoo dot com
2022-06-15 13:15 ` jkanapes at yahoo dot com
2022-06-15 13:20 ` jakub at gcc dot gnu.org
2022-06-15 14:23 ` jkanapes at yahoo dot com
2022-06-15 14:29 ` 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).