[Bug analyzer/104029] New: internal compiler error with -fanalyzer-checker=taint

2022-01-14 Thread urs at akk dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104029

Bug ID: 104029
   Summary: internal compiler error with -fanalyzer-checker=taint
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: urs at akk dot org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
 Build: x86_64-pc-linux-gnu

Created attachment 52191
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52191&action=edit
preprocessed file

gcc-12 (GCC) 12.0.0 20220114 (experimental)
up to and incl. commit de196e5dd8ea4d0ed01a8c265afdd3676e27545b
configured with --program-suffix=-12 --enable-languages=c,lto --enable-lto
--disable-multilib
on x86_64-pc-linux-gnu

errors out when using

gcc-12 -DHAVE_CONFIG_H -I. -I../include -DLOCALEDIR=\"/usr/share/locale\"
-DDEBUG -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED -g
-std=c11 -O2 -Wextra -Wpedantic -pipe -Wall -Winline -Wshadow
-Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
-Wbad-function-cast -Wnested-externs -Wcast-align -Wpointer-arith
-Waggregate-return -Wcast-qual -Wwrite-strings -Wundef -Wpacked -Wfloat-equal
-Wunused-macros -Wold-style-definition -Winit-self -Wmissing-include-dirs
-Wlogical-op -Wjump-misses-init -Wformat=2 -Wshift-overflow=2
-Wnull-dereference -Wduplicated-cond -Walloc-zero -Walloca
-Wstringop-overflow=2 -Wduplicated-branches -Wno-format-nonliteral
-Wno-stringop-truncation -Wno-format-truncation -fno-diagnostics-color
-fdiagnostics-generate-patch -fanalyzer -fanalyzer-checker=taint

with

compiling heapsort.o
during IPA pass: analyzer
./heapsort.c: In function ‘heapsort’:
./heapsort.c:169:15: internal compiler error: in alt_get_inherited_state, at
analyzer/sm-taint.cc:652
  169 | abase = (char *)vbase - size;
  | ~~^~

[Bug analyzer/107158] New: internal compiler error: in get_or_create_cluster, at analyzer/store.cc:2832

2022-10-05 Thread urs at akk dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107158

Bug ID: 107158
   Summary: internal compiler error: in get_or_create_cluster, at
analyzer/store.cc:2832
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: urs at akk dot org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
 Build: x86_64-pc-linux-gnu

gcc build from git @ 49192c41de94b2746cd33366134b6aeaefa6ca2a
with
configure --program-suffix=-13 --enable-languages=c,lto --enable-lto
--disable-multilib
make -j 4 BOOT_CFLAGS='-pipe -O0 -w' bootstrap

on x86_64-pc-linux-gnu (Intel(R) Core(TM) i7-6700T); Ubuntu 22.04.1 LTS; GLIBC
2.35-0ubuntu3.1


gcc-13 -v -save-temps -freport-bug -I. -I../include -DHAVE_CONFIG_H -g -std=c11
-O2 -Wextra -Wpedantic -Wall -Winline -Wshadow -Wstrict-prototypes
-Wmissing-prototypes -Wmissing-declarations -Wbad-function-cast
-Wnested-externs -Wcast-align -Wpointer-arith -Waggregate-return -Wcast-qual
-Wwrite-strings -Wundef -Wpacked -Wfloat-equal -Wunused-macros
-Wold-style-definition -Winit-self -Wmissing-include-dirs -Wlogical-op
-Wjump-misses-init -Wformat=2 -Wshift-overflow=2 -Wnull-dereference
-Wduplicated-cond -Walloc-zero -Walloca -Wstringop-overflow=2
-Wduplicated-branches -Wno-format-nonliteral -Wno-stringop-truncation
-Wno-format-truncation -fanalyzer -Wno-analyzer-fd-use-without-check
-fanalyzer-call-summaries -o makecfg  ./makecfg.c

results in

