public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <law@redhat.com>
To: Jozef Lawrynowicz <jozefl.gcc@gmail.com>, gcc-patches@gcc.gnu.org
Cc: nickc@redhat.com
Subject: Re: [PING] [PATCH] [MSP430] PR79242: Implement Complex Partial Integers
Date: Wed, 14 Feb 2018 07:25:00 -0000	[thread overview]
Message-ID: <a1b94cec-b45d-c938-d209-f28c2e76a9a8@redhat.com> (raw)
In-Reply-To: <CAOe4MZbvbd1smaBhfWxdS5E2X9Cs_ugHbNbkKhpP625z7Jbbkw@mail.gmail.com>

On 02/08/2018 09:54 AM, Jozef Lawrynowicz wrote:
> ping x1
> 
> Complex Partial Integers are unimplemented, resulting in an ICE when
> attempting to use them. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79242
> This results in GCC7/8 for msp430-elf failing to build.
> 
> typedef _Complex __int20 C;
> 
> C
> foo (C x, C y)
> {
>   return x + y;
> }
> 
> (Thanks Jakub - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79242#c2)
> 
> ../../gcc/testsuite/gcc.target/msp430/pr79242.c: In function 'foo':
> ../../gcc/testsuite/gcc.target/msp430/pr79242.c:8:1: internal compiler
> error: in make_decl_rtl, at varasm.c:1304
>  foo (C x, C y)
>  ^~~
> 0xc07b29 make_decl_rtl(tree_node*)
>         ../../gcc/varasm.c:1303
> 0x67523c set_parm_rtl(tree_node*, rtx_def*)
>         ../../gcc/cfgexpand.c:1274
> 0x79ffb9 expand_function_start(tree_node*)
>         ../../gcc/function.c:5166
> 0x6800e1 execute
>         ../../gcc/cfgexpand.c:6250
> 
> The attached patch defines a new complex mode for PARTIAL_INT.
> You may notice that genmodes.c:complex_class returns MODE_COMPLEX_INT for
> MODE_PARTIAL_INT rather than MODE_COMPLEX_PARTIAL_INT. I reviewed the uses of
> MODE_COMPLEX_INT and it doesn't looked like a Complex Partial Int requires any
> different behaviour to MODE_COMPLEX_INT.
> 
> msp430_hard_regno_nregs now returns 2 for CPSImode, but I feel like this may be
> better handled in the front-end. PSImode is already defined to only use 1
> register, so for a CPSI shouldn't the front-end should be able to work out that
> double the amount of registers are required? Thoughts?
> Without the definition for CPSI in msp430_hard_regno_nregs,
> rtlanal.c:subreg_get_info thinks that a CPSI requires 4 registers of size 2,
> instead of 2 registers of size 4.
> 
> Successfully bootstrapped and tested for c,c++,fortran,lto,objc on
> x86_64-pc-linux-gnu with no regressions on gcc-7-branch.
> 
> With this patch gcc-7-branch now builds for msp430-elf. A further bug prevents
> trunk from building for msp430-elf.
> 
> If the attached patch is acceptable, I would appreciate if someone would commit
> it for me (to trunk and gcc-7-branch), as I do not have write access.
> 
> 
> 0001-Add-support-for-Complex-Partial-Integers-CPSImode.patch
> 
> 
> From 31d8554ebb6afeb2d8f235cf3d3c262236aa5e32 Mon Sep 17 00:00:00 2001
> From: Jozef Lawrynowicz <jozefl.gcc@gmail.com>
> Date: Fri, 12 Jan 2018 13:23:40 +0000
> Subject: [PATCH] Add support for Complex Partial Integers - CPSImode
> 
> 2018-01-XX  Jozef Lawrynowicz <jozefl.gcc@gmail.com>
> 
> gcc/
>   PR target/79242
>   * machmode.def: Define a complex mode for PARTIAL_INT.
>   * genmodes.c (complex_class): Return MODE_COMPLEX_INT for
>     MODE_PARTIAL_INT.
>   * doc/rtl.texi: Document CSPImode.
>   * config/msp430/msp430.c (msp430_hard_regno_nregs): Add CPSImode
>     handling.
>     (msp430_hard_regno_nregs_with_padding): Likewise.
> 
> gcc/testsuite/
>   PR target/79242
>   * gcc.target/msp430/pr79242.c: New test.
Thanks.  Installed.

jeff

  parent reply	other threads:[~2018-02-14  7:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-08 16:54 Jozef Lawrynowicz
2018-02-08 19:44 ` DJ Delorie
2018-02-14  7:25 ` Jeff Law [this message]
2018-02-14 12:48   ` Jozef Lawrynowicz

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=a1b94cec-b45d-c938-d209-f28c2e76a9a8@redhat.com \
    --to=law@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jozefl.gcc@gmail.com \
    --cc=nickc@redhat.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).