Bug 113197 - [12/13/14/15 Regression] ICE in in handle_call_arg, at tree-ssa-structalias.cc:4119
Summary: [12/13/14/15 Regression] ICE in in handle_call_arg, at tree-ssa-structalias.c...
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: ipa (show other bugs)
Version: 14.0
: P2 normal
Target Milestone: 12.4
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code, lto, needs-bisection
Depends on:
Blocks:
 
Reported: 2024-01-02 11:02 UTC by Matthias Klose
Modified: 2024-04-26 10:55 UTC (History)
6 users (show)

See Also:
Host:
Target:
Build:
Known to work: 13.2.1
Known to fail: 14.0
Last reconfirmed: 2024-01-09 00:00:00


Attachments
reduced test case (343.76 KB, application/x-compressed-tar)
2024-01-02 16:13 UTC, Matthias Klose
Details
reduced test case (1.57 KB, application/gzip)
2024-01-02 18:04 UTC, Matthias Klose
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Klose 2024-01-02 11:02:05 UTC
seen with trunk 20240101 building the conntrack-tools package with LTO enabled, seen on different architectures:

during GIMPLE pass: alias
../extensions/libct_proto_udp.c: In function 'final_check':
../extensions/libct_proto_udp.c:162:13: internal compiler error: in handle_call_arg, at tree-ssa-structalias.cc:4119
  162 | static void final_check(unsigned int flags,
      |             ^
0x95f3ee handle_call_arg
        ../../src/gcc/tree-ssa-structalias.cc:4119
0x1c7c620 handle_rhs_call
        ../../src/gcc/tree-ssa-structalias.cc:4344
0x1c5ef69 find_func_aliases_for_call
        ../../src/gcc/tree-ssa-structalias.cc:5018
0x1c5ef69 find_func_aliases
        ../../src/gcc/tree-ssa-structalias.cc:5121
0x1c5c01e compute_points_to_sets
        ../../src/gcc/tree-ssa-structalias.cc:7573
0x1c5c01e compute_may_aliases()
        ../../src/gcc/tree-ssa-structalias.cc:8027
0x1b03a70 execute_function_todo
        ../../src/gcc/passes.cc:2063
0x1a7f141 do_per_function
        ../../src/gcc/passes.cc:1687
0x1a7f141 execute_todo
        ../../src/gcc/passes.cc:2142
Please submit a full bug report, with preprocessed source (by using -freport-bug).
Comment 1 Matthias Klose 2024-01-02 16:13:00 UTC
Created attachment 56976 [details]
reduced test case

reduced test case, still requires another object file
Comment 2 Matthias Klose 2024-01-02 16:20:19 UTC
the ICE goes away, if I also build the conntrack.o object file with -fPIC
Comment 3 Matthias Klose 2024-01-02 18:04:00 UTC
Created attachment 56981 [details]
reduced test case

reduced test case, without object files.

the compiler is configured with --enable-pie
Comment 4 Richard Biener 2024-01-08 14:29:41 UTC
Looks like an issue with IPA modref and WPA?
Comment 5 Jakub Jelinek 2024-01-09 11:45:54 UTC
From the last reproducer, one doesn't really need any extra libraries.
Just
./cc1 -quiet -Wdate-time -std=gnu99 -W -Wall -Wmissing-prototypes -Wwrite-strings -Wfloat-equal -Wshadow -Wpointer-arith -Wbad-function-cast -Wsign-compare -Waggregate-return -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wstrict-prototypes -Wundef -Wno-unused-parameter -g -O2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -flto=auto -ffat-lto-objects -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection libct_proto_udp.i -fPIC
./cc1 -quiet -Wdate-time -std=gnu99 -W -Wall -Wmissing-prototypes -Wwrite-strings -Wfloat-equal -Wshadow -Wpointer-arith -Wbad-function-cast -Wsign-compare -Waggregate-return -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wstrict-prototypes -Wundef -Wno-unused-parameter -g -O2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -flto=auto -ffat-lto-objects -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection conntrack.i -fpie
./xgcc -B ./ -std=gnu99 -W -Wall -Wmissing-prototypes -Wwrite-strings -Wfloat-equal -Wshadow -Wpointer-arith -Wbad-function-cast -Wsign-compare -Waggregate-return -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wstrict-prototypes -Wundef -Wno-unused-parameter -g -O2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -flto=auto -ffat-lto-objects -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -Wl,-z -Wl,relro -o conntrack.so conntrack.i libct_proto_udp.s -v -save-temps
reproduces it.
The ICE is on
4105	  /* As an compile time optimization if we make no difference between
4106	     direct and indirect accesses make arg transitively closed.
4107	     This avoids the need to build indir arg and do everything twice.  */
4108	  if (((flags & EAF_NO_INDIRECT_CLOBBER) != 0)
4109	      == ((flags & EAF_NO_DIRECT_CLOBBER) != 0)
4110	      && (((flags & EAF_NO_INDIRECT_READ) != 0)
4111		  == ((flags & EAF_NO_DIRECT_READ) != 0))
4112	      && (((flags & EAF_NO_INDIRECT_ESCAPE) != 0)
4113		  == ((flags & EAF_NO_DIRECT_ESCAPE) != 0))
4114	      && (((flags & EAF_NOT_RETURNED_INDIRECTLY) != 0)
4115		  == ((flags & EAF_NOT_RETURNED_DIRECTLY) != 0)))
4116	    {
4117	      make_transitive_closure_constraints (tem);
4118	      callarg_transitive = true;
4119	      gcc_checking_assert (!(flags & EAF_NO_DIRECT_READ));
4120	    }
Comment 6 Jakub Jelinek 2024-01-09 11:46:30 UTC
Our bisect seed can't bisect lto though...
Comment 7 Richard Biener 2024-01-09 12:13:20 UTC
(In reply to Jakub Jelinek from comment #6)
> Our bisect seed can't bisect lto though...

Honza added this stuff.
Comment 8 Martin Jambor 2024-01-10 13:43:04 UTC
Indeed this (the reduced testcase from comment #3) can be bisected to Honza's r12-5177-g494bdadf28d0fb (Enable pure-const discovery in modref).