public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/53250] New: [4.8 Regression] [SH] ICE: in change_address_1, at emit-rtl.c:2018
@ 2012-05-06  0:51 kkojima at gcc dot gnu.org
  2012-05-06 10:56 ` [Bug target/53250] " olegendo at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: kkojima at gcc dot gnu.org @ 2012-05-06  0:51 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53250

             Bug #: 53250
           Summary: [4.8 Regression] [SH] ICE: in change_address_1, at
                    emit-rtl.c:2018
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: kkojima@gcc.gnu.org
                CC: olegendo@gcc.gnu.org
            Target: sh4-unknown-linux-gnu


On sh4-unknown-linux-gnu, there are many new failures after revision
187015.  The typical example is gcc.c-torture/compile/20071102-1.c
which fails with

internal compiler error: in change_address_1, at emit-rtl.c:2018

It seems that rtls like

(subreg:SF (reg:DI ...) 4)
(subreg:SF (reg:V2SF ...) 4)

cause this error when regs are on stack.  If my memory is correct,
the similar issue has popped up on oleg's work for QI/HImode addressing
with displacement.  The above rtls are not illegal but problematic
when regs are on stack because SH has no load/store instructions
for FP registers and memory with displacement.  Before lowering
subregs change in revision 187015, these subregs were decomposed
into subregs with zero byte count.
The trails of PR53716 say that the appropriate target-wise cost
computation is needed, though I can't find the way to enable
lowering the above subregs with adjusting SH's rtx cost computations.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug target/53250] [4.8 Regression] [SH] ICE: in change_address_1, at emit-rtl.c:2018
  2012-05-06  0:51 [Bug target/53250] New: [4.8 Regression] [SH] ICE: in change_address_1, at emit-rtl.c:2018 kkojima at gcc dot gnu.org
@ 2012-05-06 10:56 ` olegendo at gcc dot gnu.org
  2012-05-06 18:09 ` olegendo at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: olegendo at gcc dot gnu.org @ 2012-05-06 10:56 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53250

Oleg Endo <olegendo at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|sh4-unknown-linux-gnu       |sh*-*-*
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-05-06
     Ever Confirmed|0                           |1

--- Comment #1 from Oleg Endo <olegendo at gcc dot gnu.org> 2012-05-06 10:42:34 UTC ---
I've noticed this problem a while ago when building newlib.  After a few
revisions it went away but now it seems to be persistent.  The following
happens when building newlib:

[...]
VERSION=\"1.19.0\" -DPACKAGE_STRING=\"newlib\ 1.19.0\" -DPACKAGE_BUGREPORT=\"\"
-DPACKAGE_URL=\"\" -I. -I../../../../../../../newlib-1.19.0/newlib/libm/complex
-I../../../../../../../newlib-1.19.0/newlib/libm/complex/../common
-I../../../../../../../newlib-1.19.0/newlib/libm/complex/ -fno-builtin      -g
-O2  -ml -m2e -c -o lib_a-cacosh.o `test -f 'cacosh.c' || echo
'../../../../../../../newlib-1.19.0/newlib/libm/complex/'`cacosh.c
../../../../../../../newlib-1.19.0/newlib/libm/complex/cacosh.c: In function
'cacosh':
../../../../../../../newlib-1.19.0/newlib/libm/complex/cacosh.c:93:1: internal
compiler error: in change_address_1, at emit-rtl.c:2018
 }
 ^
Please submit a full bug report


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug target/53250] [4.8 Regression] [SH] ICE: in change_address_1, at emit-rtl.c:2018
  2012-05-06  0:51 [Bug target/53250] New: [4.8 Regression] [SH] ICE: in change_address_1, at emit-rtl.c:2018 kkojima at gcc dot gnu.org
  2012-05-06 10:56 ` [Bug target/53250] " olegendo at gcc dot gnu.org
@ 2012-05-06 18:09 ` olegendo at gcc dot gnu.org
  2012-05-06 23:27 ` olegendo at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: olegendo at gcc dot gnu.org @ 2012-05-06 18:09 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53250

--- Comment #2 from Oleg Endo <olegendo at gcc dot gnu.org> 2012-05-06 18:04:27 UTC ---
Created attachment 27326
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27326
Proposed patch

