public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/113521] New: ICE when building swi-prolog-9.1.2 with LTO in verify_gimple_in_cfg
@ 2024-01-20  9:04 sjames at gcc dot gnu.org
  2024-01-20  9:04 ` [Bug tree-optimization/113521] " sjames at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: sjames at gcc dot gnu.org @ 2024-01-20  9:04 UTC (permalink / raw)
  To: gcc-bugs

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
```

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

* [Bug tree-optimization/113521] ICE when building swi-prolog-9.1.2 with LTO in verify_gimple_in_cfg
  2024-01-20  9:04 [Bug tree-optimization/113521] New: ICE when building swi-prolog-9.1.2 with LTO in verify_gimple_in_cfg sjames at gcc dot gnu.org
@ 2024-01-20  9:04 ` 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
  2 siblings, 0 replies; 4+ messages in thread
From: sjames at gcc dot gnu.org @ 2024-01-20  9:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Sam James <sjames at gcc dot gnu.org> ---
The original unreduced bt was:
```
/var/tmp/portage/dev-lang/swi-prolog-9.1.2-r1/work/swipl-9.1.2/packages/xpce/src/h/kernel.h:1443:20:
warning: type of ‘builtin_names’ does not match original declaration
[-Wlto-type-mismatch]
 1443 | extern struct name builtin_names[];     /* object-array of built-in's
*/
      |                    ^
/var/tmp/portage/dev-lang/swi-prolog-9.1.2-r1/work/swipl-9.1.2/packages/xpce/src/ker/name.c:58:14:
note: type ‘struct bname’ should match type ‘struct name’
   58 | struct bname builtin_names[] =
      |              ^
/var/tmp/portage/dev-lang/swi-prolog-9.1.2-r1/work/swipl-9.1.2/packages/xpce/src/ker/name.c:58:14:
note: ‘builtin_names’ was previously declared here
/var/tmp/portage/dev-lang/swi-prolog-9.1.2-r1/work/swipl-9.1.2/packages/xpce/src/ker/name.c:58:14:
note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
lto-wrapper: warning: using serial compilation of 28 LTRANS jobs
lto-wrapper: note: see the ‘-flto’ option documentation for more information
/var/tmp/portage/dev-lang/swi-prolog-9.1.2-r1/work/swipl-9.1.2/packages/xpce/src/gra/device.c:
In function ‘layoutDialogDevice’:
/var/tmp/portage/dev-lang/swi-prolog-9.1.2-r1/work/swipl-9.1.2/packages/xpce/src/gra/device.c:1526:1:
error: type mismatch in ‘array_ref’
 1526 | layoutDialogDevice(Device d, Size gap, Size bb, Size border)
      | ^
struct name

struct bname

# .MEM_1457 = VDEF <.MEM_1425>
ht_1093->refer = &builtin_names[1542];
during GIMPLE pass: fixup_cfg
/var/tmp/portage/dev-lang/swi-prolog-9.1.2-r1/work/swipl-9.1.2/packages/xpce/src/gra/device.c:1526:1:
internal compiler error: verify_gimple failed
0x55597c3245f4 verify_gimple_in_cfg(function*, bool, bool)
[...]
```

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

* [Bug lto/113521] ICE when building swi-prolog-9.1.2 with LTO in verify_gimple_in_cfg
  2024-01-20  9:04 [Bug tree-optimization/113521] New: ICE when building swi-prolog-9.1.2 with LTO in verify_gimple_in_cfg sjames at gcc dot gnu.org
  2024-01-20  9:04 ` [Bug tree-optimization/113521] " sjames at gcc dot gnu.org
@ 2024-01-20  9:12 ` pinskia at gcc dot gnu.org
  2024-01-22  9:56 ` rguenth at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-01-20  9:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note this code is definitely undefined . We should not be ICEing on it though.

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

* [Bug lto/113521] ICE when building swi-prolog-9.1.2 with LTO in verify_gimple_in_cfg
  2024-01-20  9:04 [Bug tree-optimization/113521] New: ICE when building swi-prolog-9.1.2 with LTO in verify_gimple_in_cfg sjames at gcc dot gnu.org
  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
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-01-22  9:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
It's probably the same issue though - IPA summarries not being forgiving to
decl type changes.

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

end of thread, other threads:[~2024-01-22  9:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-20  9:04 [Bug tree-optimization/113521] New: ICE when building swi-prolog-9.1.2 with LTO in verify_gimple_in_cfg sjames at gcc dot gnu.org
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

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).