public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/17717] SH4 internal compiler error: in emit_move_insn
       [not found] <bug-17717-9380@http.gcc.gnu.org/bugzilla/>
@ 2008-10-13 10:42 ` ktietz at gcc dot gnu dot org
  0 siblings, 0 replies; 13+ messages in thread
From: ktietz at gcc dot gnu dot org @ 2008-10-13 10:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from ktietz at gcc dot gnu dot org  2008-10-13 10:41 -------
See comment above


-- 

ktietz at gcc dot gnu dot org changed:

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


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


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

* [Bug target/17717] SH4 internal compiler error: in emit_move_insn
  2004-09-28 19:32 [Bug c/17717] New: " dennisc at harding dot ca
                   ` (10 preceding siblings ...)
  2004-10-26 20:22 ` pinskia at gcc dot gnu dot org
@ 2004-10-31 15:05 ` pinskia at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-31 15:05 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-31 15:05 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-10-31 15:05:23
               date|                            |


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


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

* [Bug target/17717] SH4 internal compiler error: in emit_move_insn
  2004-09-28 19:32 [Bug c/17717] New: " dennisc at harding dot ca
                   ` (9 preceding siblings ...)
  2004-10-26 18:52 ` dennisc at harding dot ca
@ 2004-10-26 20:22 ` pinskia at gcc dot gnu dot org
  2004-10-31 15:05 ` pinskia at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-26 20:22 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.4.2                       |---


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


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

* [Bug target/17717] SH4 internal compiler error: in emit_move_insn
  2004-09-28 19:32 [Bug c/17717] New: " dennisc at harding dot ca
                   ` (8 preceding siblings ...)
  2004-10-26 18:45 ` dennisc at harding dot ca
@ 2004-10-26 18:52 ` dennisc at harding dot ca
  2004-10-26 20:22 ` pinskia at gcc dot gnu dot org
  2004-10-31 15:05 ` pinskia at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: dennisc at harding dot ca @ 2004-10-26 18:52 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dennisc at harding dot ca  2004-10-26 18:52 -------
I have found a patch for this problem that was proposed by DJ Delorie about a
year ago. His posting in the mailing list is at
http://gcc.gnu.org/ml/gcc-patches/2003-10/msg02277.html which I have copied below.

    * From: DJ Delorie <dj at redhat dot com>
    * To: gcc-patches at gcc dot gnu dot org
    * Cc: dj at redhat dot com
    * Date: Fri, 24 Oct 2003 23:10:31 -0400
    * Subject: [patch] sh-elf, -mrenesas, FUNCTION_VALUE

This file:

char bar(int);

void foo (char *f, int i)
{
  f[i] = bar(i);
}

Fails thusly:

$ ./cc1 -quiet -mrenesas -O2 -m4 dj.c
dj.c: In function `foo':

dj.c:5: internal compiler error: in emit_move_insn, at expr.c:2792


The failure is due to bar()'s return value being mispromoted, leading
to a (set (QI) (SI)).  Proposed patch follows.  Comments?


2003-10-24  DJ Delorie  <dj@redhat.com>

	* config/sh/sh.h (FUNCTION_VALUE): Support renesas attribute.

Index: config/sh/sh.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sh/sh.h,v
retrieving revision 1.225
diff -p -2 -r1.225 sh.h
*** config/sh/sh.h	13 Oct 2003 21:16:32 -0000	1.225
--- config/sh/sh.h	25 Oct 2003 02:35:39 -0000
*************** extern enum reg_class reg_class_from_let
*** 1634,1646 ****
  #define FUNCTION_VALUE(VALTYPE, FUNC)					\
    gen_rtx (REG,								\
! 	   ((GET_MODE_CLASS (TYPE_MODE (VALTYPE)) == MODE_INT		\
! 	     && GET_MODE_SIZE (TYPE_MODE (VALTYPE)) < UNITS_PER_WORD	\
! 	     && (TREE_CODE (VALTYPE) == INTEGER_TYPE			\
! 		 || TREE_CODE (VALTYPE) == ENUMERAL_TYPE		\
! 		 || TREE_CODE (VALTYPE) == BOOLEAN_TYPE			\
! 		 || TREE_CODE (VALTYPE) == CHAR_TYPE			\
! 		 || TREE_CODE (VALTYPE) == REAL_TYPE			\
! 		 || TREE_CODE (VALTYPE) == OFFSET_TYPE))		\
! 	    ? (TARGET_SHMEDIA ? DImode : SImode) : TYPE_MODE (VALTYPE)), \
  	   BASE_RETURN_VALUE_REG (TYPE_MODE (VALTYPE)))
  
