Go patch committed: Handle f().x if f returns a zero-sized type

2022-07-16 Thread Ian Lance Taylor via Gcc-patches
This patch to the Go frontend handles the case of f().x when the function f returns a zero-sized type. In that case the GCC interface will have changed f to return void, as the GCC middle-end does not have complete support for zero-sized types. This patch handles the case of void when in a struct

[x86_64 PATCH] PR target/106231: Optimize (any_extend:DI (ctz:SI ...)).

2022-07-16 Thread Roger Sayle
This patch resolves PR target/106231 by providing insns that recognize (zero_extend:DI (ctz:SI ...)) and (sign_extend:DI (ctz:SI ...)). The result of ctz:SI is always between 0 and 32 (or undefined), so sign_extension is the same as zero_extension, and the result is already extended in the destin

[AVX512 PATCH] Add UNSPEC_MASKOP to kupck instructions in sse.md.

2022-07-16 Thread Roger Sayle
This AVX512 specific patch to sse.md is split out from an earlier patch: https://gcc.gnu.org/pipermail/gcc-patches/2022-June/596199.html The new splitters proposed in that patch interfere with AVX512's kunpckdq instruction which is defined as identical RTL, DW:DI = (HI:SI<<32)|zero_extend(LO:SI).

[middle-end PATCH] PR c/106264: Silence warnings from __builtin_modf et al.

2022-07-16 Thread Roger Sayle
This middle-end patch resolves PR c/106264 which is a spurious warning regression caused by the tree-level expansion of modf, frexp and remquo producing "expression has no-effect" when the built-in function's result is ignored. When these built-ins were first expanded at tree-level, fold_builtin_

[x86 PATCH] Fix issue with x86_64_const_vector_operand predicate.

2022-07-16 Thread Roger Sayle
This patch fixes (what I believe is) a latent bug in i386.md's x86_64_const_vector_operand define_predicate. According to the documentation, when a predicate is called with rtx operand OP and machine_mode operand MODE, we can't shouldn't assume that the MODE is (or has been checked to be) GET_MOD

Re: [PATCH 2/2] xtensa: Optimize "bitwise AND with imm1" followed by "branch if (not) equal to imm2"

2022-07-16 Thread Max Filippov via Gcc-patches
On Fri, Jul 15, 2022 at 4:17 PM Takayuki 'January June' Suwa wrote: > > This patch enhances the effectiveness of the previously posted one: > "xtensa: Optimize bitwise AND operation with some specific forms of > constants". > > /* example */ > extern void foo(int); > void test(int a)

Re: [PATCH 1/2] xtensa: constantsynth: Make try to find shorter instruction

2022-07-16 Thread Max Filippov via Gcc-patches
On Fri, Jul 15, 2022 at 4:17 PM Takayuki 'January June' Suwa wrote: > > This patch allows the constant synthesis to choose shorter instruction > if possible. > > /* example */ > int test(void) { > return 128 << 8; > } > > ;; before > test: > movia2, 0x100 >