during IPA pass: analyzer
./makecfg.c: In function ‘parse_tbl’:
./makecfg.c:140:25: internal compiler error: in get_or_create_cluster, at
analyzer/store.cc:2832
  140 | store_data(buffer, "");
  | ^~
0x7f3d31181d8f __libc_start_call_main
../sysdeps/nptl/libc_start_call_main.h:58
0x7f3d31181e3f __libc_start_main_impl
../csu/libc-start.c:392

without "-fanalyzer-call-summaries" it works as expected, but "complains":

/makecfg.c: In function ‘parse_tbl’:
./makecfg.c:116:1: warning: leak of ‘’ [CWE-401]
[-Wanalyzer-malloc-lea
k]
  116 | }
[...]

[Bug analyzer/107158] internal compiler error: in get_or_create_cluster, at analyzer/store.cc:2832

2022-10-05 Thread urs at akk dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107158

--- Comment #1 from urs at akk dot org ---
Created attachment 53668
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53668&action=edit
internal compiler error: in get_or_create_cluster, at analyzer/store.cc:2832

[Bug analyzer/107158] False postives from -Wanalyzer-malloc-leak on tin-2.6.2

2022-10-05 Thread urs at akk dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107158

--- Comment #5 from urs at akk dot org ---
Now (git @ e99dcbb54e07b798c3353124f38336f96a826d43; same $CFLAGS and source
file)

during IPA pass: analyzer
./makecfg.c: In function ‘parse_tbl’:
./makecfg.c:150:25: internal compiler error: in bind_key, at
analyzer/store.cc:1356
  150 | store_data(buffer, s);
  | ^
0x7fec3b172d8f __libc_start_call_main
../sysdeps/nptl/libc_start_call_main.h:58
0x7fec3b172e3f __libc_start_main_impl
../csu/libc-start.c:392

[Bug analyzer/107225] New: FP with -Wanalyzer-mismatching-deallocation

2022-10-11 Thread urs at akk dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107225

Bug ID: 107225
   Summary: FP with -Wanalyzer-mismatching-deallocation
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: urs at akk dot org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
 Build: x86_64-pc-linux-gnu

gcc build from git @ ab332cd78d083edb2fddaa3c02578cafade12725
with
configure --program-suffix=-13 --enable-languages=c,lto --enable-lto
--disable-multilib
make -j 4 BOOT_CFLAGS='-pipe -O0 -w' bootstrap

on x86_64-pc-linux-gnu (Intel(R) Core(TM) i7-6700T); Ubuntu 22.04.1 LTS; GLIBC
2.35-0ubuntu3.1

The somewhat reduced testcase shows (besides other stuff) a false positive with
gcc-13 -v -save-temps -freport-bug -g -O2 -Wextra -Wpedantic -pipe -Wall
-Winline -Wshadow -Wstrict-prototypes -Wmissing-prototypes
-Wmissing-declarations -Wbad-function-cast -Wnested-externs -Wcast-align
-Wpointer-arith -Waggregate-return -Wcast-qual -Wwrite-strings -Wundef -Wpacked
-Wfloat-equal -Wunused-macros -Wold-style-definition -Winit-self
-Wmissing-include-dirs -Wlogical-op -Wjump-misses-init -Wformat=2
-Wshift-overflow=2 -Wnull-dereference -Wduplicated-cond -Walloc-zero -Walloca
-Wstringop-overflow=2 -Wduplicated-branches -Wno-format-nonliteral
-Wno-stringop-truncation -Wno-format-truncation -fanalyzer -c fp.c -o fp.o


fp.c:83:25: warning: ‘fp’ should have been deallocated with ‘fclose’ but was
deallocated with ‘pclose’ [CWE-762] [-Wanalyzer-mismatching-deallocation]
   83 | pclose(fp);
  | ^~

looks like the analyzer doesn't notice that it took the false branch in line 51
and thus has to take the false branch in line 82 again

[Bug analyzer/107225] FP with -Wanalyzer-mismatching-deallocation

2022-10-11 Thread urs at akk dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107225

