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 tree-optimization/113521] New: ICE when building swi-prolog-9.1.2 with LTO in verify_gimple_in_cfg
Date: Sat, 20 Jan 2024 09:04:19 +0000	[thread overview]
Message-ID: <bug-113521-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 113521
           Summary: ICE when building swi-prolog-9.1.2 with LTO in
                    verify_gimple_in_cfg
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sjames at gcc dot gnu.org
                CC: arsen at gcc dot gnu.org
  Target Milestone: ---

Trying again - PR113520 was my first reduction for this but ended up being a
different problem.

ICE when building swi-prolog-9.1.2 with LTO.

object.c.i:
```
extern int builtin_names[];
void vm_send();
void freeObject() { vm_send(0, &builtin_names[6]); }
```

passing.c.i:
```
typedef void *Any;
int *vm_send_g_0;
void assignField();
void pceExecuteGoal() { assignField(); }
void vm_send(Any, int *selector, Any) { vm_send_g_0 = selector; }
```

self.c.i:
```
struct {
} builtin_names[];
__attribute__((visibility("hidden"))) void vm_send() {}
```

```
$ gcc -O2 -flto object.c.i passing.c.i self.c.i -shared
self.c.i:2:3: warning: array ‘builtin_names’ assumed to have one element
    2 | } builtin_names[];
      |   ^~~~~~~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld:
/tmp/ccvOAHi5.o (symbol from plugin): in function `vm_send':
(.text+0x0): multiple definition of `vm_send'; /tmp/ccy7z8Z5.o (symbol from
plugin):(.text+0x0): first defined here
object.c.i:1:12: warning: type of ‘builtin_names’ does not match original
declaration [-Wlto-type-mismatch]
    1 | extern int builtin_names[];
      |            ^
self.c.i:2:3: note: ‘builtin_names’ was previously declared here
    2 | } builtin_names[];
      |   ^
self.c.i:2:3: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is
used
object.c.i: In function ‘freeObject’:
object.c.i:3:6: error: type mismatch in ‘array_ref’
    3 | void freeObject() { vm_send(0, &builtin_names[6]); }
      |      ^
int

struct
{
}

# .MEM_3 = VDEF <.MEM_1(D)>
vm_send_g_0 = &builtin_names[6];
during GIMPLE pass: fixup_cfg
object.c.i:3:6: internal compiler error: verify_gimple failed
0x562dba6085f4 verify_gimple_in_cfg(function*, bool, bool)
       
/usr/src/debug/sys-devel/gcc-14.0.1.9999/gcc-14.0.1.9999/gcc/tree-cfg.cc:5666
0x562dbbb1058c execute_function_todo
       
/usr/src/debug/sys-devel/gcc-14.0.1.9999/gcc-14.0.1.9999/gcc/passes.cc:2088
0x562dbbb1058c do_per_function
       
/usr/src/debug/sys-devel/gcc-14.0.1.9999/gcc-14.0.1.9999/gcc/passes.cc:1687
0x562dbbb1058c execute_todo
       
/usr/src/debug/sys-devel/gcc-14.0.1.9999/gcc-14.0.1.9999/gcc/passes.cc:2142
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/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld:
error: lto-wrapper failed
collect2: error: ld returned 1 exit status
```

             reply	other threads:[~2024-01-20  9:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-20  9:04 sjames at gcc dot gnu.org [this message]
2024-01-20  9:04 ` [Bug tree-optimization/113521] " sjames at gcc dot gnu.org
2024-01-20  9:12 ` [Bug lto/113521] " pinskia at gcc dot gnu.org
2024-01-22  9:56 ` rguenth 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-113521-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).