public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Denis Chertykov <chertykov@gmail.com>
To: Georg-Johann Lay <avr@gjlay.de>
Cc: Richard Henderson <rth@redhat.com>,
	gcc-patches@gcc.gnu.org, 	Anatoly Sokolov <aesok@post.ru>,
	"Eric B. Weddington" <eric.weddington@atmel.com>,
		Eric Botcazou <ebotcazou@adacore.com>,
	Bernd Schmidt <bernds@codesourcery.com>
Subject: Re: [Patch, AVR]: Fix PR46779
Date: Fri, 08 Jul 2011 10:25:00 -0000	[thread overview]
Message-ID: <CADOs=za41ZUh97MRhqwnPJ3dp1dd6zOt6A0hN0gh0bNk9GevYA@mail.gmail.com> (raw)
In-Reply-To: <4E16D4FD.8020806@gjlay.de>

2011/7/8 Georg-Johann Lay <avr@gjlay.de>:
> CCed Eric and Bernd.
>
> Denis Chertykov wrote:
>>> Did you decide about the fix for PR46779?
>>>
>>> http://gcc.gnu.org/ml/gcc-patches/2011-06/msg00810.html
>>>
>>> Is it ok to commit?
>>
>> I forgot about testsuite regressions for this patch.
>>
>> Denis.
>
>
> There were no new regressions:
>  http://gcc.gnu.org/ml/gcc-patches/2011-06/msg00747.html
>
> However, with the actual trunk (SVN 175991), I get two more
> spill fails for following sources:
>
> ./gcc.c-torture/compile/pr32349.c -O1 -mmcu=atmega128
>
>  pr30338.c: In function 'testload_func':
> pr30338.c:13:1: error: unable to find a register to spill in class
> 'POINTER_REGS'
> pr30338.c:13:1: error: this is the insn:
> (insn 14 13 15 2 (set (reg:QI 24 r24 [orig:73 *D.1963_37 ] [73])
>        (mem:QI (subreg:HI (reg:SI 71) 0) [0 *D.1963_37+0 S1 A8]))
> pr30338.c:9 4 {*movqi}
>     (expr_list:REG_DEAD (reg:SI 71)
>        (nil)))
> pr30338.c:13:1: internal compiler error: in spill_failure, at
> reload1.c:2120
>
>
>
> ./gcc.c-torture/compile/pr32349.c -S -O3 -funroll-loops
>
> pr32349.c: In function 'foo':
> pr32349.c:26:1: error: unable to find a register to spill in class
> 'POINTER_REGS'
> pr32349.c:26:1: error: this is the insn:
> (insn 175 197 177 10 (set (reg/v:SI 234 [ m ])
>        (mem:SI (post_inc:HI (reg:HI 16 r16 [orig:192 ivtmp.18 ]
> [192])) [3 MEM[base: D.1996_74, offset: 0B]+0 S4 A8])) pr32349.c:18 12
> {*movsi}
>     (expr_list:REG_INC (reg:HI 16 r16 [orig:192 ivtmp.18 ] [192])
>        (nil)))
> pr32349.c:26:1: internal compiler error: in spill_failure, at
> reload1.c:2120
>
>
> (1)
> I can fix *both* fails with additional test in avr_hard_regno_mode_ok:
>
> +   if (GET_MODE_SIZE (mode) >= 4
> +       && regno >= REG_X)
> +     return 0;
>
> (2)
> I can fix the first fail but *not* the second by not allow SUBREGs in
> avr_legitimate_address_p:
>
> -   if (!strict && GET_CODE (x) == SUBREG) */
> -       x = SUBREG_REG (x); */
>
>
> (2) Looks very reasonble, Eric Botcazou proposed it because he ran
> into problems:
>   http://gcc.gnu.org/ml/gcc-patches/2011-04/msg01367.html
>
> (1) Appears to be hackish, but it should be ok.  If code breaks
> because of that is's *definitely* a reload bug (e.g. SI-subreg of DI).
>
> Even the original avr_hard_regno_mode_ok is ok IMO because if a
> machine says "I can hold HI in 28 but not QI in 29" reload has to
> handle it (except a machine must allow word_mode in *all* it's
> GENERAL_REGS, don't know if that's a must).
>
> I made a patch for reload, too:
>   http://gcc.gnu.org/ml/gcc/2011-06/msg00005.html
>
> Because IRA generates SUBREG of hardreg (which old lreg/greg handled
> ok) and reload does not handle it correctly.  It generates a spill but
> without the needed input reload so that one part of the register is
> missing.
>
> reload blames IRA or BE, IRA blames reload, BE blames IRA, etc...
>
>
> I didn't rerun the testsuite with (1) or/and (2), I'd like both (1)
> and (2) in the compiler.  What do you think?

