public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/40154]  New: internal compiler error: in do_SUBST, at combine.c:681
@ 2009-05-15  2:21 rmansfield at qnx dot com
  2009-05-16  0:08 ` [Bug middle-end/40154] [4.4/4.5 Regression] " kkojima at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: rmansfield at qnx dot com @ 2009-05-15  2:21 UTC (permalink / raw)
  To: gcc-bugs

ryan@ryan:~/gcc/trunk/gcc/build/gcc$ ./xgcc -v
Using built-in specs.
Target: sh4-unknown-linux-gnu
Configured with: ../configure --build=i486-build_pc-linux-gnu
--host=i486-build_pc-linux-gnu --target=sh4-unknown-linux-gnu
--prefix=/home/ryan/crosstool-ng-1.3.1/targets/sh4-unknown-linux-gnu/build/gcc-core-static
--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
Thread model: single
gcc version 4.5.0 20090515 (experimental) [trunk revision 147550] (GCC)


$ cat ~/ice.i
char buf[20];

int main() {
        long long int t = 50;
        strcpy(buf, "hello world");
        t *= 1000000000;
        for(;;)
            foo(&t);
}
ryan@ryan:~/gcc/trunk/gcc/build/gcc$ ./xgcc -B. -O ~/ice.i
/home/ryan/ice.i: In function 'main':
/home/ryan/ice.i:5: warning: incompatible implicit declaration of built-in
function 'strcpy'
/home/ryan/ice.i:9: internal compiler error: in do_SUBST, at combine.c:681
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Works in gcc 4.3.3. Fails in gcc 4.4.0 and trunk (4.5.0 20090515)


-- 
           Summary: internal compiler error: in do_SUBST, at combine.c:681
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rmansfield at qnx dot com
 GCC build triplet: i486-build_pc-linux-gnu
  GCC host triplet: i486-build_pc-linux-gnu
GCC target triplet: sh4-unknown-linux-gnu


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


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

* [Bug middle-end/40154] [4.4/4.5 Regression] internal compiler error: in do_SUBST, at combine.c:681
  2009-05-15  2:21 [Bug middle-end/40154] New: internal compiler error: in do_SUBST, at combine.c:681 rmansfield at qnx dot com
@ 2009-05-16  0:08 ` kkojima at gcc dot gnu dot org
  2009-06-03  0:19 ` kkojima at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: kkojima at gcc dot gnu dot org @ 2009-05-16  0:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from kkojima at gcc dot gnu dot org  2009-05-16 00:08 -------
I've tried to see what is going on with -da.
.expand rtl dump shows that t *= 1000000000 is compiled to
a sequence of insns and the last two insns are:

(insn 87 86 88 ice.i:6 (parallel [
            (set (subreg:SI (reg:DI 220) 0)
                (ashift:SI (subreg:SI (reg:DI 218) 0)
                    (const_int 9 [0x9])))
            (clobber (scratch:SI))
        ]) -1 (expr_list:REG_EQUAL (mult:DI (reg:DI 169)
            (const_int 1000000000 [0x3b9aca00]))
        (nil)))

(insn 88 87 0 ice.i:6 (set (mem/c/i:DI (plus:SI (reg/f:SI 167)
                (const_int 56 [0x38])) [0 t+0 S8 A32])
        (reg:DI 220)) -1 (nil))

Then CSE pass folds the constant multiplication and replaces
the above insn 87 with

(insn 87 86 108 2 ice.i:6 (set (reg:SI 229)
        (const_int -1539607552 [0xffffffffa43b7400])) 175 {movsi_ie}
(expr_list:REG_EQUAL (const_int 50000000000 [0xba43b7400])
        (nil)))

and do_SUBST complains that SImode reg can't hold 50000000000
at the combine pass.
I guess that the REG_EQUAL note of the original insn 87 is
suspicious.  It seems that the patch below avoids the problem,
though it may be completely wrong.  I'll ask the middle-end
experts on the gcc list about this issue.

--- ORIG/trunk/gcc/expmed.c     2009-05-12 19:17:54.000000000 +0900
+++ trunk/gcc/expmed.c  2009-05-16 08:34:14.000000000 +0900
@@ -2958,7 +2958,7 @@ expand_mult_const (enum machine_mode mod
                   enum mult_variant variant)
 {
   HOST_WIDE_INT val_so_far;
-  rtx insn, accum, tem;
+  rtx insn, accum, tem, set;
   int opno;
   enum machine_mode nmode;

@@ -3074,9 +3074,12 @@ expand_mult_const (enum machine_mode mod
        }

       insn = get_last_insn ();
-      set_unique_reg_note (insn, REG_EQUAL,
-                          gen_rtx_MULT (nmode, tem,
-                                        GEN_INT (val_so_far)));
+      set = single_set (insn);
+      if (set != 0
+         && GET_MODE (SET_DEST (set)) == nmode)
+       set_unique_reg_note (insn, REG_EQUAL,
+                            gen_rtx_MULT (nmode, tem,
+                                          GEN_INT (val_so_far)));
     }

   if (variant == negate_variant)


-- 

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.4.0 4.5.0
      Known to work|                            |4.3.3
           Priority|P3                          |P4
   Last reconfirmed|0000-00-00 00:00:00         |2009-05-16 00:08:06
               date|                            |
            Summary|internal compiler error: in |[4.4/4.5 Regression]
                   |do_SUBST, at combine.c:681  |internal compiler error: in
                   |                            |do_SUBST, at combine.c:681


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


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

* [Bug middle-end/40154] [4.4/4.5 Regression] internal compiler error: in do_SUBST, at combine.c:681
  2009-05-15  2:21 [Bug middle-end/40154] New: internal compiler error: in do_SUBST, at combine.c:681 rmansfield at qnx dot com
  2009-05-16  0:08 ` [Bug middle-end/40154] [4.4/4.5 Regression] " kkojima at gcc dot gnu dot org
