[Bug c/41993] New: [sh] ICE in create_pre_exit, at mode-switching.c:399

View: New views
4 Messages — Rating Filter:   Alert me  

[Bug c/41993] New: [sh] ICE in create_pre_exit, at mode-switching.c:399

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
When I built gnustep-base, I got the following errors.
-----
mframe.m:1250: warning: cast increases required alignment of target type
mframe.m: In function 'retframe_short':
mframe.m:863: internal compiler error: in create_pre_exit, at
mode-switching.c:399
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.3/README.Bugs> for instructions.
make[3]: *** [obj/mframe.m.o] Error 1
-----

And I tested following sample program with gcc HEAD of subversion.
-----
$ cat a.c
short retframe_short (void *rframe)
{
    __builtin_return (rframe);
}
$ tools/bin/sh4-unknown-linux-gnu-gcc -c  a.c
a.c: In function 'retframe_short':
a.c:4: internal compiler error: in create_pre_exit, at mode-switching.c:399
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.4/README.Bugs> for instructions.
$ tools/bin/sh4-unknown-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=tools/bin/sh4-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/home/yoshii/work/gcc/tools/libexec/gcc/sh4-unknown-linux-gnu/4.5.0/lto-wrapper
Target: sh4-unknown-linux-gnu
Configured with: /var/src/gcc/configure --build=x86_64-pc-linux-gnu
--target=sh4-unknown-linux-gnu --prefix=/home/yoshii/work/gcc/tools
--with-sysroot=/home/yoshii/work/gcc/sysroot --with-cpu=sh4a
--with-multilib-list=sh4a,sh4a-nofpu --disable-libgomp --disable-libmudflap
--enable-incomplete_targets --enable-libssp --enable-nls --enable-shared
--enable-threads=posix --enable-symvers=gnu --enable-__cxa_atexit --enable-c99
--enable-long-long --enable-languages=c,c++
Thread model: posix
gcc version 4.5.0 20091109 (experimental) (GCC)
-----

Best regards,
  Nobuhiro


--
           Summary: [sh] ICE in create_pre_exit, at mode-switching.c:399
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: iwamatsu at nigauri dot org
GCC target triplet: sh4-unknown-linux-gnu


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


[Bug target/41993] [sh] ICE in create_pre_exit, at mode-switching.c:399

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



------- Comment #1 from kkojima at gcc dot gnu dot org  2009-11-11 21:59 -------
All 4.x sh compilers fail with similar way.  Looks only when unoptimized.
Does the patch below work for you?

--- ORIG/trunk/gcc/mode-switching.c     2009-02-21 09:26:24.000000000 +0900
+++ trunk/gcc/mode-switching.c  2009-11-11 11:03:04.000000000 +0900
@@ -325,7 +325,14 @@ create_pre_exit (int n_entities, int *en
                    else
                      break;
                    if (copy_start >= FIRST_PSEUDO_REGISTER)
-                     break;
+                     {
+                       if (!optimize)
+                         {
+                           last_insn = return_copy;
+                           continue;
+                         }
+                       break;
+                     }
                    copy_num
                      = hard_regno_nregs[copy_start][GET_MODE (copy_reg)];



BTW, I guess that __builtin_apply/__builtin_return may be a bit obsolete.
If my memory is correct, there was an argument on the list for dropping
them from the compiler.


--

kkojima at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kkojima at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |ice-on-valid-code
      Known to fail|                            |4.0.4 4.1.3 4.2.4 4.3.4
                   |                            |4.4.2 4.5.0
      Known to work|                            |3.4.6
           Priority|P3                          |P4
   Last reconfirmed|0000-00-00 00:00:00         |2009-11-11 21:59:45
               date|                            |


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


[Bug target/41993] [sh] ICE in create_pre_exit, at mode-switching.c:399

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



------- Comment #2 from iwamatsu at nigauri dot org  2009-11-17 02:55 -------
Hi, Kojima-san.

Thank you for your work and patch .
I checked this patch. Work fine with gcc-4.3.4 , gcc-4.4.2 and gcc/HEAD.

>
> BTW, I guess that __builtin_apply/__builtin_return may be a bit obsolete.
> If my memory is correct, there was an argument on the list for dropping
> them from the compiler.
>

I dont know this infomation. Thank you.
I will check this.


--

iwamatsu at nigauri dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |iwamatsu at nigauri dot org


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


[Bug target/41993] [sh] ICE in create_pre_exit, at mode-switching.c:399

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



------- Comment #3 from kkojima at gcc dot gnu dot org  2009-11-17 22:24 -------
Thanks for testing.  On second thought, the patch in #1 doesn't
the right thing and it's too intrusive if the issue happens only
with -O0 for a bit problematic feature.
Some better idea will be needed, though it seems there is no easy
way to fix this.


--


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