public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "sjames at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/114487] New: [14 regression] ICE when building libsdl2 on -mfpmath=sse x86 with LTO
Date: Tue, 26 Mar 2024 16:04:53 +0000	[thread overview]
Message-ID: <bug-114487-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 114487
           Summary: [14 regression] ICE when building libsdl2 on
                    -mfpmath=sse x86 with LTO
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sjames at gcc dot gnu.org
  Target Milestone: ---

I'm not sure if this is really a target bug, or an LTO option merging bug. I
suspect the issue comes down to mismatch of -mfpmath=sse and -msse -msse2 - but
I may be wrong.

Here's a reduction but it might be a bad one, as there's conflicting return
types here.

```
$ cat SDL_test_fuzzer.i
void SDLTest_RandomUnitFloat() { }
```

```
$ cat testautomation-testautomation_pixels.i
void SDLTest_RunSuites();

void SDLTest_AssertPass();
float SDLTest_RandomUnitFloat();
typedef struct {
  int testCase;
} SDLTest_TestCaseReference;
typedef struct {
  char *name;
  void *testSetUp;
  SDLTest_TestCaseReference *testCases;
  void *testTearDown;
} SDLTest_TestSuiteReference;
void pixels_calcGammaRamp() {
  float gamma = SDLTest_RandomUnitFloat();
  SDLTest_AssertPass(gamma);
}
SDLTest_TestCaseReference pixelsTests[] = {(int)pixels_calcGammaRamp};
SDLTest_TestSuiteReference pixelsTestSuite = {0, pixelsTests};

int main() {
  SDLTest_TestSuiteReference *testSuites = &pixelsTestSuite;
  SDLTest_RunSuites(testSuites);
}
```

```
$ gcc -O3 -pipe -march=i686 -mfpmath=sse -flto -mmmx -msse -msse2
-fno-strict-aliasing SDL_test_fuzzer.i -fPIC -o SDL_test_fuzzer.o -c
$ gcc -O3 -march=i686 -flto -o a testautomation-testautomation_pixels.i
SDL_test_fuzzer.o
testautomation-testautomation_pixels.i: In function ‘pixels_calcGammaRamp’:
testautomation-testautomation_pixels.i:17:1: error: unrecognizable insn:
   17 | }
      | ^
(insn 6 5 7 2 (set (reg/v:SF 100 [ gamma ])
        (reg:SF 20 xmm0)) "testautomation-testautomation_pixels.i":15:17 -1
     (nil))
during RTL pass: vregs
testautomation-testautomation_pixels.i:17:1: internal compiler error: in
extract_insn, at recog.cc:2812
0x5722510f _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
       
/usr/src/debug/sys-devel/gcc-14.0.9999/gcc-14.0.9999/gcc/rtl-error.cc:108
0x57225146 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
       
/usr/src/debug/sys-devel/gcc-14.0.9999/gcc-14.0.9999/gcc/rtl-error.cc:116
0x56d46375 extract_insn(rtx_insn*)
        /usr/src/debug/sys-devel/gcc-14.0.9999/gcc-14.0.9999/gcc/recog.cc:2812
0x56d46375 instantiate_virtual_regs_in_insn
       
/usr/src/debug/sys-devel/gcc-14.0.9999/gcc-14.0.9999/gcc/function.cc:1611
0x56d46375 instantiate_virtual_regs
       
/usr/src/debug/sys-devel/gcc-14.0.9999/gcc-14.0.9999/gcc/function.cc:1994
0x56d46375 execute
       
/usr/src/debug/sys-devel/gcc-14.0.9999/gcc-14.0.9999/gcc/function.cc:2041
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://bugs.gentoo.org/> for instructions.
lto-wrapper: fatal error: gcc returned 1 exit status
compilation terminated.
/usr/lib/gcc/i686-pc-linux-gnu/14/../../../../i686-pc-linux-gnu/bin/ld: error:
lto-wrapper failed
collect2: error: ld returned 1 exit status
```

             reply	other threads:[~2024-03-26 16:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-26 16:04 sjames at gcc dot gnu.org [this message]
2024-03-27  8:36 ` [Bug target/114487] " rguenth at gcc dot gnu.org
2024-03-27  9:21 ` ubizjak at gmail dot com
2024-03-27  9:33 ` ubizjak at gmail dot com
2024-03-27  9:35 ` ubizjak at gmail dot com
2024-03-27 12:57 ` rguenth at gcc dot gnu.org
2024-03-27 13:01 ` rguenth at gcc dot gnu.org
2024-03-27 23:33 ` sjames at gcc dot gnu.org
2024-03-27 23:39 ` pinskia at gcc dot gnu.org
2024-03-27 23:44 ` pinskia at gcc dot gnu.org
2024-03-27 23:45 ` pinskia at gcc dot gnu.org
2024-03-28  4:17 ` sjames at gcc dot gnu.org
2024-03-28  4:17 ` sjames at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-114487-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).