--- 1634,1648 ----
  #define FUNCTION_VALUE(VALTYPE, FUNC)					\
    gen_rtx (REG,								\
!            sh_attr_renesas_p (FUNC)					\
! 	   ? TYPE_MODE (VALTYPE)					\
! 	   : ((GET_MODE_CLASS (TYPE_MODE (VALTYPE)) == MODE_INT		\
! 	       && GET_MODE_SIZE (TYPE_MODE (VALTYPE)) < UNITS_PER_WORD	\
! 	       && (TREE_CODE (VALTYPE) == INTEGER_TYPE			\
! 		   || TREE_CODE (VALTYPE) == ENUMERAL_TYPE		\
! 		   || TREE_CODE (VALTYPE) == BOOLEAN_TYPE		\
! 		   || TREE_CODE (VALTYPE) == CHAR_TYPE			\
! 		   || TREE_CODE (VALTYPE) == REAL_TYPE			\
! 		   || TREE_CODE (VALTYPE) == OFFSET_TYPE))		\
! 	      ? (TARGET_SHMEDIA ? DImode : SImode) : TYPE_MODE (VALTYPE)), \
  	   BASE_RETURN_VALUE_REG (TYPE_MODE (VALTYPE)))


I'm not really able to judge the nature of the patch, but I will test it as soon
as I can get GCC version 3.4.2 to recognize the -mrenesas switch again.

-- 


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


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

* [Bug target/17717] SH4 internal compiler error: in emit_move_insn
  2004-09-28 19:32 [Bug c/17717] New: " dennisc at harding dot ca
                   ` (7 preceding siblings ...)
  2004-10-26 18:40 ` dennisc at harding dot ca
@ 2004-10-26 18:45 ` dennisc at harding dot ca
  2004-10-26 18:52 ` dennisc at harding dot ca
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: dennisc at harding dot ca @ 2004-10-26 18:45 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dennisc at harding dot ca  2004-10-26 18:45 -------
I was premature in reporting that version 3.4.2 fixed this bug. I didn't get a
ICE on my test file anymore, but not because the bug was fixed. It turns out
that version 3.4.2 compilers ignore the -mrenesas target option and always
generate code for the standard ABI. This additional bug hid the orginal problem
since it only occurs when using the renesas ABI. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
      Known to work|3.4.2                       |
         Resolution|FIXED                       |


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


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

* [Bug target/17717] SH4 internal compiler error: in emit_move_insn
  2004-09-28 19:32 [Bug c/17717] New: " dennisc at harding dot ca
                   ` (6 preceding siblings ...)
  2004-10-21  1:31 ` pinskia at gcc dot gnu dot org
@ 2004-10-26 18:40 ` dennisc at harding dot ca
  2004-10-26 18:45 ` dennisc at harding dot ca
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: dennisc at harding dot ca @ 2004-10-26 18:40 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dennisc at harding dot ca  2004-10-26 18:40 -------
(From update of attachment 7387)
The ICE is triggered by the char function return value assignment when
compiling for the Renesas ABI.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #7387|preprocessed 6line file that|preprocessed 6 line file
        description|triggers ICE                |that triggers ICE


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


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

* [Bug target/17717] SH4 internal compiler error: in emit_move_insn
  2004-09-28 19:32 [Bug c/17717] New: " dennisc at harding dot ca
                   ` (5 preceding siblings ...)
  2004-10-20 22:17 ` dennisc at harding dot ca
@ 2004-10-21  1:31 ` pinskia at gcc dot gnu dot org
  2004-10-26 18:40 ` dennisc at harding dot ca
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-21  1:31 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-21 01:30 -------
Fixed so closing.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |3.4.2


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


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

* [Bug target/17717] SH4 internal compiler error: in emit_move_insn
  2004-09-28 19:32 [Bug c/17717] New: " dennisc at harding dot ca
                   ` (4 preceding siblings ...)
  2004-10-20 18:49 ` dennisc at harding dot ca
