public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/49220] New: ICE in create_pre_exit, at mode-switching.c:401
@ 2011-05-29  8:06 rmansfield at qnx dot com
  2011-05-29 13:02 ` [Bug middle-end/49220] " kkojima at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: rmansfield at qnx dot com @ 2011-05-29  8:06 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: ICE in create_pre_exit, at mode-switching.c:401
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: rmansfield@qnx.com
              Host: x86_64-linux-gnu
            Target: sh4-unknown-linux-gnu
             Build: x86_64-linux-gnu


Created attachment 24389
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24389
preprocessed source

$ ./xgcc -v
Using built-in specs.
COLLECT_GCC=./xgcc
Target: sh4-unknown-linux-gnu
Configured with: ../configure --target=sh4-unknown-linux-gnu
--prefix=/home/ryan/x-tools/sh4-unknown-linux-gnuc
--with-local-prefix=/home/ryan/x-tools/sh4-unknown-linux-gnu/sh4-unknown-linux-gnu/sys-root
--disable-multilib
--with-sysroot=/home/ryan/x-tools/sh4-unknown-linux-gnu/sh4-unknown-linux-gnu/sys-root
--with-newlib --enable-threads=no --disable-shared --enable-__cxa_atexit
--disable-nls --enable-symvers=gnu --enable-languages=c
--enable-target-optspace --enable-checking --disable-libmudflap
--disable-libssp
Thread model: single
gcc version 4.7.0 20110529 (experimental) [trunk revision 174391] (GCC) 
$ ./xgcc -B. ~/ice.i -O2
/home/ryan/ice.i: In function 'func4':
/home/ryan/ice.i:25:1: internal compiler error: in create_pre_exit, at
mode-switching.c:401
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


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

* [Bug middle-end/49220] ICE in create_pre_exit, at mode-switching.c:401
  2011-05-29  8:06 [Bug middle-end/49220] New: ICE in create_pre_exit, at mode-switching.c:401 rmansfield at qnx dot com
@ 2011-05-29 13:02 ` kkojima at gcc dot gnu.org
  2012-07-15 22:20 ` olegendo at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: kkojima at gcc dot gnu.org @ 2011-05-29 13:02 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-invalid-code
                 CC|                            |kkojima at gcc dot gnu.org

--- Comment #1 from Kazumoto Kojima <kkojima at gcc dot gnu.org> 2011-05-29 12:39:21 UTC ---
I think that create_pre_exit is used by SH target only.
I'm testing the patch below.

--- ORIG/trunk/gcc/mode-switching.c    2010-11-20 09:24:49.000000000 +0900
+++ trunk/gcc/mode-switching.c    2011-05-29 21:24:18.000000000 +0900
@@ -324,7 +324,14 @@ create_pre_exit (int n_entities, int *en
                  && GET_CODE (SUBREG_REG (copy_reg)) == REG)
               copy_start = REGNO (SUBREG_REG (copy_reg));
             else
-              break;
+              {
+            /* When control reaches end of non-void function,
+               there are no return copy insns at all.  This
+               avoids an ice on that invalid function.  */
+            if (ret_start + nregs == ret_end)
+              short_block = 1;
+            break;
+              }
             if (copy_start >= FIRST_PSEUDO_REGISTER)
               break;
             copy_num


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

* [Bug middle-end/49220] ICE in create_pre_exit, at mode-switching.c:401
  2011-05-29  8:06 [Bug middle-end/49220] New: ICE in create_pre_exit, at mode-switching.c:401 rmansfield at qnx dot com
  2011-05-29 13:02 ` [Bug middle-end/49220] " kkojima at gcc dot gnu.org
@ 2012-07-15 22:20 ` olegendo at gcc dot gnu.org
  2012-11-06  4:35 ` amylaar at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: olegendo at gcc dot gnu.org @ 2012-07-15 22:20 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-07-15
                 CC|                            |amylaar at gcc dot gnu.org,
                   |                            |olegendo at gcc dot gnu.org
     Ever Confirmed|0                           |1

