[Bug testsuite/116061] [15 regression] new test case gcc.dg/pr116034.c from r15-2220-gb9cefd67a2a464 fails execution on BE

2024-07-24 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116061

--- Comment #4 from Jakub Jelinek  ---
Actually not that, but
s/int g;/short int g;/

[Bug testsuite/116061] [15 regression] new test case gcc.dg/pr116034.c from r15-2220-gb9cefd67a2a464 fails execution on BE

2024-07-24 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116061

--- Comment #3 from Jakub Jelinek  ---
Ah, guess I should memcpy into short int, not int.
Does
s/static inline int/static inline short int/
fix this?

[Bug preprocessor/116047] C preprocessor bug

2024-07-23 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116047

Jakub Jelinek  changed:

   What|Removed |Added

 CC||dmalcolm at gcc dot gnu.org,
   ||jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek  ---
The compiler represents locations and even location ranges as 32-bit integers,
so for normally sized sources can encode both line and column and range
information, but with too many columns or lines gradually loses the
ranges/column information and later the line information as well.
Will defer to David for details.

[Bug tree-optimization/116034] [12/13 Regression] wrong code with memcpy() from _Complex unsigned short at -fno-strict-aliasing -O1 and above

2024-07-23 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116034

Jakub Jelinek  changed:

   What|Removed |Added

  Known to fail|14.1.1, 15.0|14.1.0
  Known to work||14.1.1, 15.0
Summary|[12/13/14/15 Regression]|[12/13 Regression] wrong
   |wrong code with memcpy()|code with memcpy() from
   |from _Complex unsigned  |_Complex unsigned short at
   |short at|-fno-strict-aliasing -O1
   |-fno-strict-aliasing -O1|and above
   |and above   |

--- Comment #11 from Jakub Jelinek  ---
Fixed for 14.2+/15+ for now.

[Bug target/116029] Linux kernel doesn't build with gcc 11.5.0

2024-07-23 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116029

--- Comment #5 from Jakub Jelinek  ---
Good idea.

[Bug c++/116020] Incorrect treatment of (this void) parameter

2024-07-22 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116020

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek  ---
To me this looks just like a bug in the standard that should be fixed.

[Bug tree-optimization/116034] [12/13/14/15 Regression] wrong code with memcpy() from _Complex unsigned short at -fno-strict-aliasing -O1 and above

2024-07-22 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116034

Jakub Jelinek  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |jakub at gcc dot gnu.org

--- Comment #7 from Jakub Jelinek  ---
Created attachment 58723
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58723=edit
gcc15-pr116034.patch

Full untested patch.

[Bug tree-optimization/116034] [12/13/14/15 Regression] wrong code with memcpy() from _Complex unsigned short at -fno-strict-aliasing -O1 and above

2024-07-22 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116034

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #5 from Jakub Jelinek  ---
Started with r7-2818-gebfa15ab654738fcc926a506b3788a303958fa02

[Bug c/116016] enhancement: add __builtin_set_counted_by(P->FAM, COUNT) or equivalent

2024-07-22 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116016

--- Comment #8 from Jakub Jelinek  ---
It doesn't matter how it is documented, what matters is how it is implemented.
E.g. can you do (__builtin_call_with_static_chain) (fn, ptr)?
Or __typeof (__builtin_call_with_static_chain)?
Regular builtins are what is defined in builtins.def.

[Bug c/116016] enhancement: add __builtin_set_counted_by(P->FAM, COUNT) or equivalent

2024-07-22 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116016

--- Comment #6 from Jakub Jelinek  ---
That is a bad example, __builtin_call_with_static_chain is not a builtin
function, but a keyword.

[Bug c/116016] enhancement: add __builtin_set_counted_by(P->FAM, COUNT) or equivalent

2024-07-22 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116016

--- Comment #4 from Jakub Jelinek  ---
That is not a prototype.  Prototype is what is the C or C++ function type of
the builtin.  Neither ptr->FAM nor const_exp_with_int_type are valid C types.
There is no reason why the second argument should be const, it can be anything
convertible to whatever type size_t has, including say for C++ classes with
operator long (), _Bool/bool, enumerators, floating point expressions, ...

[Bug target/116029] Linux kernel doesn't build with gcc 11.5.0

2024-07-22 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116029

Jakub Jelinek  changed:

   What|Removed |Added

 Resolution|--- |WONTFIX
 Status|UNCONFIRMED |RESOLVED

--- Comment #3 from Jakub Jelinek  ---
So, the problem is that with the addition of TARGET_CPU_grace,
TARGET_CPU_generic is now 64, which causes problems, because of
return _cores[TARGET_CPU_DEFAULT & 0x3f];
or
#define TARGET_CPU_DEFAULT \
 (TARGET_CPU_generic | (AARCH64_CPU_DEFAULT_FLAGS << 6))

As pointed out by Sam James, this was fixed in GCC 12 with
r12-8060-g5522dec054cb940fe83661b96249aa12c54c1d77
Tested a backport of this or even backport thereof with
#define TARGET_CPU_NBITS 8
replaced with
#define TARGET_CPU_NBITS 7
fixes this.
Unfortunately, this can't be fixed anymore for 11.5 as the branch is closed.

[Bug target/116029] Linux kernel doesn't build with gcc 11.5.0

2024-07-22 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116029

--- Comment #2 from Jakub Jelinek  ---
First differences are in the veclower21 dump in several functions.

[Bug target/116029] Linux kernel doesn't build with gcc 11.5.0

2024-07-22 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116029

Jakub Jelinek  changed:

   What|Removed |Added

 CC||ktkachov at gcc dot gnu.org
 Target||aarch64-linux

--- Comment #1 from Jakub Jelinek  ---
(insn/f:TI 17679 1114 18278 (set (reg/f:DI 31 sp)
(plus:DI (reg/f:DI 31 sp)
(const_int -1856 [0xf8c0])))
"drivers/gpu/drm/amd/amdgpu/../display/dc/dml2/display_mode_core.c":6266:1 125
{*adddi3_aarch64}
 (nil))
in r11-11539 compiled case in that function, while
(insn/f:TI 17679 1114 18278 (set (reg/f:DI 31 sp)
(plus:DI (reg/f:DI 31 sp)
(const_int -1856 [0xf8c0])))
"drivers/gpu/drm/amd/amdgpu/../display/dc/dml2/display_mode_core.c":6266:1 125
{*adddi3_aarch64}
 (nil))
in r11-11540.
I can reproduce both in native build
--enable-bootstrap --enable-host-pie --enable-host-bind-now
--enable-languages=c,c++,fortran,lto --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla
--enable-shared --enable-threads=posix --enable-checking=release
--with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions
--enable-gnu-unique-object --enable-linker-build-id
--with-gcc-major-version-only --enable-plugin --enable-initfini-array
--without-isl --enable-multilib --with-linker-hash-style=gnu
--enable-gnu-indirect-function --build=aarch64-redhat-linux
--with-build-config=bootstrap-lto --enable-link-serialization=1
and in a x86_64-linux to aarch64-linux cross:
--target aarch64-linux --disable-bootstrap --enable-languages=c,c++,fortran

[Bug target/116029] New: Linux kernel doesn't build with gcc 11.5.0

2024-07-22 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116029

Bug ID: 116029
   Summary: Linux kernel doesn't build with gcc 11.5.0
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