--- Comment #1 from urs at akk dot org ---
Created attachment 53694
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53694&action=edit
reduced test case for FP with -fanalyzer (-Wanalyzer-mismatching-deallocation,
-Wanalyzer-file-leak)

[Bug analyzer/107711] New: internal compiler error: Segmentation fault

2022-11-15 Thread urs at akk dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107711

Bug ID: 107711
   Summary: internal compiler error: Segmentation fault
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: urs at akk dot org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
 Build: x86_64-pc-linux-gnu

Created attachment 53904
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53904&action=edit
internal compiler error: Segmentation fault

gcc build from git @ 6052482f841634522c6d2e56c4231f8df2dc6d3e
with
configure --program-suffix=-13 --enable-languages=c,lto --enable-lto
--disable-multilib
make -j 4 BOOT_CFLAGS='-pipe -O0 -w' bootstrap

on x86_64-pc-linux-gnu (Intel(R) Core(TM) i7-6700T); Ubuntu 22.04.1 LTS; GLIBC
2.35-0ubuntu3.1

gcc-13 -I. -I../include -DHAVE_CONFIG_H -DDEBUG -g -std=c11 -O2 -Wextra
-Wpedantic -Wall -Winline -Wshadow -Wstrict-prototypes -Wmissing-prototypes
-Wmissing-declarations -Wbad-function-cast -Wnested-externs -Wcast-align
-Wpointer-arith -Waggregate-return -Wcast-qual -Wwrite-strings -Wundef -Wpacked
-Wfloat-equal -Wunused-macros -Wold-style-definition -Winit-self
-Wmissing-include-dirs -Wlogical-op -Wjump-misses-init -Wformat=2
-Wshift-overflow=2 -Wnull-dereference -Wduplicated-cond -Walloc-zero -Walloca
-Wstringop-overflow=2 -Wduplicated-branches -Wno-format-nonliteral
-Wno-stringop-truncation -Wno-format-truncation -fanalyzer -o makecfg 
./makecfg.c

results in

./makecfg.c: At top level:
./makecfg.c:552:1: internal compiler error: Segmentation fault
  552 | }
  | ^
0x7feba1f0151f ???
./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0x7feba1ee8d8f __libc_start_call_main
../sysdeps/nptl/libc_start_call_main.h:58
0x7feba1ee8e3f __libc_start_main_impl
../csu/libc-start.c:392
Please submit a full bug report, with preprocessed source (by using
-freport-bug).

I can't see the issue with additional "-v -save-temps -freport-bug" or without
"-fanalyzer".

[Bug analyzer/107711] internal compiler error: Segmentation fault

2022-11-16 Thread urs at akk dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107711

--- Comment #2 from urs at akk dot org ---
On Wed, Nov 16, 2022 at 02:41:40PM +, dmalcolm at gcc dot gnu.org wrote:
> Unfortunately I can't reproduce the ICE with the attachment.

Yes, attachment was created with "-v -save-temps -freport-bug" and with that
the crash doesn't show up.

Plain source is

but it needs a few makros like FreeIfNeeded from

which needs autoconf.h ... and so on

> I have a suspicion that this relates to commits r13-4073-gd8aba860b34203 
> and/or
> r13-4074-g86a90006864840 and that it relates to accessing preprocessor macros
> for named constants relating to file descriptors.
> 
> To confirm this hypothesis, does the crash go away if you first use -E to run
> the preprocessor on its own, and then use -fanalyzer on the preprocessed
> source? (with the same other options as before)

gcc-13 -E -I. -I../include -DHAVE_CONFIG_H -DDEBUG -o makecfg.i ./makecfg.c
gcc-13 -g -std=c11 -O2 -Wextra -Wpedantic -Wall -Winline -Wshadow
-Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
-Wbad-function-cast -Wnested-externs -Wcast-align -Wpointer-arith
-Waggregate-return -Wcast-qual -Wwrite-strings -Wundef -Wpacked -Wfloat-equal
-Wunused-macros -Wold-style-definition -Winit-self -Wmissing-include-dirs
-Wlogical-op -Wjump-misses-init -Wformat=2 -Wshift-overflow=2
-Wnull-dereference -Wduplicated-cond -Walloc-zero -Walloca
-Wstringop-overflow=2 -Wduplicated-branches -Wno-format-nonliteral
-Wno-stringop-truncation -Wno-format-truncation -fanalyzer -o makecfg
./makecfg.i