I think that AVR is a stress test for GCC core. We are on the edge.
IMHO your patch is a change one tweaks to another.
It's not needed if it adds regressions.

Denis.

  reply	other threads:[~2011-07-08 10:20 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-09 17:24 Georg-Johann Lay
2011-06-09 18:50 ` Denis Chertykov
2011-06-09 19:43   ` Georg-Johann Lay
2011-06-09 19:51     ` Denis Chertykov
2011-06-10 10:23       ` Georg-Johann Lay
2011-06-12 10:34         ` Denis Chertykov
2011-06-13 18:10           ` Georg-Johann Lay
2011-06-13 22:37             ` Denis Chertykov
2011-06-14 10:39               ` Georg-Johann Lay
2011-06-14 11:38                 ` Denis Chertykov
2011-06-14 21:38                   ` Georg-Johann Lay
2011-06-14 23:04                     ` Richard Henderson
2011-06-15 17:58                     ` Richard Henderson
2011-06-15 21:58                       ` Georg-Johann Lay
2011-06-15 22:20                         ` Richard Henderson
2011-06-16  3:46                           ` Richard Henderson
2011-06-16 11:37                             ` Denis Chertykov
2011-06-16 12:01                               ` Denis Chertykov
2011-06-16 14:07                                 ` Richard Henderson
2011-06-16 18:18                                   ` Denis Chertykov
2011-06-16 18:57                                     ` Richard Henderson
2011-06-16 19:33                                       ` Denis Chertykov
2011-06-16 19:42                                         ` Richard Henderson
2011-06-16 20:04                                           ` Denis Chertykov
2011-06-16 14:36                               ` Richard Henderson
2011-06-16 14:52                                 ` Bernd Schmidt
2011-06-16 15:13                                   ` Richard Henderson
2011-06-16 18:57                                 ` Denis Chertykov
2011-06-23 20:48                             ` Denis Chertykov
2011-06-23 22:04                               ` Richard Henderson
2011-06-26 20:03                                 ` Denis Chertykov
2011-06-26 20:51                                   ` Georg-Johann Lay
2011-06-27  8:41                                     ` Denis Chertykov
2011-06-27  9:19                                       ` Georg-Johann Lay
2011-06-27 10:17                                         ` Denis Chertykov
2011-07-07  9:59                                           ` Georg-Johann Lay
2011-07-07 18:21                                             ` Denis Chertykov
2011-07-08 10:12                                               ` Georg-Johann Lay
2011-07-08 10:25                                                 ` Denis Chertykov [this message]
2011-07-08 12:16                                                   ` Georg-Johann Lay
2011-06-22  3:28             ` Hans-Peter Nilsson
2011-06-22 17:03               ` Georg-Johann Lay
2011-06-23 12:51                 ` Hans-Peter Nilsson
2011-06-23 13:00                 ` Hans-Peter Nilsson
2011-06-09 20:03     ` Georg-Johann Lay
2011-06-10  9:27   ` Georg-Johann Lay
2011-06-21 17:17     ` Georg-Johann Lay

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='CADOs=za41ZUh97MRhqwnPJ3dp1dd6zOt6A0hN0gh0bNk9GevYA@mail.gmail.com' \
    --to=chertykov@gmail.com \
    --cc=aesok@post.ru \
    --cc=avr@gjlay.de \
    --cc=bernds@codesourcery.com \
    --cc=ebotcazou@adacore.com \
    --cc=eric.weddington@atmel.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rth@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).