--- Comment #2 from Oleg Endo <olegendo at gcc dot gnu.org> 2012-07-15 22:20:05 UTC ---
(In reply to comment #1)
> I think that create_pre_exit is used by SH target only.

The Epiphany target defines MODE_ENTRY and MODE_EXIT, which makes it use
create_pre_exit, too.
Jörn, do you have any objections to the change in comment #1?


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

* [Bug middle-end/49220] ICE in create_pre_exit, at mode-switching.c:401
  2011-05-29  8:06 [Bug middle-end/49220] New: ICE in create_pre_exit, at mode-switching.c:401 rmansfield at qnx dot com
  2011-05-29 13:02 ` [Bug middle-end/49220] " kkojima at gcc dot gnu.org
  2012-07-15 22:20 ` olegendo at gcc dot gnu.org
@ 2012-11-06  4:35 ` amylaar at gcc dot gnu.org
  2012-11-06  9:51 ` ubizjak at gmail dot com
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: amylaar at gcc dot gnu.org @ 2012-11-06  4:35 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #3 from Jorn Wolfgang Rennecke <amylaar at gcc dot gnu.org> 2012-11-06 04:35:14 UTC ---
(In reply to comment #2)
> (In reply to comment #1)
> > I think that create_pre_exit is used by SH target only.
> 
> The Epiphany target defines MODE_ENTRY and MODE_EXIT, which makes it use
> create_pre_exit, too.
> Jörn, do you have any objections to the change in comment #1?

It would be nice if we could indeed verify that the function returns
without a value.  I'm not sure that there's much left of the sanity
check with all these exceptions.

That being said, the Epiphany has very different reload issues.
I.e. addition (as for some address calculations) and logical operations
(as are necessary to perform a mode switch) clobber the flags.
Which, in general, cannot be guaranteed to be free, so we might have to
save the flags...
Bu there is no conflict of the return value registers with the registers needed
to effect the mode switch.  Or pretty much anything else.  So, I don't think
you could see the equivalent of PR16482 on Epiphany.  We need mode switches
at the function end, but if it happens before or after the return value
copy is mostly a distinction without a difference.  The scheduler might
even want to interleave these operations.


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

* [Bug middle-end/49220] ICE in create_pre_exit, at mode-switching.c:401
  2011-05-29  8:06 [Bug middle-end/49220] New: ICE in create_pre_exit, at mode-switching.c:401 rmansfield at qnx dot com
                   ` (2 preceding siblings ...)
  2012-11-06  4:35 ` amylaar at gcc dot gnu.org
@ 2012-11-06  9:51 ` ubizjak at gmail dot com
  2012-11-06 14:47 ` ubizjak at gmail dot com
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: ubizjak at gmail dot com @ 2012-11-06  9:51 UTC (permalink / raw)
  To: gcc-bugs


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

Uros Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ubizjak at gmail dot com

--- Comment #4 from Uros Bizjak <ubizjak at gmail dot com> 2012-11-06 09:51:31 UTC ---
x86 also uses MODE_EXIT for AVX vzeroupper insertion. The test however doesn't
fail on this target.


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

* [Bug middle-end/49220] ICE in create_pre_exit, at mode-switching.c:401
  2011-05-29  8:06 [Bug middle-end/49220] New: ICE in create_pre_exit, at mode-switching.c:401 rmansfield at qnx dot com
                   ` (3 preceding siblings ...)
  2012-11-06  9:51 ` ubizjak at gmail dot com
@ 2012-11-06 14:47 ` ubizjak at gmail dot com
  2012-11-06 23:22 ` kkojima at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: ubizjak at gmail dot com @ 2012-11-06 14:47 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #5 from Uros Bizjak <ubizjak at gmail dot com> 2012-11-06 14:46:59 UTC ---
Kaz, can you please submit the patch from comment #1 to the mailing list?


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

* [Bug middle-end/49220] ICE in create_pre_exit, at mode-switching.c:401
  2011-05-29  8:06 [Bug middle-end/49220] New: ICE in create_pre_exit, at mode-switching.c:401 rmansfield at qnx dot com
                   ` (4 preceding siblings ...)
  2012-11-06 14:47 ` ubizjak at gmail dot com
@ 2012-11-06 23:22 ` kkojima at gcc dot gnu.org
  2012-11-07 10:48 ` kkojima at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: kkojima at gcc dot gnu.org @ 2012-11-06 23:22 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #6 from Kazumoto Kojima <kkojima at gcc dot gnu.org> 2012-11-06 23:21:46 UTC ---
I'll post it when the usual tests on x86 and sh are done.


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

* [Bug middle-end/49220] ICE in create_pre_exit, at mode-switching.c:401
  2011-05-29  8:06 [Bug middle-end/49220] New: ICE in create_pre_exit, at mode-switching.c:401 rmansfield at qnx dot com
                   ` (5 preceding siblings ...)
  2012-11-06 23:22 ` kkojima at gcc dot gnu.org
@ 2012-11-07 10:48 ` kkojima at gcc dot gnu.org
  2012-11-07 23:23 ` kkojima at gcc dot gnu.org
  2012-11-08  7:22 ` ubizjak at gmail dot com
  8 siblings, 0 replies; 10+ messages in thread
From: kkojima at gcc dot gnu.org @ 2012-11-07 10:48 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #7 from Kazumoto Kojima <kkojima at gcc dot gnu.org> 2012-11-07 10:48:22 UTC ---
Author: kkojima
Date: Wed Nov  7 10:48:12 2012
New Revision: 193289

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=193289
Log:
    PR middle-end/49220
    * mode-switching.c (create_pre_exit): Set short_block if there
    are no copy insns.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/mode-switching.c


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

* [Bug middle-end/49220] ICE in create_pre_exit, at mode-switching.c:401
  2011-05-29  8:06 [Bug middle-end/49220] New: ICE in create_pre_exit, at mode-switching.c:401 rmansfield at qnx dot com
                   ` (6 preceding siblings ...)
  2012-11-07 10:48 ` kkojima at gcc dot gnu.org
@ 2012-11-07 23:23 ` kkojima at gcc dot gnu.org
  2012-11-08  7:22 ` ubizjak at gmail dot com
  8 siblings, 0 replies; 10+ messages in thread
From: kkojima at gcc dot gnu.org @ 2012-11-07 23:23 UTC (permalink / raw)
  To: gcc-bugs


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

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

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

--- Comment #8 from Kazumoto Kojima <kkojima at gcc dot gnu.org> 2012-11-07 23:21:58 UTC ---
Fixed on trunk.


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

* [Bug middle-end/49220] ICE in create_pre_exit, at mode-switching.c:401
  2011-05-29  8:06 [Bug middle-end/49220] New: ICE in create_pre_exit, at mode-switching.c:401 rmansfield at qnx dot com
                   ` (7 preceding siblings ...)
  2012-11-07 23:23 ` kkojima at gcc dot gnu.org
@ 2012-11-08  7:22 ` ubizjak at gmail dot com
  8 siblings, 0 replies; 10+ messages in thread
From: ubizjak at gmail dot com @ 2012-11-08  7:22 UTC (permalink / raw)
  To: gcc-bugs


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

Uros Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|                            |http://gcc.gnu.org/ml/gcc-p
                   |                            |atches/2012-11/msg00615.htm
                   |                            |l
   Target Milestone|---                         |4.8.0


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

end of thread, other threads:[~2012-11-08  7:22 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-29  8:06 [Bug middle-end/49220] New: ICE in create_pre_exit, at mode-switching.c:401 rmansfield at qnx dot com
2011-05-29 13:02 ` [Bug middle-end/49220] " kkojima at gcc dot gnu.org
2012-07-15 22:20 ` olegendo at gcc dot gnu.org
2012-11-06  4:35 ` amylaar at gcc dot gnu.org
2012-11-06  9:51 ` ubizjak at gmail dot com
2012-11-06 14:47 ` ubizjak at gmail dot com
2012-11-06 23:22 ` kkojima at gcc dot gnu.org
2012-11-07 10:48 ` kkojima at gcc dot gnu.org
2012-11-07 23:23 ` kkojima at gcc dot gnu.org
2012-11-08  7:22 ` 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).