works fine (, but then make fails on the next input file, again on the last
curly brace in the file):

compiling heapsort.o
./heapsort.c:187:1: internal compiler error: Segmentation fault
  187 | }
  | ^
0x7fd658e6251f ???
./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0x7fd658e49d8f __libc_start_call_main
../sysdeps/nptl/libc_start_call_main.h:58
0x7fd658e49e3f __libc_start_main_impl
../csu/libc-start.c:392


niko% wc -l makecfg.c heapsort.c 
  552 makecfg.c
  188 heapsort.c

HTH,
urs

[Bug analyzer/107711] internal compiler error: Segmentation fault

2022-11-16 Thread urs at akk dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107711

--- Comment #5 from urs at akk dot org ---
On Wed, Nov 16, 2022 at 03:54:54PM +, dmalcolm at gcc dot gnu.org wrote:
> If you're familiar with gdb, would you be able to reproduce the crasher under
> gdb, by adding:
>   -wrapper gdb,--args
> to the crashing gcc invocation, and getting a backtrace at the point of the
> crash.

Program received signal SIGSEGV, Segmentation fault.
0x00cf0871 in LINEMAPS_USED(line_maps const*, bool) ()
(gdb) bt
#0  0x00cf0871 in LINEMAPS_USED(line_maps const*, bool) ()
#1  0x02e50aa3 in LINEMAPS_MACRO_USED(line_maps const*) ()
#2  0x02e50adc in LINEMAPS_MACRO_LOWEST_LOCATION(line_maps const*) ()
#3  0x02e7cd2e in linemap_location_from_macro_expansion_p(line_maps
const*, unsigned int) ()
#4  0x02e7c49d in linemap_lookup(line_maps const*, unsigned int) ()
#5  0x02e7f752 in _cpp_warn_if_unused_macro ()
#6  0x02e8a46d in ht_forall(ht*, int (*)(cpp_reader*, ht_identifier*,
void const*), void const*) ()
#7  0x02e6d9e6 in cpp_forall_identifiers(cpp_reader*, int
(*)(cpp_reader*, cpp_hashnode*, void*), void*) ()
#8  0x02e6f1b2 in cpp_finish(cpp_reader*, _IO_FILE*) ()
#9  0x00d26427 in c_common_finish() ()
#10 0x0151a5f5 in finalize(bool) ()
#11 0x0151a966 in do_compile(bool) ()
#12 0x0151ad0e in toplev::main(int, char**) ()
#13 0x02dded3e in main ()

> Otherwise, would you be able to try rebuilding gcc with attachment 53911, and
> then use -fdump-analyzer, which with that patch ought to dump which name it's
> failing on (the dump is written to SOURCEFILE.analyzer.txt).

See attachment

[Bug analyzer/107711] internal compiler error: Segmentation fault

2022-11-16 Thread urs at akk dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107711

--- Comment #6 from urs at akk dot org ---
Created attachment 53913
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53913&action=edit
head of fanalyzer-dump with patch from 53911

[Bug analyzer/107158] False postives from -Wanalyzer-malloc-leak on tin-2.6.2

2022-11-24 Thread urs at akk dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107158

--- Comment #9 from urs at akk dot org ---
After commit ce917b0422c145779b83e005afd8433c0c86fb06 this doesn't show up
anymore.

[Bug analyzer/114791] New: analyzer: file-leak not detected

2024-04-20 Thread urs at akk dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114791

Bug ID: 114791
   Summary: analyzer: file-leak not detected
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: urs at akk dot org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
 Build: x86_64-pc-linux-gnu