(In reply to comment #0)
> On sh4-unknown-linux-gnu, there are many new failures after revision
> 187015.  The typical example is gcc.c-torture/compile/20071102-1.c
> which fails with
> 
> internal compiler error: in change_address_1, at emit-rtl.c:2018
> 
> It seems that rtls like
> 
> (subreg:SF (reg:DI ...) 4)
> (subreg:SF (reg:V2SF ...) 4)
> 
> cause this error when regs are on stack.  If my memory is correct,
> the similar issue has popped up on oleg's work for QI/HImode addressing
> with displacement.

Do you mean this wallpapering below?

sh.c (sh_cannot_change_mode_class) ...

  /* This effectively disallows using GENERAL_REGS for SFmode vector subregs.
     This can be problematic when SFmode vector subregs need to be accessed
     on the stack with displacement addressing, as it happens with -O0.
     Thus we disallow the mode change for -O0.  */
  if (to == SFmode && VECTOR_MODE_P (from) && GET_MODE_INNER (from) == SFmode)
    return optimize ? (reg_classes_intersect_p (GENERAL_REGS, rclass)) : false;

I think this one is a different issue...

> The above rtls are not illegal but problematic
> when regs are on stack because SH has no load/store instructions
> for FP registers and memory with displacement.  Before lowering
> subregs change in revision 187015, these subregs were decomposed
> into subregs with zero byte count.
> The trails of PR53716 say that the appropriate target-wise cost
> computation is needed, though I can't find the way to enable
> lowering the above subregs with adjusting SH's rtx cost computations.

I had a look at what's going on there.
The lower-subreg pass decides whether to do the splitting or not based on the
reg move costs of certain modes.  These costs are initially collected by
querying the rtx cost for patterns like "(set (reg:DI 154
virtual-incoming-args)".
A simple stack trace ...

lower_subreg (compute_costs)
  rtx = (set (reg:DI 154 virtual-incoming-args)

  -> insn_rtx_cost

    -> set_src_cost

      -> rtx_cost (x, SET, 1, speed_p)
    switch (code)
    {
      case REG:
        return 0;
    }

The 'rtx_cost' function always returns 0 because 'code' is 'REG', so it never
reaches sh_rtx_costs.  I wonder how this could have worked for other targets at
all.

The attached patch seems to fix the issue (at least newlib compiles for me
now).  
However, I'm completely unaware of any consequences of the rtlanal.c hunk. 
Maybe somebody else should have a look at it.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug target/53250] [4.8 Regression] [SH] ICE: in change_address_1, at emit-rtl.c:2018
  2012-05-06  0:51 [Bug target/53250] New: [4.8 Regression] [SH] ICE: in change_address_1, at emit-rtl.c:2018 kkojima at gcc dot gnu.org
  2012-05-06 10:56 ` [Bug target/53250] " olegendo at gcc dot gnu.org
  2012-05-06 18:09 ` olegendo at gcc dot gnu.org
@ 2012-05-06 23:27 ` olegendo at gcc dot gnu.org
  2012-05-07  9:26 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: olegendo at gcc dot gnu.org @ 2012-05-06 23:27 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53250

--- Comment #3 from Oleg Endo <olegendo at gcc dot gnu.org> 2012-05-06 22:39:01 UTC ---
Author: olegendo
Date: Sun May  6 22:38:57 2012
New Revision: 187218

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=187218
Log:
    PR target/53250
    * config/sh/sh.c (sh_rtx_costs): Handle SET.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/sh/sh.c


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug target/53250] [4.8 Regression] [SH] ICE: in change_address_1, at emit-rtl.c:2018
  2012-05-06  0:51 [Bug target/53250] New: [4.8 Regression] [SH] ICE: in change_address_1, at emit-rtl.c:2018 kkojima at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2012-05-06 23:27 ` olegendo at gcc dot gnu.org
@ 2012-05-07  9:26 ` rguenth at gcc dot gnu.org
  2012-05-07 10:25 ` kkojima at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-05-07  9:26 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53250

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING
   Target Milestone|---                         |4.8.0

--- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-05-07 09:24:16 UTC ---
Fixed?


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug target/53250] [4.8 Regression] [SH] ICE: in change_address_1, at emit-rtl.c:2018
  2012-05-06  0:51 [Bug target/53250] New: [4.8 Regression] [SH] ICE: in change_address_1, at emit-rtl.c:2018 kkojima at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2012-05-07  9:26 ` rguenth at gcc dot gnu.org
@ 2012-05-07 10:25 ` kkojima at gcc dot gnu.org
  2012-05-07 13:04 ` kkojima at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: kkojima at gcc dot gnu.org @ 2012-05-07 10:25 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53250

--- Comment #5 from Kazumoto Kojima <kkojima at gcc dot gnu.org> 2012-05-07 10:19:47 UTC ---
(In reply to comment #4)

Although the top level "make -k check" doesn't complete yet,
the failures for C & C++ went away.  I'll mark this PR as fixed
when the test completes.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug target/53250] [4.8 Regression] [SH] ICE: in change_address_1, at emit-rtl.c:2018
  2012-05-06  0:51 [Bug target/53250] New: [4.8 Regression] [SH] ICE: in change_address_1, at emit-rtl.c:2018 kkojima at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2012-05-07 10:25 ` kkojima at gcc dot gnu.org
@ 2012-05-07 13:04 ` kkojima at gcc dot gnu.org
  2012-05-08 16:02 ` uros at gcc dot gnu.org
  2012-05-08 16:11 ` ubizjak at gmail dot com
  7 siblings, 0 replies; 9+ messages in thread
From: kkojima at gcc dot gnu.org @ 2012-05-07 13:04 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53250

Kazumoto Kojima <kkojima at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |FIXED

--- Comment #6 from Kazumoto Kojima <kkojima at gcc dot gnu.org> 2012-05-07 13:03:01 UTC ---
Fixed.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug target/53250] [4.8 Regression] [SH] ICE: in change_address_1, at emit-rtl.c:2018
  2012-05-06  0:51 [Bug target/53250] New: [4.8 Regression] [SH] ICE: in change_address_1, at emit-rtl.c:2018 kkojima at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2012-05-07 13:04 ` kkojima at gcc dot gnu.org
@ 2012-05-08 16:02 ` uros at gcc dot gnu.org
  2012-05-08 16:11 ` ubizjak at gmail dot com
  7 siblings, 0 replies; 9+ messages in thread
From: uros at gcc dot gnu.org @ 2012-05-08 16:02 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53250

--- Comment #7 from uros at gcc dot gnu.org 2012-05-08 16:01:59 UTC ---
Author: uros
Date: Tue May  8 16:01:54 2012
New Revision: 187289

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=187289
Log:
    PR target/53250
    * config/i386/i386.c (ix86_set_reg_reg_cost): New function.
    (ix86_rtx_costs): Handle SET.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/i386/i386.c


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug target/53250] [4.8 Regression] [SH] ICE: in change_address_1, at emit-rtl.c:2018
  2012-05-06  0:51 [Bug target/53250] New: [4.8 Regression] [SH] ICE: in change_address_1, at emit-rtl.c:2018 kkojima at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2012-05-08 16:02 ` uros at gcc dot gnu.org
@ 2012-05-08 16:11 ` ubizjak at gmail dot com
  7 siblings, 0 replies; 9+ messages in thread
From: ubizjak at gmail dot com @ 2012-05-08 16:11 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53250

--- Comment #8 from Uros Bizjak <ubizjak at gmail dot com> 2012-05-08 16:05:40 UTC ---
(In reply to comment #7)
> Author: uros
> Date: Tue May  8 16:01:54 2012
> New Revision: 187289
> 
> URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=187289
> Log:
>     PR target/53250
>     * config/i386/i386.c (ix86_set_reg_reg_cost): New function.
>     (ix86_rtx_costs): Handle SET.
> 
> 
> Modified:
>     trunk/gcc/ChangeLog
>     trunk/gcc/config/i386/i386.c

Oops.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-05-08 16:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-06  0:51 [Bug target/53250] New: [4.8 Regression] [SH] ICE: in change_address_1, at emit-rtl.c:2018 kkojima at gcc dot gnu.org
2012-05-06 10:56 ` [Bug target/53250] " olegendo at gcc dot gnu.org
2012-05-06 18:09 ` olegendo at gcc dot gnu.org
2012-05-06 23:27 ` olegendo at gcc dot gnu.org
2012-05-07  9:26 ` rguenth at gcc dot gnu.org
2012-05-07 10:25 ` kkojima at gcc dot gnu.org
2012-05-07 13:04 ` kkojima at gcc dot gnu.org
2012-05-08 16:02 ` uros at gcc dot gnu.org
2012-05-08 16:11 ` ubizjak at gmail dot com

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).