public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Christophe Lyon <christophe.lyon@linaro.org>
To: James Greenhalgh <james.greenhalgh@arm.com>
Cc: Wilco Dijkstra <Wilco.Dijkstra@arm.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>, nd <nd@arm.com>
Subject: Re: [PATCH][AArch64] Fix ICE due to store_pair_lanes
Date: Wed, 29 Nov 2017 21:03:00 -0000	[thread overview]
Message-ID: <CAKdteObdgmHvHSpiUi6oS0Fx3-f9TpeYm0EHa6ryoqhXyjQf7g@mail.gmail.com> (raw)
In-Reply-To: <20171128181500.GA25893@arm.com>

On 28 November 2017 at 19:15, James Greenhalgh <james.greenhalgh@arm.com> wrote:
> On Mon, Nov 27, 2017 at 03:20:29PM +0000, Wilco Dijkstra wrote:
>> The recently added store_pair_lanes causes ICEs in output_operand.
>> This is due to aarch64_classify_address treating it like a 128-bit STR
>> rather than a STP. The valid immediate offsets don't fully overlap,
>> causing it to return false.  Eg. offset 264 is a valid 8-byte STP offset
>> but not a valid 16-byte STR offset since it isn't a multiple of 16.
>>
>> The original instruction isn't passed in the printing code, so the context
>> is unclear.  The solution is to add a new operand formatting specifier
>> which is used for LDP/STP instructions like this.  This, like the Uml
>> constraint that applies to store_pair_lanes, uses PARALLEL when calling
>> aarch64_classify_address so that it knows it is an STP.
>> Also add the 'z' specifier for future use by load/store pair instructions.
>>
>> Passes regress, OK for commit?
>
> OK. But...
>
>> +  if (aarch64_classify_address (&addr, x, mode, op, true))
>
> This interface is not nice, resulting in...
>
>> +/* Print address 'x' of a LDP/STP with mode 'mode'.  */
>> +static void
>> +aarch64_print_ldpstp_address (FILE *f, machine_mode mode, rtx x)
>> +{
>> +  aarch64_print_address_internal (f, mode, x, PARALLEL);
>> +}
>> +
>> +/* Print address 'x' of a memory access with mode 'mode'.  */
>> +static void
>> +aarch64_print_operand_address (FILE *f, machine_mode mode, rtx x)
>> +{
>> +  aarch64_print_address_internal (f, mode, x, MEM);
>> +}
>
> These, which I *really* dislike.
>
> Ideas on how to clean up this interface would be appreciated.
>
> Thanks,
> James
>

Hi Wilco,

This breaks the build of aarch64-none-elf toolchains:

/tmp/8868058_9.tmpdir/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-aarch64_be-none-elf/gcc1/./gcc/xgcc
-B/tmp/8868058_9.tmpdir/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-aarch64_be-none-elf/gcc1/./gcc/
-B/tmp/8868058_9.tmpdir/aci-gcc-fsf/builds/gcc-fsf-gccsrc/tools/aarch64_be-none-elf/bin/
-B/tmp/8868058_9.tmpdir/aci-gcc-fsf/builds/gcc-fsf-gccsrc/tools/aarch64_be-none-elf/lib/
-isystem /tmp/8868058_9.tmpdir/aci-gcc-fsf/builds/gcc-fsf-gccsrc/tools/aarch64_be-none-elf/include
-isystem /tmp/8868058_9.tmpdir/aci-gcc-fsf/builds/gcc-fsf-gccsrc/tools/aarch64_be-none-elf/sys-include
   -g -O2 -mabi=ilp32 -O2  -g -O2 -DIN_GCC
-DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wwrite-strings -Wcast-qual
-Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition
-isystem ./include   -g -DIN_LIBGCC2 -fbuilding-libgcc
-fno-stack-protector -Dinhibit_libc  -I. -I. -I../../.././gcc
-I/tmp/8868058_9.tmpdir/aci-gcc-fsf/sources/gcc-fsf/gccsrc/libgcc
-I/tmp/8868058_9.tmpdir/aci-gcc-fsf/sources/gcc-fsf/gccsrc/libgcc/.
-I/tmp/8868058_9.tmpdir/aci-gcc-fsf/sources/gcc-fsf/gccsrc/libgcc/../gcc
-I/tmp/8868058_9.tmpdir/aci-gcc-fsf/sources/gcc-fsf/gccsrc/libgcc/../include
   -o unwind-dw2-fde.o -MT unwind-dw2-fde.o -MD -MP -MF
unwind-dw2-fde.dep -fexceptions -c
/tmp/8868058_9.tmpdir/aci-gcc-fsf/sources/gcc-fsf/gccsrc/libgcc/unwind-dw2-fde.c
-fvisibility=hidden -DHIDE_EXPORTS
during RTL pass: final
/tmp/8868058_9.tmpdir/aci-gcc-fsf/sources/gcc-fsf/gccsrc/libgcc/unwind-dw2-fde.c:
In function 'search_object':
/tmp/8868058_9.tmpdir/aci-gcc-fsf/sources/gcc-fsf/gccsrc/libgcc/unwind-dw2-fde.c:1024:1:
internal compiler error: in aarch64_print_address_internal, at
config/aarch64/aarch64.c:5637
 }
 ^
0xf2259e aarch64_print_address_internal
/tmp/8868058_9.tmpdir/aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/config/aarch64/aarch64.c:5637
0x7fb063 output_address(machine_mode, rtx_def*)
/tmp/8868058_9.tmpdir/aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/final.c:3905
0x7fe563 output_asm_insn(char const*, rtx_def**)
/tmp/8868058_9.tmpdir/aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/final.c:3766
0x7fed04 final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*)
/tmp/8868058_9.tmpdir/aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/final.c:3064
0x7ffcfa final(rtx_insn*, _IO_FILE*, int)
/tmp/8868058_9.tmpdir/aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/final.c:2052
0x80088b rest_of_handle_final
/tmp/8868058_9.tmpdir/aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/final.c:4490
0x80088b execute
/tmp/8868058_9.tmpdir/aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/final.c:4564
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
make[4]: *** [unwind-dw2-fde.o] Error 1
make[4]: Leaving directory
`/tmp/8868058_9.tmpdir/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-aarch64_be-none-elf/gcc1/aarch64_be-none-elf/ilp32/libgcc'
make[3]: *** [multi-do] Error 1


Can you have a look?

Thanks,

Christophe

  reply	other threads:[~2017-11-29 20:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-27 15:44 Wilco Dijkstra
2017-11-28 18:40 ` James Greenhalgh
2017-11-29 21:03   ` Christophe Lyon [this message]
2017-11-29 22:32     ` Steve Ellcey
2017-11-30  0:52       ` Steve Ellcey

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=CAKdteObdgmHvHSpiUi6oS0Fx3-f9TpeYm0EHa6ryoqhXyjQf7g@mail.gmail.com \
    --to=christophe.lyon@linaro.org \
    --cc=Wilco.Dijkstra@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=james.greenhalgh@arm.com \
    --cc=nd@arm.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).