./cc1.r11-11539 -quiet -mlittle-endian -Wall -Wundef -Werror=strict-prototypes
-Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE
-Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type
-Wno-format-security -std=gnu11 -Wno-psabi -mabi=lp64
-fno-asynchronous-unwind-tables -fno-unwind-tables -mbranch-protection=none
-fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation
-Wno-format-overflow -Wno-address-of-packed-member -O2
-fno-allow-store-data-races -Wframe-larger-than=2048 -fstack-protector-strong
-Wno-main -Wno-unused-but-set-variable -Wno-unused-const-variable
-fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-stack-clash-protection
-g -fpatchable-function-entry=2 -fno-inline-functions-called-once -Wvla
-Wno-pointer-sign -Wcast-function-type -Wno-stringop-truncation
-Wno-stringop-overflow -Wno-restrict -Wno-maybe-uninitialized -Wno-array-bounds
-Wno-alloc-size-larger-than -Wimplicit-fallthrough=5 -fno-strict-overflow
-fno-stack-check -fconserve-stack -Werror=date-time
-Werror=incompatible-pointer-types -Werror=designated-init
-Wno-packed-not-aligned -mstack-protector-guard=sysreg
-mstack-protector-guard-reg=sp_el0 -mstack-protector-guard-offset=2144 -Wextra
-Wunused -Wmissing-prototypes -Wmissing-declarations -Wmissing-include-dirs
-Wold-style-definition -Wmissing-format-attribute -Wunused-but-set-variable
-Wunused-const-variable -Wstringop-truncation -Wpacked-not-aligned
-Wno-unused-parameter -Wno-type-limits -Wno-sign-compare
-Wno-missing-field-initializers -Wno-override-init -Wframe-larger-than=3072
-fsanitize=kernel-address -fasan-shadow-offset=0xdfff8000 --param
asan-globals=1 --param asan-instrumentation-with-call-threshold=1 --param
asan-instrument-allocas=1 --param asan-stack=1 display_mode_core.i -nostdinc
-g0
compiles without warnings, while
./cc1.r11-11540 -quiet -mlittle-endian -Wall -Wundef -Werror=strict-prototypes
-Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE
-Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type
-Wno-format-security -std=gnu11 -Wno-psabi -mabi=lp64
-fno-asynchronous-unwind-tables -fno-unwind-tables -mbranch-protection=none
-fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation
-Wno-format-overflow -Wno-address-of-packed-member -O2
-fno-allow-store-data-races -Wframe-larger-than=2048 -fstack-protector-strong
-Wno-main -Wno-unused-but-set-variable -Wno-unused-const-variable
-fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-stack-clash-protection
-g -fpatchable-function-entry=2 -fno-inline-functions-called-once -Wvla
-Wno-pointer-sign -Wcast-function-type -Wno-stringop-truncation
-Wno-stringop-overflow -Wno-restrict -Wno-maybe-uninitialized -Wno-array-bounds
-Wno-alloc-size-larger-than -Wimplicit-fallthrough=5 -fno-strict-overflow
-fno-stack-check -fconserve-stack -Werror=date-time
-Werror=incompatible-pointer-types -Werror=designated-init
-Wno-packed-not-aligned -mstack-protector-guard=sysreg
-mstack-protector-guard-reg=sp_el0 -mstack-protector-guard-offset=2144 -Wextra
-Wunused -Wmissing-prototypes -Wmissing-declarations -Wmissing-include-dirs
-Wold-style-definition -Wmissing-format-attribute -Wunused-but-set-variable
-Wunused-const-variable -Wstringop-truncation -Wpacked-not-aligned
-Wno-unused-parameter -Wno-type-limits -Wno-sign-compare
-Wno-missing-field-initializers -Wno-override-init -Wframe-larger-than=3072
-fsanitize=kernel-address -fasan-shadow-offset=0xdfff8000 --param
asan-globals=1 --param asan-instrumentation-with-call-threshold=1 --param
asan-instrument-allocas=1 --param asan-stack=1 display_mode_core.i -nostdinc
-g0 -fdump-tree-optimized -fdump-rtl-expand -fdump-rtl-final
drivers/gpu/drm/amd/amdgpu/../display/dc/dml2/display_mode_core.c: In function
‘dml_prefetch_check’:
drivers/gpu/drm/amd/amdgpu/../display/dc/dml2/display_mode_core.c:6707:1:
warning: the frame size of 3632 bytes is larger than 3072 bytes
[-Wframe-larger-than=]

[Bug sanitizer/115793] signed integer overflow check missing at optimization levels -O2, -O3, and -Os

2024-07-22 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115793

--- Comment #6 from Jakub Jelinek  ---
This bugreport is based on the unwarranted assumption that UBSAN reports all UB
even at higher optimization levels.  It doesn't, that is part of the tradeoff
between code speed and amount of reported issues.  We don't report all the UB
in clearly dead code even at -O0, here VRP simply figures out that the
multiplication result would be
  # RANGE [irange] int [-INF, +INF] MASK 0xe441 VALUE 0x8d9f133a
  _2 = .UBSAN_CHECK_MUL (56506, 42049);
and because that result is only used in (_2 & 65534) == 0 comparison, that
comparison is folded to 0 and so the multiplication is optimized away.
With e.g. -O2 -fsanitize=undefined, one generally gets diagnosed UB that will
still happen in the program, which won't be DCEd.

[Bug c/116016] enhancement: add __builtin_set_counted_by(P->FAM, COUNT) or equivalent

2024-07-22 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116016

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek  ---
So, what would be the prototype of the builtin?
Would it be type-generic for both arguments, i.e. effectively
void __builtin_set_counted_by (...);
which would just verify that 2 arguments are passed, the first one is some
flexible array member with counted_by argument and the second argument has some
type implicitly convertible to the type of the counted_by member?

[Bug target/116021] Ada build on Darwin: gen_il-main: Symbol not found: ___builtin_nested_func_ptr_created

2024-07-21 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116021

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #5 from Jakub Jelinek  ---
Why?  The development versions isn't something meant for long time use, one
should be prepared to upgrade that to newer snapshots and/or upcoming stable
release.
There can be major bugs in those, ABI incompatibilities like this, ...

[Bug target/116007] libquadmath fails to build with libgcc/soft-fp/quad.h:69:1: error: unable to emulate 'TF'

2024-07-20 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116007

--- Comment #7 from Jakub Jelinek  ---
That commit made --without-long-double-128 the default on
powerpc*-*-linux-musl*.
ELFv2 is one thing, but whether long double is IEEE double, IBM double double
or IEEE quad is a separate thing.  You need to look at musl what it supports.
E.g. glibc in the last few years for powerpc64le-linux supports all 3, on
powerpc64-linux or powerpc-linux just IEEE double and IBM double double.

[Bug target/116007] libquadmath fails to build with libgcc/soft-fp/quad.h:69:1: error: unable to emulate 'TF'

2024-07-19 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116007

--- Comment #5 from Jakub Jelinek  ---
See r10-4792

[Bug target/116007] libquadmath fails to build with libgcc/soft-fp/quad.h:69:1: error: unable to emulate 'TF'

