From: Eric Botcazou <botcazou@adacore.com>
To: Roger Sayle <roger@nextmovesoftware.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] PR middle-end/105853: Call store_constructor directly from calls.cc.
Date: Tue, 07 Jun 2022 10:04:36 +0200 [thread overview]
Message-ID: <1825514.tdWV9SEqCh@fomalhaut> (raw)
In-Reply-To: <001601d879ac$584d33e0$08e79ba0$@nextmovesoftware.com>
> The (proposed) solution is to export store_constructor (and it's helper
> function int_expr_size) from expr.cc, by removing their static qualifier
> and prototyping both functions in expr.h, so they can be called directly
> from load_register_parameters in calls.cc. This cures both ICEs, but
> almost as important produces much better code generation than GCC 12.
>
> For PR 105853, GCC 12 generates:
>
> compose_nd_na_ipv6_src:
> movzx eax, WORD PTR eth_addr_zero[rip+2]
> movzx edx, WORD PTR eth_addr_zero[rip]
> movzx edi, WORD PTR eth_addr_zero[rip+4]
> sal rax, 16
> or rax, rdx
> sal rdi, 32
> or rdi, rax
> xor eax, eax
> jmp packet_set_nd
> eth_addr_zero: .zero 6
>
> where now (with this fix) GCC 13 generates:
> compose_nd_na_ipv6_src:
> xorl %edi, %edi
> xorl %eax, %eax
> jmp packet_set_nd
>
> Likewise, for PR 105856 on ARM, we'd previously generate:
> g_329_3:
> movw r3, #:lower16:.LANCHOR0
> movt r3, #:upper16:.LANCHOR0
> ldr r0, [r3]
> b func_19
>
> but with this optimization we now generate:
> g_329_3:
> mov r0, #6
> b func_19
Nice work! Fiddling with RTL expansion like this is never easy...
> This patch has been tested on x86_64-pc-linux-gnu with make bootstrap
> and make -k check with no new failures. I've also confirmed that on a
> cross-compiler to arm-linux-gnueabihf --with-arch=armv6 this fixes the
> target specific ICE in PR105856. The make check is currently running
> with --target_board=unix{-m32}, OK for mainline if that also passes?
Yes, it looks quite uncontroversial if you ask me and will unblock people.
--
Eric Botcazou
next prev parent reply other threads:[~2022-06-07 8:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-06 13:50 Roger Sayle
2022-06-07 8:04 ` Eric Botcazou [this message]
2022-06-12 17:16 ` Jeff Law
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1825514.tdWV9SEqCh@fomalhaut \
--to=botcazou@adacore.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=roger@nextmovesoftware.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).