public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/31641]  New: [4.1/4.2/4.3 Regression] ICE in s390_expand_setmem, at config/s390/s390.c:3618
@ 2007-04-20 14:25 tbm at cyrius dot com
  2007-04-20 14:25 ` [Bug target/31641] " tbm at cyrius dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: tbm at cyrius dot com @ 2007-04-20 14:25 UTC (permalink / raw)
  To: gcc-bugs

[ Forwarded from http://bugs.debian.org/395533 ]

We're seeing the following ICE on s390.  This is with gcc 4.1, but I can
also reproduce it with current 4.3 from SVN.  I haven't tried 4.0, but 3.4
works.

raptor% /usr/lib/gcc-snapshot/bin/g++ -c -O min4.c
min4.c: In member function 'void StringTest::constructor()':
min4.c:64: internal compiler error: in s390_expand_setmem, at
config/s390/s390.c:3618
Please submit a full bug report,


-- 
           Summary: [4.1/4.2/4.3 Regression] ICE in s390_expand_setmem, at
                    config/s390/s390.c:3618
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tbm at cyrius dot com


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


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

* [Bug target/31641] [4.1/4.2/4.3 Regression] ICE in s390_expand_setmem, at config/s390/s390.c:3618
  2007-04-20 14:25 [Bug target/31641] New: [4.1/4.2/4.3 Regression] ICE in s390_expand_setmem, at config/s390/s390.c:3618 tbm at cyrius dot com
@ 2007-04-20 14:25 ` tbm at cyrius dot com
  2007-04-23 11:22 ` krebbel at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: tbm at cyrius dot com @ 2007-04-20 14:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from tbm at cyrius dot com  2007-04-20 15:25 -------
Created an attachment (id=13392)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13392&action=view)
testcase


-- 


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


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

* [Bug target/31641] [4.1/4.2/4.3 Regression] ICE in s390_expand_setmem, at config/s390/s390.c:3618
  2007-04-20 14:25 [Bug target/31641] New: [4.1/4.2/4.3 Regression] ICE in s390_expand_setmem, at config/s390/s390.c:3618 tbm at cyrius dot com
  2007-04-20 14:25 ` [Bug target/31641] " tbm at cyrius dot com
@ 2007-04-23 11:22 ` krebbel at gcc dot gnu dot org
  2007-04-23 13:51 ` uweigand at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: krebbel at gcc dot gnu dot org @ 2007-04-23 11:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from krebbel at gcc dot gnu dot org  2007-04-23 12:21 -------
In your example the memset function is called with -1 as length argument. When
GCC tries to expand this as a builtin function an assertion in the s390 back
end function s390_expand_setmem is triggered. Although an ICE is the wrong
thing to respond I would consider it a code bug as well. I've proposed a patch
to issue a proper error message and call the library function in that
situation. The library function probably would write one byte below the target
address causing a segfault for a -1 length which is most likely not what the
programmer intended but thats what would happen in the -O0 as well.


-- 

krebbel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-04-23 12:21:59
               date|                            |


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


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

* [Bug target/31641] [4.1/4.2/4.3 Regression] ICE in s390_expand_setmem, at config/s390/s390.c:3618
  2007-04-20 14:25 [Bug target/31641] New: [4.1/4.2/4.3 Regression] ICE in s390_expand_setmem, at config/s390/s390.c:3618 tbm at cyrius dot com
  2007-04-20 14:25 ` [Bug target/31641] " tbm at cyrius dot com
  2007-04-23 11:22 ` krebbel at gcc dot gnu dot org
@ 2007-04-23 13:51 ` uweigand at gcc dot gnu dot org
  2007-04-24 12:08 ` krebbel at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: uweigand at gcc dot gnu dot org @ 2007-04-23 13:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from uweigand at gcc dot gnu dot org  2007-04-23 14:51 -------
I don't think the patch is correct; according to the C standard,
the third argument of memset is of type size_t, which must be
an *unsigned* type, so it cannot in fact be negative.

What apparently happens is that the argument (after conversion to
size_t) is so big that it appears to be negative in its representation
as CONST_INT, so the assert in s390.c triggers.

A proper fix would probably be to remove the assert in s390_expand_setmem
and at the same time make sure those big sizes are handled correctly.

(In any case, the testcase certainly is broken anyway.)


-- 


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


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

* [Bug target/31641] [4.1/4.2/4.3 Regression] ICE in s390_expand_setmem, at config/s390/s390.c:3618
  2007-04-20 14:25 [Bug target/31641] New: [4.1/4.2/4.3 Regression] ICE in s390_expand_setmem, at config/s390/s390.c:3618 tbm at cyrius dot com
                   ` (2 preceding siblings ...)
  2007-04-23 13:51 ` uweigand at gcc dot gnu dot org
@ 2007-04-24 12:08 ` krebbel at gcc dot gnu dot org
  2007-04-24 12:15 ` krebbel at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: krebbel at gcc dot gnu dot org @ 2007-04-24 12:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from krebbel at gcc dot gnu dot org  2007-04-24 13:08 -------
Subject: Bug 31641