2024-07-19 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116007

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #4 from Jakub Jelinek  ---
To build libquadmath on powerpc*, one needs --with-long-double-128 (and perhaps
--with-long-double-format=ieee if C library supports that), unless that is
detected automatically.
# Check if TFmode long double should be used by default or not.
# Some glibc targets used DFmode long double, but with glibc 2.4
# and later they can use TFmode.
case "$target" in
  powerpc*-*-linux* | \
  sparc*-*-linux* | \
  s390*-*-linux* | \
  alpha*-*-linux*)
AC_ARG_WITH(long-double-128,
  [AS_HELP_STRING([--with-long-double-128],
  [use 128-bit long double by default])],
  gcc_cv_target_ldbl128="$with_long_double_128", [
  case "$target" in
s390*-*-linux-musl*)
  gcc_cv_target_ldbl128=yes
  ;;
powerpc*-*-linux-musl*)
  gcc_cv_target_ldbl128=no
  ;;
*)]
  [GCC_GLIBC_VERSION_GTE_IFELSE([2], [4], [gcc_cv_target_ldbl128=yes], [
  [gcc_cv_target_ldbl128=no
  grep '^[  ]*#[]*define[   ][  ]*__LONG_DOUBLE_MATH_OPTIONAL'
\
$target_header_dir/bits/wordsize.h > /dev/null 2>&1 \
  && gcc_cv_target_ldbl128=yes
  ]])]
  [
  ;;  
  esac
  ])
;;
esac  

>From thbis, it seems powerpc musl likely doesn't have neither double double nor
IEEE quad support and so in that case you can't use --enable-libquadmath
--enable-libquadmath-support.

[Bug tree-optimization/115766] [12/13/14/15 Regression] wrong code at optimization levels -O2, -O3

2024-07-19 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115766

Jakub Jelinek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||jakub at gcc dot gnu.org
 Resolution|--- |INVALID

--- Comment #11 from Jakub Jelinek  ---
The testcase is bogus.
As documented, you can't really take address of the different union members and
access interchangeably through such pointers.
In standard C/C++, only one union element is active, access to all the others
while another one is active are UB (unless you assign to a different one and
through that activate it).  So, union type punning is not valid in standard
C/C++ at all.
GCC as an extension allows type punning through unions, but only if the union
is visible in the access path.
See https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#Type-punning

[Bug target/115982] [15 Regression] ICE: unrecognizable insn in ira_remove_insn_scratches with -mavx512vl since r15-1742

2024-07-19 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115982

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org,
   ||liuhongt at gcc dot gnu.org
Summary|ICE: unrecognizable insn in |[15 Regression] ICE:
   |ira_remove_insn_scratches   |unrecognizable insn in
   |with -mavx512vl |ira_remove_insn_scratches
   ||with -mavx512vl since
   ||r15-1742

--- Comment #3 from Jakub Jelinek  ---
Simplified testcase:
typedef float VF __attribute__((__vector_size__(16)));
typedef int VI __attribute__((__vector_size__(16)));

VI
foo (VF x)
{
  return !x;
}

Started with r15-1742-g55f80c690c5fa59836646565a9dee2a3f68374a0

[Bug c++/114460] [C++26] P3106R1 - Clarifying rules for brace elision in aggregate initialization

2024-07-19 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114460

--- Comment #5 from Jakub Jelinek  ---
Also tested GCC 4.1 and 3.2 (that time only in C++98) and it also works
expectedly.

[Bug c++/110338] Implement C++26 language features

2024-07-19 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110338
Bug 110338 depends on bug 114460, which changed state.

Bug 114460 Summary: [C++26] P3106R1 - Clarifying rules for brace elision in 
aggregate initialization
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114460

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

[Bug c++/94404] [meta-bug] C++ core issues

2024-07-19 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94404
Bug 94404 depends on bug 114460, which changed state.

Bug 114460 Summary: [C++26] P3106R1 - Clarifying rules for brace elision in 
aggregate initialization
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114460

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

[Bug c++/114460] [C++26] P3106R1 - Clarifying rules for brace elision in aggregate initialization

2024-07-19 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114460

Jakub Jelinek  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from Jakub Jelinek  ---
I've additionally tested GCC 11.5, GCC 8.5 and GCC 4.8.5 and the aggr-init1.C
test passes in all language variants that support it, had to tweak slightly the
second testcase because of differences in in effective target and dejagnu
directive format support and in the 4.8 case also for wording of one case, but
otherwise it passed.
So, I'm committing a Yes rather than a specific version which implemented this
to cxx-status.html.

[Bug c++/110343] [C++26] P2558R2 - Add @, $, and ` to the basic character set

2024-07-18 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110343

--- Comment #11 from Jakub Jelinek  ---
I've posted https://gcc.gnu.org/pipermail/gcc-patches/2024-July/657583.html
I don't think we should change the raw string handling for C23, because unlike
C++26 they didn't add the $@` chars to the basic character set, but next to it.

[Bug middle-end/115887] ICE: in gsi_insert_on_edge_immediate, at gimple-iterator.cc:849 with -O -fnon-call-exceptions -finstrument-functions and _BitInt()

2024-07-18 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115887

Jakub Jelinek  changed:

   What|Removed |Added

 Resolution|--- |FIXED
   Target Milestone|--- |14.2
 Status|ASSIGNED|RESOLVED

--- Comment #5 from Jakub Jelinek  ---
Should be fixed now for 15.1+ and 14.2+.

[Bug middle-end/115527] incorrect folding of __builtin_clear_padding()

2024-07-18 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115527

--- Comment #14 from Jakub Jelinek  ---
Should be fixed for 15.1+, 14.2+ and 11.5 for now, 13 and 12 backports to be
done later.

[Bug target/115973] PPCLE: Inefficient code for __builtin_uaddll_overflow and __builtin_addcll

2024-07-17 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115973

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek  ---
See PR43892