@ 2009-06-03  0:19 ` kkojima at gcc dot gnu dot org
  2009-07-15  7:31 ` steven at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: kkojima at gcc dot gnu dot org @ 2009-06-03  0:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from kkojima at gcc dot gnu dot org  2009-06-03 00:18 -------
Currently workarounded for SH with the patch applied as revision
148018 and 148106.  It defines a new DImode arithmetic shift left
expander which generates SH's movdi_i insn as its last insn.
movdi_i is a DImode move insn and expand_mult_const will mark
it with the REG_EQUAL note in the problem.


-- 


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


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

* [Bug middle-end/40154] [4.4/4.5 Regression] internal compiler error: in do_SUBST, at combine.c:681
  2009-05-15  2:21 [Bug middle-end/40154] New: internal compiler error: in do_SUBST, at combine.c:681 rmansfield at qnx dot com
  2009-05-16  0:08 ` [Bug middle-end/40154] [4.4/4.5 Regression] " kkojima at gcc dot gnu dot org
  2009-06-03  0:19 ` kkojima at gcc dot gnu dot org
@ 2009-07-15  7:31 ` steven at gcc dot gnu dot org
  2009-10-15 12:55 ` jakub at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: steven at gcc dot gnu dot org @ 2009-07-15  7:31 UTC (permalink / raw)
  To: gcc-bugs



-- 

steven at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.4.2


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


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

* [Bug middle-end/40154] [4.4/4.5 Regression] internal compiler error: in do_SUBST, at combine.c:681
  2009-05-15  2:21 [Bug middle-end/40154] New: internal compiler error: in do_SUBST, at combine.c:681 rmansfield at qnx dot com
                   ` (2 preceding siblings ...)
  2009-07-15  7:31 ` steven at gcc dot gnu dot org
@ 2009-10-15 12:55 ` jakub at gcc dot gnu dot org
  2010-01-21 13:18 ` jakub at gcc dot gnu dot org
  2010-04-30  9:00 ` [Bug middle-end/40154] [4.4/4.5/4.6 " jakub at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-10-15 12:55 UTC (permalink / raw)
  To: gcc-bugs



-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.4.2                       |4.4.3


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


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

* [Bug middle-end/40154] [4.4/4.5 Regression] internal compiler error: in do_SUBST, at combine.c:681
  2009-05-15  2:21 [Bug middle-end/40154] New: internal compiler error: in do_SUBST, at combine.c:681 rmansfield at qnx dot com
                   ` (3 preceding siblings ...)
  2009-10-15 12:55 ` jakub at gcc dot gnu dot org
@ 2010-01-21 13:18 ` jakub at gcc dot gnu dot org
  2010-04-30  9:00 ` [Bug middle-end/40154] [4.4/4.5/4.6 " jakub at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-01-21 13:18 UTC (permalink / raw)
  To: gcc-bugs



-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.4.3                       |4.4.4


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


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

* [Bug middle-end/40154] [4.4/4.5/4.6 Regression] internal compiler error: in do_SUBST, at combine.c:681
  2009-05-15  2:21 [Bug middle-end/40154] New: internal compiler error: in do_SUBST, at combine.c:681 rmansfield at qnx dot com
                   ` (4 preceding siblings ...)
  2010-01-21 13:18 ` jakub at gcc dot gnu dot org
@ 2010-04-30  9:00 ` jakub at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-04-30  9:00 UTC (permalink / raw)
  To: gcc-bugs



-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.4.4                       |4.4.5


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


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

end of thread, other threads:[~2010-04-30  9:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-15  2:21 [Bug middle-end/40154] New: internal compiler error: in do_SUBST, at combine.c:681 rmansfield at qnx dot com
2009-05-16  0:08 ` [Bug middle-end/40154] [4.4/4.5 Regression] " kkojima at gcc dot gnu dot org
2009-06-03  0:19 ` kkojima at gcc dot gnu dot org
2009-07-15  7:31 ` steven at gcc dot gnu dot org
2009-10-15 12:55 ` jakub at gcc dot gnu dot org
2010-01-21 13:18 ` jakub at gcc dot gnu dot org
2010-04-30  9:00 ` [Bug middle-end/40154] [4.4/4.5/4.6 " jakub at gcc dot gnu dot org

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