Created attachment 57998
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57998&action=edit
minimal test case

False negative -Wanalyzer-file-leak

gcc build from git @ ef2392236ec629351496d7f299d6a0956080e4d9

gcc-14 -D_DEFAULT_SOURCE -Wall -Wextra -fanalyzer -O2 -v -save-temps
-freport-bug -g -std=c11 -o fleak file-leak.c

doesn't give a warning but it should (value of fp may be overwritten before
released).

[Bug analyzer/114791] analyzer: file-leak not detected

2024-04-20 Thread urs at akk dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114791

--- Comment #1 from Urs Janßen  ---
Created attachment 57999
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57999&action=edit
preprocessed example

[Bug analyzer/114791] analyzer: file-leak not detected

2024-04-20 Thread urs at akk dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114791

--- Comment #3 from Urs Janßen  ---
Comment on attachment 57998
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57998
minimal test case

>#include 
>#include 
>#include 
>#include 
>
>int main(void);
>
>int main(void) {
>FILE *fp = (FILE *) 0;
>int i = 0;
>static const char *list[] = { "/tmp/", "/tmp/a", "/tmp/b", NULL };
>struct stat st;
>
>while (list[i] != NULL) {
>if ((fp = fopen(list[i], "r")) != NULL) {

should be 
if ((fp = fopen(list[i++], "r")) != NULL) {

>if (fstat(fileno(fp), &st) != -1) {
>if ((st.st_mode & (S_IFREG | S_IFLNK)) && st.st_size > 0L)
>break;
>}
>/* missing:
>fclose(fp);
>fp = NULL;
>here */
>}
>}
>
>if (fp)
>fclose(fp);
>}

[Bug analyzer/114791] analyzer: file-leak not detected

2024-04-21 Thread urs at akk dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114791

--- Comment #5 from Urs Janßen  ---
-Wanalyzer-fd-leak has the same issue, no warning given for:

#define _DEFAULT_SOURCE 1
#include 
#include 
#include 
#include 
#include 

int main(void);

int main(void) {
int fd = -1;
int i = 0;
static const char *list[] = { "/tmp/", "/tmp/a", "/tmp/b", NULL };
struct stat st;

while (list[i] != NULL) {
if ((fd = open(list[i++], O_RDONLY)) != -1) {
if (fstat(fd, &st) != -1) {
if ((st.st_mode & (S_IFREG | S_IFLNK)) && st.st_size > 0L)
break;
}
#ifdef NO_FILE_LEAK
close(fd);
fd = -1;
#endif /* NO_FILE_LEAK */
}
}

if (fd != -1)
close(fd);
}

[Bug analyzer/109120] New: False positive -Wanalyzer-malloc-leak with failed iconv_open()

2023-03-13 Thread urs at akk dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109120

Bug ID: 109120
   Summary: False positive -Wanalyzer-malloc-leak with failed
iconv_open()
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: urs at akk dot org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
 Build: x86_64-pc-linux-gnu

Created attachment 54660
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54660&action=edit
minimal test case

gcc build from git @ a9835599fdb56f33da23e4514a9e21d8c2d51d71

with

configure --program-suffix=-13 --enable-languages=c,lto --enable-lto
--disable-multilib --enable-default-pie
make -j 12 BOOT_CFLAGS='-pipe -O0 -w' bootstrap

on

x86_64-pc-linux-gnu (AMD Ryzen 7 PRO 6850U); Debian GNU/Linux 12 (bookworm); 
Kernel 6.1.0-4-amd64; GLIBC 2.36-8

gcc-13 -v -save-temps -freport-bug -g -std=c11 -O0 -fanalyzer -c iconv.c -o
iconv

results in

iconv.c: In function ‘t’:
iconv.c:11:5: warning: leak of ‘cd’ [CWE-401] [-Wanalyzer-malloc-leak]
   11 | return;
  | ^~
  ‘t’: events 1-2
|
|8 | if ((cd = iconv_open("From", "To")) != (iconv_t) (-1)) {
|  |~  ^~~~
|  ||  |
|  ||  (1) allocated here
|  |(2) following ‘false’ branch (when ‘cd ==
18446744073709551615’)...
|
  ‘t’: event 3
|
|cc1:
| (3): ...to here
|
  ‘t’: event 4
|
|   11 | return;
|  | ^~
|  | |
|  | (4) ‘cd’ leaks here; was allocated at (1)
|

[Bug bootstrap/112643] Failure to build libitm with --disable-bootstrap after r14-5607-g2f8f7ee2db82a3

2023-11-20 Thread urs at akk dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112643

urs at akk dot org changed:

   What|Removed |Added

 CC||urs at akk dot org

--- Comment #6 from urs at akk dot org ---
Same here after 2f8f7ee2db82a315f9faf8b306d6203ca7f7b002 bootstrapping on
x86_64-pc-linux-gnu (CPU: AMD Ryzen 7 PRO 6850U) with

configure --program-suffix=-14 --enable-languages=c,lto --enable-lto
--disable-multilib --enable-default-pie
make -j 12 BOOT_CFLAGS='-pipe -O0 -w' bootstrap

fails:

In file included from /home/urs/src/gcc/gcc/include/immintrin.h:103,
 from /home/urs/src/gcc/gcc/include/x86intrin.h:32,
 from
/home/urs/src/gcc/../gcc-src/libitm/config/x86/target.h:26,
 from /home/urs/src/gcc/../gcc-src/libitm/libitm_i.h:74,
 from /home/urs/src/gcc/../gcc-src/libitm/clone.cc:25:
/home/urs/src/gcc/gcc/include/avx512vp2intersectvlintrin.h: In function ‘void
_mm_2intersect_epi32(__m128i, __m128i, __mmask8*, __mmask8*)’:
/home/urs/src/gcc/gcc/include/avx512vp2intersectvlintrin.h:42:3: error:
‘__builtin_ia32_2intersectd128’ was not declared in this scope; did you mean
‘__builtin_ia32_2intersectd512’?
   42 |   __builtin_ia32_2intersectd128 (__U, __M, (__v4si) __A, (__v4si) __B);
  |   ^
  |   __builtin_ia32_2intersectd512
[...]

[Bug bootstrap/112643] [14 regression] failure to build libitm with --disable-bootstrap after r14-5607-g2f8f7ee2db82a3

2023-11-20 Thread urs at akk dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112643

--- Comment #11 from urs at akk dot org ---
I'm using 
gcc -v   
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-linux-gnu/13/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 13.2.0-6'
--with-bugurl=file:///usr/share/doc/gcc-13/README.Bugs
--enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr
--with-gcc-major-version-only --program-suffix=-13
--program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id
--libexecdir=/usr/libexec --without-included-gettext --enable-threads=posix
--libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-gnu-unique-object
--disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib
--enable-libphobos-checking=release --with-target-system-zlib=auto
--enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet
--with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32
--enable-multilib --with-tune=generic
--enable-offload-targets=nvptx-none=/build/reproducible-path/gcc-13-13.2.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/reproducible-path/gcc-13-13.2.0/debian/tmp-gcn/usr
--enable-offload-defaulted --without-cuda-driver --enable-checking=release
--build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
--with-build-config=bootstrap-lto-lean --enable-link-serialization=2
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.2.0 (Debian 13.2.0-6) 

with

CFLAGS="-pipe -O1 -march=native -w"
CXXFLAGS="-pipe -O1 -march=native -w"

[Bug target/112643] [14 regression] including x86intrin.h is broken for -march=native (which adds -mno-avx10.1-256 )

2023-11-22 Thread urs at akk dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112643

--- Comment #25 from urs at akk dot org ---
(In reply to Haochen Jiang from comment #24)
> Patch aims to fix that:
> 
> https://gcc.gnu.org/pipermail/gcc-patches/2023-November/637865.html

Yes, that solved the issue for me. Thanks.