[Bug c++/110343] [C++26] P2558R2 - Add @, $, and ` to the basic character set

2024-07-17 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110343

Jakub Jelinek  changed:

   What|Removed |Added

 CC||redi at gcc dot gnu.org

--- Comment #9 from Jakub Jelinek  ---
I've tried to understand the preprocessor issue mentioned in the paper, but am
confused on what is the right behavior and why.

Consider
#define STR(x) #x
const char *a = "\u00b7";
const char *b = STR(\u00b7);
const char *c = "\u0041";
const char *d = STR(\u0041);
const char *e = STR(a\u00b7);
const char *f = STR(a\u0041);
const char *g = STR(a \u00b7);
const char *h = STR(a \u0041);
const char *i = "\u066d";
const char *j = STR(\u066d);
const char *k = "\u0040";
const char *l = STR(\u0040);
const char *m = STR(a\u066d);
const char *n = STR(a\u0040);
const char *o = STR(a \u066d);
const char *p = STR(a \u0040);

Neither clang nor gcc emit any diagnostics on the a, c, i and k initializers,
those are certainly valid.
g++ emits with -pedantic-errors errors on all the others, while clang++ on the
ones with STR involving \u0041, \u0040 and a\u0066d.
The chosen values are \u0040 '@' as something being changed by this paper,
\u0041 'A',
\u00b7 as an example of character which is pedantically valid in identifiers if
not at the start and \u066d s something pedantically not valid in identifiers.

Now, https://eel.is/c++draft/lex.charset#6 says that UCN used outside of a
string/character literal which corresponds to basic character set character (or
control character) is ill-formed, that would make d, f, h cases invalid for C++
and l, n, p cases invalid for C++26.

https://eel.is/c++draft/lex.name states which characters can appear at the
start of the identifier and which can appear after the start.
And https://eel.is/c++draft/lex.pptoken states that preprocessing-token is
either identifier, or tons of other things, or
"each non-whitespace character that cannot be one of the above"

Then https://eel.is/c++draft/lex.pptoken#1 says that this last category is
invalid if the preprocessing token is being converted into token.

And https://eel.is/c++draft/lex.pptoken#2 includes
"If any character not in the basic character set matches the last category, the
program is ill-formed."

Now, e.g. for the C++23 STR(\u0040) case, \u0040 is there not in the basic
character set, so valid outside of the literals (not the case anymore in
C++26), but it isn't nondigit and doesn't have XID_Start property, so it isn't
IMHO an identifier and so must be the "each non-whitespace character that
cannot be one of the above" case.
Why doesn't the above mentioned https://eel.is/c++draft/lex.pptoken#2 sentence
make that invalid?  Ignoring that, I'd say it would be then stringized and that
feels like it is what clang++ is doing.
Now, e.g. for the STR(a\u066d) case, I wonder why that isn't lexed as a
identifier
followed by \u066d "each non-whitespace character that cannot be one of the
above"
token and stringified similarly, clang++ rejects that.

What GCC libcpp seems to be doing is that if that forms_identifier_p calls
_cpp_valid_utf8 or _cpp_valid_ucn with an argument which tells it is first or
second+ in identifier, and e.g. _cpp_valid_ucn then for UCNs valid in string
literals calls
  else if (identifier_pos)
{
  int validity = ucn_valid_in_identifier (pfile, result, nst);

  if (validity == 0)
cpp_error (pfile, CPP_DL_ERROR,
   "universal character %.*s is not valid in an identifier",
   (int) (str - base), base);
  else if (validity == 2 && identifier_pos == 1)
cpp_error (pfile, CPP_DL_ERROR,
   "universal character %.*s is not valid at the start of an identifier",
   (int) (str - base), base);
}
so basically all those invalid in identifiers cases emit an error and pretend
to be valid in identifiers, rather than what e.g. _cpp_valid_utf8 does for C
but not for C++ and only for the chars completely invalid in identifiers rather
than just valid in identifiers but not at the start:
  /* In C++, this is an error for invalid character in an identifier
 because logically, the UTF-8 was converted to a UCN during
 translation phase 1 (even though we don't physically do it that
 way).  In C, this byte rather becomes grammatically a separate
 token.  */

  if (CPP_OPTION (pfile, cplusplus))
cpp_error (pfile, CPP_DL_ERROR,
   "extended character %.*s is not valid in an identifier",
   (int) (*pstr - base), base);
  else
{
  *pstr = base;
  return false;
}
The comment doesn't really match what is done in recent C++ versions because
there UCNs are translated to characters and not the other way around.

[Bug c/66425] (void) cast doesn't suppress __attribute__((warn_unused_result))

2024-07-17 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425

--- Comment #76 from Jakub Jelinek  ---
(void) casts not quieting the warning was an intentional request when the
warning has been added, I really don't think it is a good idea to change that.
The fact that clang people can't properly implement Perhaps you can ask glibc
to recategorize some of the declarations to use [[nodiscard]] instead of
__attribute__((__warn_unused_result__)), IMHO it is helpful to have different
badnesses of ignoring the result, WUR attribute should be used for the cases
where it is always or pretty much always a very severe bug, while nodiscard can
be used for the lighter cases (using the result is nice to have, but usually
nothing wrong will happen if it is ignored).
E.g. ignoring return value of realloc is pretty much always a bad idea and just
(void) realloc (...); is something that shouldn't be supported.

[Bug middle-end/115887] ICE: in gsi_insert_on_edge_immediate, at gimple-iterator.cc:849 with -O -fnon-call-exceptions -finstrument-functions and _BitInt()

2024-07-17 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115887

Jakub Jelinek  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |jakub at gcc dot gnu.org
 Status|NEW |ASSIGNED

--- Comment #2 from Jakub Jelinek  ---
Created attachment 58692
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58692=edit
gcc15-pr115887.patch

Untested fix.

[Bug middle-end/115527] incorrect folding of __builtin_clear_padding()

2024-07-16 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115527

Jakub Jelinek  changed:

   What|Removed |Added

   Assignee|qinzhao at gcc dot gnu.org |jakub at gcc dot gnu.org

--- Comment #10 from Jakub Jelinek  ---
Unfortunately that isn't enough.
I've noticed the c-c++-common/torture/builtin-clear-padding*.c tests didn't
have dg-do run directives even when I clearly expected them to be run tests,
and while this patch fixes the new test and builtin-clear-padding-1.c there,
builtin-clear-padding-5.c still fails, I think there is some bug in
clear_padding_flush.  So, ETA tomorrow.

[Bug middle-end/115527] incorrect folding of __builtin_clear_padding()

2024-07-16 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115527

--- Comment #8 from Jakub Jelinek  ---
(In reply to qinzhao from comment #6)
> --- a/gcc/gimple-fold.cc
> +++ b/gcc/gimple-fold.cc
> @@ -4815,6 +4815,7 @@ clear_padding_type (clear_padding_struct *buf, tree
> type,
>   unsigned int prev_align = buf->align;
>   HOST_WIDE_INT off = buf->off + buf->size;
>   HOST_WIDE_INT prev_sz = buf->sz;
> + HOST_WIDE_INT prev_size = buf->size;
>   clear_padding_flush (buf, true);
>   tree elttype = TREE_TYPE (type);
>   buf->base = create_tmp_var (build_pointer_type (elttype));
> @@ -4835,8 +4836,8 @@ clear_padding_type (clear_padding_struct *buf, tree
> type,
>   buf->base = base;
>   buf->sz = prev_sz;
>   buf->align = prev_align;
> - buf->size = off % UNITS_PER_WORD;
> - buf->off = off - buf->size;
> + buf->size = prev_size + nelts * fldsz;
> + buf->off = 0;
>   memset (buf->buf, 0, buf->size);
>   break;
> }

That is incorrect.
I think the right fix is
--- gcc/gimple-fold.cc.jj   2024-07-16 13:36:36.0 +0200
+++ gcc/gimple-fold.cc  2024-07-16 15:50:26.493782065 +0200
@@ -4832,6 +4832,7 @@ clear_padding_type (clear_padding_struct
  buf->off = 0;
  buf->size = 0;
  clear_padding_emit_loop (buf, elttype, end, for_auto_init);
+ off += sz;
  buf->base = base;
  buf->sz = prev_sz;
  buf->align = prev_align;
Will try to test it soon.

[Bug middle-end/115527] incorrect folding of __builtin_clear_padding()

2024-07-16 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115527

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #7 from Jakub Jelinek  ---
Testcase more appropriate for the testsuite:

/* PR middle-end/115527 */

struct T { struct S { double a; signed char b; long c; } d[3]; int e; };

int
main ()
{
  struct T t = { { { 1., 2, 3 }, { 4., 5, 6 }, { 7., 8, 9 } }, 10 };
  __builtin_clear_padding ();
  for (int i = 0; i < 3; ++i)
if (t.d[i].a != 1. + 3 * i
|| t.d[i].b != 3 * i + 2
|| t.d[i].c != 3 * i + 3)
  __builtin_abort ();
  if (t.e != 10)
__builtin_abort ();
}

[Bug middle-end/115847] SIMD attribute on a function which returns a vector causes an ICE

2024-07-10 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115847

--- Comment #3 from Jakub Jelinek  ---
Yeah, the Intel ABI for this only handles scalar
integral/pointer/enum/bool/floating point types and _Complex, and our variant
thereof doesn't even handle _Complex.
Returning arrays is returning pointers, so that works, but returning other
types should be handled like the struct cases.

[Bug sanitizer/115837] ASAN FPE on unknown address report missing

2024-07-09 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115837

--- Comment #2 from Jakub Jelinek  ---
Yeah.  You can always make it fatal by
-fno-sanitize-recover=integer-divide-by-zero
and then already the libubsan runtime will terminate the program.  But if you
choose to try to recover, the UB just happens and whatever it implies happens
too.

[Bug c++/115769] New: Implement CWG 2867 - Order of initialization for structured bindings

2024-07-03 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115769

Bug ID: 115769
   Summary: Implement CWG 2867 - Order of initialization for
structured bindings
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

I've tried to come up with a testcase for DR 2867
https://wg21.link/CWG2867
Both GCC and Clang currently pass this with -DCURRENT which is the ordering of
e, a, b initialization, but invoke T::~T () before the get methods are called
rather than after them.
This is because cp_finish_decl on the structured binding base (aka e) calls
initialize_local_var, which temporarily sets stmts_are_full_exprs_p = 1 and
finish_expr_stmt will wrap it into a CLEANUP_POINT_EXPR.
If that is not what we want, not really sure what we need to do; change
initialize_local_var, so that for DECL_DECOMPOSITION_P && DECL_DECOMP_IS_BASE
vars to set stmts_are_full_exprs_p to 0 instead of 1 and somewhere in the
callers wrap the statements from cp_finish_decl and cp_finish_decomp into a
statement list wrapped inside of CLEANUP_POINT_EXPR, something else?

// DR 2867 - Order of initialization for structured bindings
// { dg-do run { target c++11 } }
// { dg-options "" }

namespace std {
  template struct tuple_size;
  template struct tuple_element;
}

struct S {
  int a, b, c;
  static int d;
  template 
  int  ()
  {
if (d != I + 2)
  __builtin_abort ();
++d;
return I ? a : b;
  }
};
int S::d = 0;

template<> struct std::tuple_size { static const int value = 2; };
template struct std::tuple_element { using type = int; };

struct T {
  T () { if (S::d != 0) __builtin_abort (); ++S::d; }
#ifndef CURRENT
  ~T () { if (S::d != 4) __builtin_abort (); ++S::d; }
#else
  ~T () {}
#endif
};

S
foo (T)
{
  S s { 1, 2, 3 };
  if (S::d != 1)
__builtin_abort ();
  ++S::d;
  return s;
}

int
main ()
{
  auto [a, b] = foo (T {}); // { dg-warning "structured bindings only
available with" "" { target c++14_down } }
#ifndef CURRENT
  if (S::d != 5 || a != 2 || b != 1)
#else
  if (S::d != 4 || a != 2 || b != 1)
#endif
__builtin_abort ();
}

[Bug c++/115744] [C++26] P2747R2 - constexpr placement new

2024-07-03 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115744

Jakub Jelinek  changed:

   What|Removed |Added

  Attachment #58563|0   |1
is obsolete||
 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek  ---
Created attachment 58580
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58580=edit
gcc15-pr115744.patch

With the PR115754 change in, this seems mostly about the FTMs and making
placement new constexpr.
The only thing that doesn't work is the
new (p + 1) int[]{2, 3};  // error (in this paper)
case from the paper xfailed in the last testcase, the IL has there
<<< Unknown tree: expr_stmt
  (void) (TARGET_EXPR (b) + 4>>, TARGET_EXPR )>,   int * D.2643;
  <<< Unknown tree: expr_stmt
(void) (D.2643 = (int *) D.2642) >>>;
and so there is nothing that would trigger some error during constexpr
evaluation.
Shouldn't build_new_1 for maybe_constexpr_fn (current_function_decl) in the
array_p case add some extra cast to the array type it is looking for rather
than just the ultimate element type?

[Bug sanitizer/115765] [13 Regression] signed integer overflow check missing

2024-07-03 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115765

--- Comment #1 from Jakub Jelinek  ---
This is in dead code, something || 8 will always be 1 and when something
doesn't have side-effects, even -O0 performs some limited optimizations.

[Bug c++/115754] [14 Regression] C++26 ICE on constexpr new

2024-07-02 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115754

Jakub Jelinek  changed:

   What|Removed |Added

   Last reconfirmed||2024-07-02
 Blocks|110338  |
   Assignee|unassigned at gcc dot gnu.org  |jakub at gcc dot gnu.org
 Ever confirmed|0   |1
 Status|UNCONFIRMED |ASSIGNED
Summary|[14/15 Regression] C++26|[14 Regression] C++26 ICE
   |ICE on constexpr new|on constexpr new

--- Comment #3 from Jakub Jelinek  ---
Fixed for 15.1+ for now.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110338
[Bug 110338] Implement C++26 language features

[Bug c++/115747] [C++26] P3144R2 - Deleting a pointer to an incomplete type should be ill-formed

2024-07-02 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115747

Jakub Jelinek  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #10 from Jakub Jelinek  ---
Implemented for 15.1+.

[Bug c++/110338] Implement C++26 language features

2024-07-02 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110338
Bug 110338 depends on bug 115747, which changed state.

Bug 115747 Summary: [C++26] P3144R2 - Deleting a pointer to an incomplete type 
should be ill-formed
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115747

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

[Bug c++/110338] Implement C++26 language features

2024-07-02 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110338
Bug 110338 depends on bug 115745, which changed state.

Bug 115745 Summary: [C++26] P0963R3 - Structured binding declaration as a 
condition
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115745

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

[Bug c++/115745] [C++26] P0963R3 - Structured binding declaration as a condition

2024-07-02 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115745

Jakub Jelinek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #7 from Jakub Jelinek  ---
Implemented for 15.1+.

[Bug c++/115745] [C++26] P0963R3 - Structured binding declaration as a condition

2024-07-02 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115745

Jakub Jelinek  changed:

   What|Removed |Added

  Attachment #58564|0   |1
is obsolete||

--- Comment #4 from Jakub Jelinek  ---
Created attachment 58566
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58566=edit
gcc15-pr114745.patch

Bootstrap/regtest of the first patch found one testcase that needed to be
adjusted, here is an updated patch with that.

[Bug c++/115747] [C++26] P3144R2 - Deleting a pointer to an incomplete type should be ill-formed

2024-07-02 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115747

Jakub Jelinek  changed:

   What|Removed |Added

  Attachment #58560|0   |1
is obsolete||

--- Comment #7 from Jakub Jelinek  ---
Created attachment 58565
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58565=edit
gcc15-pr115747.patch

Updated patch.  Had to guard return error_mark_node for the non-SFINAE case on
!flag_permissive, otherwise it triggers an ICE (statement parsing into
error_mark_node without seen_error ()).

[Bug c++/110343] [C++26] P2558R2 - Add @, $, and ` to the basic character set

