Re: a small C (naive) program faster with clang than with gcc

2023-04-25 Thread Gabriel Paubert
On Tue, Apr 25, 2023 at 06:01:22PM +0200, Andy via Gcc wrote: > I see it in godbolt > GCC compiles to: > movsx eax, BYTE PTR [rdi+2] > cmp al, 9 > ja .L42 > Clang: > movzx edx, byte ptr [rdi + 2] > cmp edx, 9 > ja .LBB0_40 > > > GCC extend with sign, Clang with zero. > cmp with 32 bit register is

Re: a small C (naive) program faster with clang than with gcc

2023-04-25 Thread LIU Hao via Gcc
在 2023/4/26 00:01, Andy via Gcc 写道: I see it in godbolt GCC compiles to: movsx eax, BYTE PTR [rdi+2] cmp al, 9 ja .L42 Clang: movzx edx, byte ptr [rdi + 2] cmp edx, 9 ja .LBB0_40 GCC extend with sign, Clang with zero. cmp with 32 bit register is apparently faster than 8bit As for extension, i

Re: zero length array example does not compile

2023-04-25 Thread Jonathan Wakely via Gcc
On Tue, 25 Apr 2023 at 20:21, Jonny Grant wrote: > > > > On 25/04/2023 13:22, Jonathan Wakely wrote: > > On Tue, 25 Apr 2023 at 13:17, Jonathan Wakely wrote: > >> > >> On Tue, 25 Apr 2023 at 13:13, Jonny Grant wrote: > >>> > >>> Hello > >>> > >>> https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html

Re: zero length array example does not compile

2023-04-25 Thread Jonny Grant
On 25/04/2023 13:22, Jonathan Wakely wrote: > On Tue, 25 Apr 2023 at 13:17, Jonathan Wakely wrote: >> >> On Tue, 25 Apr 2023 at 13:13, Jonny Grant wrote: >>> >>> Hello >>> >>> https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html >>> >>> I wondered 'this_length' refers to in that example, it doesn

Re: a small C (naive) program faster with clang than with gcc

2023-04-25 Thread Andy via Gcc
I see it in godbolt GCC compiles to: movsx eax, BYTE PTR [rdi+2] cmp al, 9 ja .L42 Clang: movzx edx, byte ptr [rdi + 2] cmp edx, 9 ja .LBB0_40 GCC extend with sign, Clang with zero. cmp with 32 bit register is apparently faster than 8bit pon., 24 kwi 2023 o 17:34 Basile Starynkevitch napisał(a)

Re: zero length array example does not compile

2023-04-25 Thread Jonathan Wakely via Gcc
On Tue, 25 Apr 2023 at 13:17, Jonathan Wakely wrote: > > On Tue, 25 Apr 2023 at 13:13, Jonny Grant wrote: > > > > Hello > > > > https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html > > > > I wondered 'this_length' refers to in that example, it doesn't compile. > > It's not supposed to be a complete

Re: zero length array example does not compile

2023-04-25 Thread Jonathan Wakely via Gcc
On Tue, 25 Apr 2023 at 13:13, Jonny Grant wrote: > > Hello > > https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html > > I wondered 'this_length' refers to in that example, it doesn't compile. It's not supposed to be a complete program. > > : In function 'main': > :13:34: error: 'this_length' undec

zero length array example does not compile

2023-04-25 Thread Jonny Grant
Hello https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html I wondered 'this_length' refers to in that example, it doesn't compile. : In function 'main': :13:34: error: 'this_length' undeclared (first use in this function) 13 | malloc (sizeof (struct line) + this_length); |

Upcoming removal of legacy ranges and conversion to wide_ints.

2023-04-25 Thread Aldy Hernandez via Gcc
After GCC 13 is released we will remove legacy range support from the compiler, and convert irange's to wide_ints. I want to give everyone a heads up, to help understand what's involved and what the end result is. Legacy ranges are basically the value_range type (int_range<1>) where the internal