@ 2004-10-20 22:17 ` dennisc at harding dot ca
  2004-10-21  1:31 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: dennisc at harding dot ca @ 2004-10-20 22:17 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dennisc at harding dot ca  2004-10-20 22:17 -------
I have requilt my cross compiler using the latest GCC 3.4.2 source and the bug
is gone. It compiles the same test case code without the ICE. 

This bug can probably be closed now. Good job.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |3.4.0
      Known to work|                            |3.4.2


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


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

* [Bug target/17717] SH4 internal compiler error: in emit_move_insn
  2004-09-28 19:32 [Bug c/17717] New: " dennisc at harding dot ca
                   ` (3 preceding siblings ...)
  2004-10-20 18:06 ` dennisc at harding dot ca
@ 2004-10-20 18:49 ` dennisc at harding dot ca
  2004-10-20 22:17 ` dennisc at harding dot ca
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: dennisc at harding dot ca @ 2004-10-20 18:49 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dennisc at harding dot ca  2004-10-20 18:49 -------
This bug is triggered by calls to functions that return a char value combined
with the -mrenesas compiler option. Removing the compiler option, or changing
the functions return type to int will both eliminate the error. 

-- 


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


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

* [Bug target/17717] SH4 internal compiler error: in emit_move_insn
  2004-09-28 19:32 [Bug c/17717] New: " dennisc at harding dot ca
                   ` (2 preceding siblings ...)
  2004-10-20 18:04 ` dennisc at harding dot ca
@ 2004-10-20 18:06 ` dennisc at harding dot ca
  2004-10-20 18:49 ` dennisc at harding dot ca
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: dennisc at harding dot ca @ 2004-10-20 18:06 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dennisc at harding dot ca  2004-10-20 18:06 -------
Created an attachment (id=7388)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=7388&action=view)
gcc command and output for minimal test

This is the command line and compiler output produce with the new minimal
trigger file.

This file will compile if the command line option -mrenesas is removed.

-- 


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


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

* [Bug target/17717] SH4 internal compiler error: in emit_move_insn
  2004-09-28 19:32 [Bug c/17717] New: " dennisc at harding dot ca
  2004-09-28 22:31 ` [Bug target/17717] " pinskia at gcc dot gnu dot org
  2004-10-13 16:01 ` dennisc at harding dot ca
@ 2004-10-20 18:04 ` dennisc at harding dot ca
  2004-10-20 18:06 ` dennisc at harding dot ca
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: dennisc at harding dot ca @ 2004-10-20 18:04 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dennisc at harding dot ca  2004-10-20 18:04 -------
Created an attachment (id=7387)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=7387&action=view)
preprocessed 6line file that triggers ICE

This is the preprocessor output of a minimal (6 line) file that triggers the
ICE.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
Attachment #7232 is|0                           |1
           obsolete|                            |
Attachment #7233 is|0                           |1
           obsolete|                            |


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


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

* [Bug target/17717] SH4 internal compiler error: in emit_move_insn
  2004-09-28 19:32 [Bug c/17717] New: " dennisc at harding dot ca
  2004-09-28 22:31 ` [Bug target/17717] " pinskia at gcc dot gnu dot org
@ 2004-10-13 16:01 ` dennisc at harding dot ca
  2004-10-20 18:04 ` dennisc at harding dot ca
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: dennisc at harding dot ca @ 2004-10-13 16:01 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #7232|preprocessed source for     |preprocessed source for
        description|first inteernal error case  |first internal error case


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


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

* [Bug target/17717] SH4 internal compiler error: in emit_move_insn
  2004-09-28 19:32 [Bug c/17717] New: " dennisc at harding dot ca
@ 2004-09-28 22:31 ` pinskia at gcc dot gnu dot org
  2004-10-13 16:01 ` dennisc at harding dot ca
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-09-28 22:31 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|critical                    |normal
          Component|middle-end                  |target
           Keywords|                            |ice-on-valid-code


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


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

end of thread, other threads:[~2008-10-13 10:42 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-17717-9380@http.gcc.gnu.org/bugzilla/>
2008-10-13 10:42 ` [Bug target/17717] SH4 internal compiler error: in emit_move_insn ktietz at gcc dot gnu dot org
2004-09-28 19:32 [Bug c/17717] New: " dennisc at harding dot ca
2004-09-28 22:31 ` [Bug target/17717] " pinskia at gcc dot gnu dot org
2004-10-13 16:01 ` dennisc at harding dot ca
2004-10-20 18:04 ` dennisc at harding dot ca
2004-10-20 18:06 ` dennisc at harding dot ca
2004-10-20 18:49 ` dennisc at harding dot ca
2004-10-20 22:17 ` dennisc at harding dot ca
2004-10-21  1:31 ` pinskia at gcc dot gnu dot org
2004-10-26 18:40 ` dennisc at harding dot ca
2004-10-26 18:45 ` dennisc at harding dot ca
2004-10-26 18:52 ` dennisc at harding dot ca
2004-10-26 20:22 ` pinskia at gcc dot gnu dot org
2004-10-31 15:05 ` pinskia 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).