2024-07-02 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110343

--- Comment #8 from Jakub Jelinek  ---
Ed, ping again, will you post this to gcc-patches?

[Bug c++/115747] [C++26] P3144R2 - Deleting a pointer to an incomplete type should be ill-formed

2024-07-02 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115747

--- Comment #5 from Jakub Jelinek  ---
(In reply to Jason Merrill from comment #4)
> I think we want parallel changes for the vec and non-vec cases.

Of course, left those out for brevity.

> I agree that the diagnostic message needs to be different for C++26, just
> that the C++26 diagnostic should also be affected by -Wno-delete-incomplete.

So
@@ -4114,6 +4114,21 @@ build_vec_delete_1 (location_t loc, tree

   if (!COMPLETE_TYPE_P (type))
 {
+  if (cxx_dialect > cxx23)
+   {
+ if (complain & tf_error)
+   {
+ if (warn_delete_incomplete
+ && permerror (loc, "operator % used on "
+   "incomplete type"))
+   {
+ cxx_incomplete_type_diagnostic (base, type, DK_PERMERROR);
+ return error_mark_node;
+   }
+   }
+ else
+   return error_mark_node;
+   }
   if (complain & tf_warning)
{
  auto_diagnostic_group d;
then?  -Wno-delete-incomplete will make it silently accepted except during
SFINAE,
-fpermissive accepted with a warning?
And obviously I'll adjust the testsuite to whatever is chosen.

[Bug c++/115747] [C++26] P3144R2 - Deleting a pointer to an incomplete type should be ill-formed

2024-07-02 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115747

--- Comment #3 from Jakub Jelinek  ---
Do you mean something like:
@@ -4114,6 +4114,14 @@ build_vec_delete_1 (location_t loc, tree

   if (!COMPLETE_TYPE_P (type))
 {
+  if (cxx_dialect > cxx23)
+   {
+ if ((complain & tf_error)
+ && permerror (loc, "operator % used on "
+   "incomplete type"))
+   cxx_incomplete_type_diagnostic (base, type, DK_PERMERROR);
+ return error_mark_node;
+   }
   if (complain & tf_warning)
{
  auto_diagnostic_group d;
or
@@ -4114,19 +4114,22 @@ build_vec_delete_1 (location_t loc, tree

   if (!COMPLETE_TYPE_P (type))
 {
-  if (complain & tf_warning)
+  if (complain & (cxx_dialect > cxx23 ? tf_error : tf_warning))
{
  auto_diagnostic_group d;
- if (warning_at (loc, OPT_Wdelete_incomplete,
- "possible problem detected in invocation of "
- "operator %"))
+ diagnostic_t kind = cxx_dialect > cxx23 ? DK_PERMERROR : DK_WARNING;
+ if (emit_diagnostic (kind,loc, OPT_Wdelete_incomplete,
+  "possible problem detected in invocation of "
+   "operator %"))
{
- cxx_incomplete_type_diagnostic (base, type, DK_WARNING);
+ cxx_incomplete_type_diagnostic (base, type, kind);
  inform (loc, "neither the destructor nor the "
  "class-specific operator % will be called, "
  "even if they are declared when the class is defined");
}
}
+  if (cxx_dialect > cxx23)
+   return error_mark_node;
   /* This size won't actually be used.  */
   size_exp = size_one_node;
   goto no_destructor;
or something else?  I think the former is fine, the wording of the second
variant is just weird, because it isn't a possible problem, it is strictly
invalid code for C++26 and there is no need to explain what would happen in
that case.

[Bug c++/115745] [C++26] P0963R3 - Structured binding declaration as a condition

2024-07-02 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115745

Jakub Jelinek  changed:

   What|Removed |Added

  Attachment #58557|0   |1
is obsolete||

--- Comment #3 from Jakub Jelinek  ---
Created attachment 58564
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58564=edit
gcc15-pr115745.patch

Indeed, this worked in brief testing.  I'm currently bootstrapping/regtesting
the first versions of the 2 patches, once that is done, will test this.

[Bug c++/115754] [14/15 Regression] C++26 ICE on constexpr new

2024-07-02 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115754

Jakub Jelinek  changed:

   What|Removed |Added

  Known to fail||14.1.0, 15.0
   Target Milestone|--- |14.2
Summary|C++26 ICE on constexpr new  |[14/15 Regression] C++26
   ||ICE on constexpr new

[Bug c++/115754] New: C++26 ICE on constexpr new

2024-07-02 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115754

Bug ID: 115754
   Summary: C++26 ICE on constexpr new
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jakub at gcc dot gnu.org
CC: jason at gcc dot gnu.org, unassigned at gcc dot gnu.org
Depends on: 115744
Blocks: 110338
  Target Milestone: ---

+++ This bug was initially created as a clone of Bug #115744 +++

While working on the PR115744 patch, I've noticed that vanilla trunk or GCC 14
ICE on

namespace std
{
  using size_t = decltype (sizeof 0);

  template 
  struct allocator
  {
constexpr allocator () noexcept {}

constexpr T *allocate (size_t n)
{ return static_cast (::operator new (n * sizeof(T))); }

constexpr void
deallocate (T *p, size_t n)
{ ::operator delete (p); }
  };
}

constexpr void *
operator new (std::size_t, void *p) noexcept
{ return p; }

constexpr bool
foo ()
{
  std::allocator a;
  auto b = a.allocate (1);
  ::new (b) int ();
  a.deallocate (b, 1);
  return true;
}

constexpr bool a = foo ();

with -std=c++26.  Of course, the C++26 constexpr placement new support isn't
there and users shouldn't be declaring placement operator new themselves,
especially with constexpr when it is not, but still we shouldn't ICE.

Filing separately in case we want to backport it.

The fix for this in the WIP patch was the
@@ -8103,7 +8103,10 @@ cxx_eval_constant_expression (const cons
tree oldop = TREE_OPERAND (t, 0);

tree op = cxx_eval_constant_expression (ctx, oldop,
-   lval,
+   (VOID_TYPE_P (TREE_TYPE (t))
+|| (tcode == VIEW_CONVERT_EXPR
+&& lval == vc_glvalue))
+   ? lval : vc_prvalue,
non_constant_p, overflow_p);
if (*non_constant_p)
  return t;
hunk in constexpr.cc, if lval is vc_discard but we aren't really discarding the
result,
I think the void * -> something * cast code at least but most likely various
other checks rely on op being actually an rvalue.  If this is a (void) cast,
discarding it is fine, we won't process anything.  And I think
VIEW_CONVERT_EXPR can be around various VAR_DECLs on the lhs, so I think we
also need at least vc_glvalue handling for that.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110338
[Bug 110338] Implement C++26 language features
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115744
[Bug 115744] [C++26] P2747R2 - constexpr placement new

[Bug c++/115744] [C++26] P2747R2 - constexpr placement new

2024-07-02 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115744

--- Comment #1 from Jakub Jelinek  ---
Created attachment 58563
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58563=edit
gcc15-pr115744-wip.patch

Untested WIP patch.

[Bug c++/115747] [C++26] P3144R2 - Deleting a pointer to an incomplete type should be ill-formed

2024-07-02 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115747

Jakub Jelinek  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Assignee|unassigned at gcc dot gnu.org  |jakub at gcc dot gnu.org
   Last reconfirmed||2024-07-02
 Status|UNCONFIRMED |ASSIGNED

--- Comment #1 from Jakub Jelinek  ---
Created attachment 58560
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58560=edit
gcc15-pr115747.patch

Untested implementation.

[Bug c++/115745] [C++26] P0963R3 - Structured binding declaration as a condition

2024-07-02 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115745

--- Comment #1 from Jakub Jelinek  ---
Created attachment 58557
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58557=edit
gcc15-pr115745.patch

Untested implementation.

[Bug c++/115747] New: [C++26] P3144R2 - Deleting a pointer to an incomplete type should be ill-formed

2024-07-02 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115747

Bug ID: 115747
   Summary: [C++26] P3144R2 - Deleting a pointer to an incomplete
type should be ill-formed
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

See <https://wg21.link/P3144R2>.

[Bug c++/115746] New: [C++26] P2963R3 - Ordering of constraints involving fold expressions

2024-07-02 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115746

Bug ID: 115746
   Summary: [C++26] P2963R3 - Ordering of constraints involving
fold expressions
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

See <https://wg21.link/P2963R3>.

[Bug c++/115745] [C++26] P0963R3 - Structured binding declaration as a condition

2024-07-02 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115745

Jakub Jelinek  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |jakub at gcc dot gnu.org
 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2024-07-02
 Ever confirmed|0   |1

[Bug c++/115745] New: [C++26] P0963R3 - Structured binding declaration as a condition

2024-07-02 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115745

Bug ID: 115745
   Summary: [C++26] P0963R3 - Structured binding declaration as a
condition
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

See <https://wg21.link/P0963R3>.

[Bug c++/115744] New: [C++26] P2747R2 - constexpr placement new

2024-07-02 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115744

Bug ID: 115744
   Summary: [C++26] P2747R2 - constexpr placement new
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

See <https://wg21.link/P2747R2>.

[Bug fortran/114825] [11 Regression] Compiler error using gfortran and OpenMP since r5-1190

2024-06-20 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114825

Jakub Jelinek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #12 from Jakub Jelinek  ---
Fixed for 11.5 as well.

[Bug driver/115440] unrecognized command-line option '--c++17'; did you mean '--stdc++17'?

2024-06-20 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115440

Jakub Jelinek  changed:

   What|Removed |Added

   Target Milestone|--- |11.5
 Resolution|--- |FIXED
   Assignee|unassigned at gcc dot gnu.org  |jakub at gcc dot gnu.org
 Status|NEW |RESOLVED

--- Comment #9 from Jakub Jelinek  ---
Fixed for 11.5 as well.

[Bug sanitizer/114956] [11 Regression] Segmentation fault with -fsanitize=address -fsanitize=null -O2 when attribute no_sanitize_address is enabled since r9-5742

2024-06-20 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114956

Jakub Jelinek  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #12 from Jakub Jelinek  ---
Fixed for 11.5 as well.

[Bug c++/114691] [11 Regression] Bogus ignoring loop annotation warning

2024-06-20 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114691

Jakub Jelinek  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #9 from Jakub Jelinek  ---
Fixed for 11.5 as well.

[Bug tree-optimization/114876] [11 Regression] -fprintf-return-value mishandles %lc with a '\0' argument.

2024-06-20 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114876

Jakub Jelinek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #14 from Jakub Jelinek  ---
Fixed for 11.5 as well.

[Bug c++/114634] [11 Regression] Crash Issue Encountered in GCC Compilation of Template Code with Aligned Attribute since r9-1745

2024-06-20 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114634

Jakub Jelinek  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #11 from Jakub Jelinek  ---
Fixed for 11.5 as well.

[Bug c++/114572] [OpenMP] "internal compiler error: in assign_temp" with assignment operator and lastprivate clause

2024-06-20 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114572

Jakub Jelinek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
   Target Milestone|--- |11.5
 Resolution|--- |FIXED

--- Comment #10 from Jakub Jelinek  ---
Fixed for 11.5 as well.

[Bug tree-optimization/114566] [11 Regression] Misaligned vmovaps when compiling with stack-protector-strong for znver4

2024-06-20 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114566

Jakub Jelinek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #23 from Jakub Jelinek  ---
Fixed for 11.5 as well.

[Bug c++/114537] bit_cast does not work NSDMI of bitfields

2024-06-20 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114537

Jakub Jelinek  changed:

   What|Removed |Added

 Resolution|--- |FIXED
   Target Milestone|--- |11.5
 Status|ASSIGNED|RESOLVED

--- Comment #10 from Jakub Jelinek  ---
Fixed for 11.5 as well.

[Bug c++/55004] [meta-bug] constexpr issues

2024-06-20 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55004
Bug 55004 depends on bug 114537, which changed state.

Bug 114537 Summary: bit_cast does not work NSDMI of bitfields
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114537

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

[Bug libquadmath/114533] libquadmath: printf: fix misaligned access on args

2024-06-20 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114533

Jakub Jelinek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |11.5

--- Comment #18 from Jakub Jelinek  ---
Fixed for 11.5 as well.

[Bug c/114493] [11 Regression] internal compiler error: in fld_incomplete_type_of with may_alias

2024-06-20 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114493

Jakub Jelinek  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #18 from Jakub Jelinek  ---
Fixed for 11.5 as well.

[Bug target/114310] [11 Regression] [aarch64] __sync_val_compare_and_swap fails on __int128_t with newval = 0

2024-06-20 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114310

Jakub Jelinek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #12 from Jakub Jelinek  ---
Fixed for 11.5 as well.

[Bug c++/113674] [11 Regression] [[____attr____]] causes internal compiler error: in decl_attributes, at attribs.cc:776

2024-06-20 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113674

Jakub Jelinek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #14 from Jakub Jelinek  ---
Fixed for 11.5 as well.

[Bug c/113262] [11 Regression] ICE when using [[gnu::copy("")]] attribute

2024-06-20 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113262

Jakub Jelinek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #11 from Jakub Jelinek  ---
Fixed for 11.5 as well.

[Bug middle-end/110115] [11 Regression] Wrong code at -O1 on x86_64-linux-gnu

2024-06-20 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110115

Jakub Jelinek  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |jakub at gcc dot gnu.org
 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #13 from Jakub Jelinek  ---
Fixed for 11.5 as well.

[Bug middle-end/111422] Wrong code at -O3 on x86_64-linux-gnu

2024-06-20 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111422

Jakub Jelinek  changed:

   What|Removed |Added

   Target Milestone|--- |11.5
 CC||jakub at gcc dot gnu.org
 Resolution|--- |FIXED
   Assignee|unassigned at gcc dot gnu.org  |jakub at gcc dot gnu.org
 Status|NEW |RESOLVED

--- Comment #9 from Jakub Jelinek  ---
Fixed for 11.5 as well.

[Bug libgomp/113192] [11 Regression] ERROR: couldn't execute "../../../gcc/libgomp/testsuite/flock": no such file or directory

2024-06-20 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113192

Jakub Jelinek  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #15 from Jakub Jelinek  ---
Fixed for 11.5 as well.

[Bug testsuite/66005] libgomp make check time is excessive

2024-06-20 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66005
Bug 66005 depends on bug 113192, which changed state.

Bug 113192 Summary: [11 Regression] ERROR: couldn't execute 
"../../../gcc/libgomp/testsuite/flock": no such file or directory
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113192

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

[Bug target/113122] Assembler messages: Error: operand type mismatch for `movabs' / bad expression / invalid use of register with -fprofile -mcmodel=large -masm=intel

2024-06-20 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113122

Jakub Jelinek  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED
   Target Milestone|--- |11.5

--- Comment #8 from Jakub Jelinek  ---
Fixed for 11.5 as well.

[Bug middle-end/110027] [11 regression] Stack objects with extended alignments (vectors etc) misaligned on detect_stack_use_after_return

2024-06-20 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110027

Jakub Jelinek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #30 from Jakub Jelinek  ---
Fixed for 11.5 as well.

[Bug middle-end/108789] __builtin_(add|mul|sub)_overflow methods generate duplicate operations if both operands are const which in turn causes wrong code due to overlapping arguments

2024-06-20 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108789

Jakub Jelinek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
   Target Milestone|--- |11.5
 Resolution|--- |FIXED

--- Comment #13 from Jakub Jelinek  ---
Fixed for 11.5 as well.

[Bug rtl-optimization/110079] [11 Regression] ICE with -freorder-blocks-and-partition and inline-asm goto

2024-06-20 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110079

Jakub Jelinek  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #12 from Jakub Jelinek  ---
Fixed for 11.5 as well.

[Bug middle-end/90348] [11 Regression] Partition of char arrays is incorrect in some cases

2024-06-20 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90348

Jakub Jelinek  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #37 from Jakub Jelinek  ---
Worked around for 11.5 as well.

[Bug tree-optimization/61203] [5/6/7/8 Regression] g++.old-deja/g++.jason/rvalue2.C FAILs with -O2 -fno-inline

2024-06-20 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61203
Bug 61203 depends on bug 90348, which changed state.

Bug 90348 Summary: [11 Regression] Partition of char arrays is incorrect in 
some cases
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90348

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

[Bug c/115290] [12 Regression] tree check fail in c_tree_printer, at c/c-objc-common.cc:330

2024-06-20 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115290

Jakub Jelinek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #9 from Jakub Jelinek  ---
Fixed for 12.5 as well.

[Bug tree-optimization/115544] ICE: in lower_complexexpr_stmt, at gimple-lower-bitint.cc:4719 with -O -fno-tree-fre -fno-tree-ccp -fno-tree-forwprop and _BitInt() __builtin_mul_overflow()

2024-06-20 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115544

Jakub Jelinek  changed:

   What|Removed |Added

   Target Milestone|--- |14.2
 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #7 from Jakub Jelinek  ---
Fixed for 14.2+ and 15.1+.

[Bug middle-end/115551] [missed optimization] "c1 << (a + c2)" not optimized into "(c1 << c2) << a"

2024-06-20 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115551

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #5 from Jakub Jelinek  ---
We should also verify that it doesn't stand in the way of shift sanitization,
because
unsigned int a;
...
1 << (5 + a);
is well defined only for a in [0, 26] while once we optimize it to
(1 << 5) << a;
that would be well defined for a in [0, 31].  I think the shift sanitization is
done early, so just something to be verified in a testcase next to the patch.

[Bug tree-optimization/115544] ICE: in lower_complexexpr_stmt, at gimple-lower-bitint.cc:4719 with -O -fno-tree-fre -fno-tree-ccp -fno-tree-forwprop and _BitInt() __builtin_mul_overflow()

2024-06-19 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115544

Jakub Jelinek  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |jakub at gcc dot gnu.org

--- Comment #4 from Jakub Jelinek  ---
Created attachment 58466
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58466=edit
gcc15-pr115544.patch

So far lightly tested fix.

[Bug c/115109] Incorrect type of enumeration constant in redeclaration of enumeration constant (C23)

2024-06-19 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115109

--- Comment #11 from Jakub Jelinek  ---
It is always good if you're testing on x86_64 to test such tests with
make check-gcc
RUNTESTFLAGS="--target_board=unix\{-m32/-mno-mmx/-mno-sse,-m32/-msse2,-m64\}
dg.exp='pr105109.c c23-tag-enum-*.c'"
or similar, that allows testing both 64-bit and 32-bit compilation and for the
latter both the variants with vector support and without (e.g. in case test
needs -Wno-psabi).
I certainly see
+FAIL: gcc.dg/c23-tag-enum-6.c  (test for errors, line 10)
+FAIL: gcc.dg/c23-tag-enum-6.c  (test for errors, line 13)
+FAIL: gcc.dg/c23-tag-enum-7.c (test for excess errors)
+FAIL: gcc.dg/pr115109.c (test for excess errors)
on i686-linux and not on x86_64-linux and the above make check would show it
immediately, even before trying to bootstrap/regtest the patch.

[Bug debug/115543] DWARF call_site_parameter entries are not generated for stack-passed parameters

2024-06-18 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115543

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek  ---
That is not a bug, DW_TAG_call_site_parameter is emitted only when it has
something relevant to say (like, what value has been passed).  If it isn't
known how to reconstruct the value or if the compiler is unable to track the
value passed to it, it can omit it.

[Bug c/115539] Misoptimization of application at -O2 -g on x86-64 causing segfaults on valid memory accesses where it works on both clang and gcc at -g (no -O2)

2024-06-18 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115539

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #4 from Jakub Jelinek  ---
Your testcase isn't self-contained, there is no main, so there isn't much we
can do about it, but from the 220 -Wstrict-aliasing warnings I'd say it is very
likely the code violates TBAA just about everywhere.
Try -O2 -fno-strict-aliasing?  If that helps, most likely it is just bogus code
being compiled.

[Bug c/115516] constexpr use before C23 could give a better error message

2024-06-18 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115516

--- Comment #3 from Jakub Jelinek  ---
Sorry, this was about C, not C++.  And apparently C++ manages to warn about
that in
cp_parser_diagnose_invalid_type_name through
if (cxx_dialect < cxx11 && id == ridpointers[(int)RID_CONSTEXPR])
check.

[Bug c/115516] constexpr use before C23 could give a better error message

2024-06-18 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115516

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek  ---
It will be hard, because constexpr before C++11 is not a keyword.
And it can't be, int constexpr = 1; is completely valid C++98.

[Bug c/115290] [12 Regression] tree check fail in c_tree_printer, at c/c-objc-common.cc:330

2024-06-17 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115290

Jakub Jelinek  changed:

   What|Removed |Added

Summary|[12/13/14/15 Regression]|[12 Regression] tree check
   |tree check fail in  |fail in c_tree_printer, at
   |c_tree_printer, at  |c/c-objc-common.cc:330
   |c/c-objc-common.cc:330  |

--- Comment #6 from Jakub Jelinek  ---
Should be fixed for 13.4+/14.2+/15.1+ for now, 12 branch is frozen right now,
so it will need to wait for 12.5.

[Bug c/115290] [12/13/14/15 Regression] tree check fail in c_tree_printer, at c/c-objc-common.cc:330

2024-06-17 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115290

Jakub Jelinek  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |jakub at gcc dot gnu.org
 Status|NEW |ASSIGNED

--- Comment #2 from Jakub Jelinek  ---
Created attachment 58449
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58449=edit
gcc15-pr115290.patch

Untested fix.

[Bug libstdc++/115512] _Float32 overloads in cmath cause ICE for default AVR

2024-06-17 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115512

Jakub Jelinek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |INVALID

--- Comment #4 from Jakub Jelinek  ---
.

  1   2   3   4   5   6   7   8   9   10   >