Author: krebbel
Date: Tue Apr 24 13:08:05 2007
New Revision: 124099

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=124099
Log:
2007-04-24  Andreas Krebbel  <krebbel1@de.ibm.com>

        PR target/31641
        * config/s390/s390.c (s390_expand_setmem): Don't ICE for constant
length
        argument of 0 for memset.
        (s390_expand_movmem, s390_expand_setmem, s390_expand_cmpmem): Use
        unsigned shift instead of the signed variant.

2007-04-24  Andreas Krebbel  <krebbel1@de.ibm.com>

        PR target/31641
        * gcc.c-torture/compile/pr31641.c: New testcase.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/s390/s390.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug target/31641] [4.1/4.2/4.3 Regression] ICE in s390_expand_setmem, at config/s390/s390.c:3618
  2007-04-20 14:25 [Bug target/31641] New: [4.1/4.2/4.3 Regression] ICE in s390_expand_setmem, at config/s390/s390.c:3618 tbm at cyrius dot com
                   ` (3 preceding siblings ...)
  2007-04-24 12:08 ` krebbel at gcc dot gnu dot org
@ 2007-04-24 12:15 ` krebbel at gcc dot gnu dot org
  2007-04-24 12:21 ` krebbel at gcc dot gnu dot org
  2007-04-24 12:23 ` krebbel at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: krebbel at gcc dot gnu dot org @ 2007-04-24 12:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from krebbel at gcc dot gnu dot org  2007-04-24 13:15 -------
Subject: Bug 31641

Author: krebbel
Date: Tue Apr 24 13:15:11 2007
New Revision: 124100

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=124100
Log:
2007-04-24  Andreas Krebbel  <krebbel1@de.ibm.com>

        PR target/31641
        * config/s390/s390.c (s390_expand_setmem): Don't ICE for constant
length
        argument of 0 for memset.
        (s390_expand_movmem, s390_expand_setmem, s390_expand_cmpmem): Use
        unsigned shift instead of the signed variant.

2007-04-24  Andreas Krebbel  <krebbel1@de.ibm.com>

        PR target/31641
        * gcc.c-torture/compile/pr31641.c: New testcase.


Modified:
    branches/gcc-4_1-branch/gcc/ChangeLog
    branches/gcc-4_1-branch/gcc/config/s390/s390.c
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug target/31641] [4.1/4.2/4.3 Regression] ICE in s390_expand_setmem, at config/s390/s390.c:3618
  2007-04-20 14:25 [Bug target/31641] New: [4.1/4.2/4.3 Regression] ICE in s390_expand_setmem, at config/s390/s390.c:3618 tbm at cyrius dot com
                   ` (4 preceding siblings ...)
  2007-04-24 12:15 ` krebbel at gcc dot gnu dot org
@ 2007-04-24 12:21 ` krebbel at gcc dot gnu dot org
  2007-04-24 12:23 ` krebbel at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: krebbel at gcc dot gnu dot org @ 2007-04-24 12:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from krebbel at gcc dot gnu dot org  2007-04-24 13:21 -------
Subject: Bug 31641

Author: krebbel
Date: Tue Apr 24 13:21:22 2007
New Revision: 124101

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=124101
Log:
2007-04-24  Andreas Krebbel  <krebbel1@de.ibm.com>

        PR target/31641
        * config/s390/s390.c (s390_expand_setmem): Don't ICE for constant
length
        argument of 0 for memset.
        (s390_expand_movmem, s390_expand_setmem, s390_expand_cmpmem): Use
        unsigned shift instead of the signed variant.

2007-04-24  Andreas Krebbel  <krebbel1@de.ibm.com>

        PR target/31641
        * gcc.c-torture/compile/pr31641.c: New testcase.


Modified:
    branches/gcc-4_2-branch/gcc/ChangeLog
    branches/gcc-4_2-branch/gcc/config/s390/s390.c
    branches/gcc-4_2-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug target/31641] [4.1/4.2/4.3 Regression] ICE in s390_expand_setmem, at config/s390/s390.c:3618
  2007-04-20 14:25 [Bug target/31641] New: [4.1/4.2/4.3 Regression] ICE in s390_expand_setmem, at config/s390/s390.c:3618 tbm at cyrius dot com
                   ` (5 preceding siblings ...)
  2007-04-24 12:21 ` krebbel at gcc dot gnu dot org
@ 2007-04-24 12:23 ` krebbel at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: krebbel at gcc dot gnu dot org @ 2007-04-24 12:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from krebbel at gcc dot gnu dot org  2007-04-24 13:23 -------
Ulrich approved the patch for 4.1/4.2/4.3.


-- 

krebbel at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2007-04-24 12:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-20 14:25 [Bug target/31641] New: [4.1/4.2/4.3 Regression] ICE in s390_expand_setmem, at config/s390/s390.c:3618 tbm at cyrius dot com
2007-04-20 14:25 ` [Bug target/31641] " tbm at cyrius dot com
2007-04-23 11:22 ` krebbel at gcc dot gnu dot org
2007-04-23 13:51 ` uweigand at gcc dot gnu dot org
2007-04-24 12:08 ` krebbel at gcc dot gnu dot org
2007-04-24 12:15 ` krebbel at gcc dot gnu dot org
2007-04-24 12:21 ` krebbel at gcc dot gnu dot org
2007-04-24 12:23 ` krebbel 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).