public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/42667]  New: internal compiler error: in insert_into_preds_of_block, at tree-ssa-pre.c:3146
@ 2010-01-09  6:05 jerstlouis at gmail dot com
  2010-01-09  6:08 ` [Bug c/42667] " jerstlouis at gmail dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: jerstlouis at gmail dot com @ 2010-01-09  6:05 UTC (permalink / raw)
  To: gcc-bugs

Compile this with -O2 -m32:

extern int strlen(const char *);
void WriteTextDots(int len);

void OnDisplay(char * string)
{
   if(!string) string = "(none)";
   WriteTextDots(strlen(string));
}


-- 
           Summary: internal compiler error: in insert_into_preds_of_block,
                    at tree-ssa-pre.c:3146
           Product: gcc
           Version: 4.4.1
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jerstlouis at gmail dot com
  GCC host triplet: x86_64-linux-gnu
GCC target triplet: i686-linux-gnu


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


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

* [Bug c/42667] internal compiler error: in insert_into_preds_of_block, at tree-ssa-pre.c:3146
  2010-01-09  6:05 [Bug c/42667] New: internal compiler error: in insert_into_preds_of_block, at tree-ssa-pre.c:3146 jerstlouis at gmail dot com
@ 2010-01-09  6:08 ` jerstlouis at gmail dot com
  2010-01-09 11:25 ` [Bug c/42667] [4.4/4.5 Regression] " rguenth at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jerstlouis at gmail dot com @ 2010-01-09  6:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from jerstlouis at gmail dot com  2010-01-09 06:08 -------
Created an attachment (id=19516)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19516&action=view)
test case


-- 


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


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

* [Bug c/42667] [4.4/4.5 Regression] internal compiler error: in insert_into_preds_of_block, at tree-ssa-pre.c:3146
  2010-01-09  6:05 [Bug c/42667] New: internal compiler error: in insert_into_preds_of_block, at tree-ssa-pre.c:3146 jerstlouis at gmail dot com
  2010-01-09  6:08 ` [Bug c/42667] " jerstlouis at gmail dot com
@ 2010-01-09 11:25 ` rguenth at gcc dot gnu dot org
  2010-01-09 12:07 ` [Bug middle-end/42667] " rguenth at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-01-09 11:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2010-01-09 11:25 -------
Confirmed.

We arrive at PRE with

OnDisplay (char * string)
{
  int D.1959;

<bb 2>:
  if (string_2(D) == 0B)
    goto <bb 5>;
  else
    goto <bb 3>;

<bb 5>:
  goto <bb 4>;

<bb 3>:

<bb 4>:
  # string_1 = PHI <string_2(D)(3), &"(none)"[0](5)>
  D.1959_4 = strlen (string_1);
  WriteTextDots (D.1959_4);
  return;


note the missing conversion on the strlen return value assignment which
misses already from the original frontend trees.  This is because the
builtin strlen has a proper prototype which is overridden by the
invalid prototype

  extern int strlen(const char *);

The PRE assert might look overeager here, but really only the missing
gimple type verification saves us (I guess I didn't add that just because
of similar issues).


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|major                       |normal
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |ice-on-invalid-code
      Known to fail|                            |4.4.2 4.5.0
      Known to work|                            |4.3.4
   Last reconfirmed|0000-00-00 00:00:00         |2010-01-09 11:25:00
               date|                            |
            Summary|internal compiler error: in |[4.4/4.5 Regression]
                   |insert_into_preds_of_block, |internal compiler error: in
                   |at tree-ssa-pre.c:3146      |insert_into_preds_of_block,
                   |                            |at tree-ssa-pre.c:3146
   Target Milestone|---                         |4.4.3


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


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

* [Bug middle-end/42667] [4.4/4.5 Regression] internal compiler error: in insert_into_preds_of_block, at tree-ssa-pre.c:3146
  2010-01-09  6:05 [Bug c/42667] New: internal compiler error: in insert_into_preds_of_block, at tree-ssa-pre.c:3146 jerstlouis at gmail dot com
  2010-01-09  6:08 ` [Bug c/42667] " jerstlouis at gmail dot com
  2010-01-09 11:25 ` [Bug c/42667] [4.4/4.5 Regression] " rguenth at gcc dot gnu dot org
@ 2010-01-09 12:07 ` rguenth at gcc dot gnu dot org
  2010-01-10 19:38 ` rguenth at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-01-09 12:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from rguenth at gcc dot gnu dot org  2010-01-09 12:07 -------
Actually it might be subtly different.  Yep, it's a bug in folding.

Mine.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |rguenth at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
          Component|c                           |middle-end
   Last reconfirmed|2010-01-09 11:25:00         |2010-01-09 12:07:24
               date|                            |


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


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

* [Bug middle-end/42667] [4.4/4.5 Regression] internal compiler error: in insert_into_preds_of_block, at tree-ssa-pre.c:3146
  2010-01-09  6:05 [Bug c/42667] New: internal compiler error: in insert_into_preds_of_block, at tree-ssa-pre.c:3146 jerstlouis at gmail dot com
                   ` (2 preceding siblings ...)
  2010-01-09 12:07 ` [Bug middle-end/42667] " rguenth at gcc dot gnu dot org
@ 2010-01-10 19:38 ` rguenth at gcc dot gnu dot org
  2010-01-10 19:39 ` [Bug middle-end/42667] [4.4 " rguenth at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-01-10 19:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from rguenth at gcc dot gnu dot org  2010-01-10 19:37 -------
Subject: Bug 42667

Author: rguenth
Date: Sun Jan 10 19:37:45 2010
New Revision: 155791

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155791
Log:
2010-01-10  Richard Guenther  <rguenther@suse.de>

        PR middle-end/42667
        * builtins.c (fold_builtin_strlen): Add type argument and
        convert the resulting length to it.
        (fold_builtin_1): Adjust.

        * gcc.dg/torture/pr42667.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.dg/torture/pr42667.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/builtins.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug middle-end/42667] [4.4 Regression] internal compiler error: in insert_into_preds_of_block, at tree-ssa-pre.c:3146
  2010-01-09  6:05 [Bug c/42667] New: internal compiler error: in insert_into_preds_of_block, at tree-ssa-pre.c:3146 jerstlouis at gmail dot com
                   ` (3 preceding siblings ...)
  2010-01-10 19:38 ` rguenth at gcc dot gnu dot org
@ 2010-01-10 19:39 ` rguenth at gcc dot gnu dot org
  2010-01-13 18:25 ` jakub at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-01-10 19:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from rguenth at gcc dot gnu dot org  2010-01-10 19:39 -------
Fixed for 4.5 sofar.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|rguenth at gcc dot gnu dot  |unassigned at gcc dot gnu
                   |org                         |dot org
             Status|ASSIGNED                    |NEW
      Known to fail|4.4.2 4.5.0                 |4.4.2
      Known to work|4.3.4                       |4.3.4 4.5.0
            Summary|[4.4/4.5 Regression]        |[4.4 Regression] internal
                   |internal compiler error: in |compiler error: in
                   |insert_into_preds_of_block, |insert_into_preds_of_block,
                   |at tree-ssa-pre.c:3146      |at tree-ssa-pre.c:3146


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


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

* [Bug middle-end/42667] [4.4 Regression] internal compiler error: in insert_into_preds_of_block, at tree-ssa-pre.c:3146
  2010-01-09  6:05 [Bug c/42667] New: internal compiler error: in insert_into_preds_of_block, at tree-ssa-pre.c:3146 jerstlouis at gmail dot com
                   ` (4 preceding siblings ...)
  2010-01-10 19:39 ` [Bug middle-end/42667] [4.4 " rguenth at gcc dot gnu dot org
@ 2010-01-13 18:25 ` jakub at gcc dot gnu dot org
  2010-01-14  9:46 ` jakub at gcc dot gnu dot org
  2010-01-14 12:09 ` jakub at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-01-13 18:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jakub at gcc dot gnu dot org  2010-01-13 18:25 -------
Created an attachment (id=19579)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19579&action=view)
gcc44-pr42667.patch

This backport works for me on 4.4 branch, going to bootstrap/regtest it now.


-- 


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


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

* [Bug middle-end/42667] [4.4 Regression] internal compiler error: in insert_into_preds_of_block, at tree-ssa-pre.c:3146
  2010-01-09  6:05 [Bug c/42667] New: internal compiler error: in insert_into_preds_of_block, at tree-ssa-pre.c:3146 jerstlouis at gmail dot com
                   ` (5 preceding siblings ...)
  2010-01-13 18:25 ` jakub at gcc dot gnu dot org
@ 2010-01-14  9:46 ` jakub at gcc dot gnu dot org
  2010-01-14 12:09 ` jakub at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-01-14  9:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from jakub at gcc dot gnu dot org  2010-01-14 09:46 -------
Subject: Bug 42667

Author: jakub
Date: Thu Jan 14 09:46:04 2010
New Revision: 155886

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155886
Log:
        Backport from mainline
        2010-01-10  Richard Guenther  <rguenther@suse.de>

        PR middle-end/42667
        * builtins.c (fold_builtin_strlen): Add type argument and
        convert the resulting length to it.
        (fold_builtin_1): Adjust.

        * gcc.dg/torture/pr42667.c: New testcase.

Added:
    branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/torture/pr42667.c
Modified:
    branches/gcc-4_4-branch/gcc/ChangeLog
    branches/gcc-4_4-branch/gcc/builtins.c
    branches/gcc-4_4-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug middle-end/42667] [4.4 Regression] internal compiler error: in insert_into_preds_of_block, at tree-ssa-pre.c:3146
  2010-01-09  6:05 [Bug c/42667] New: internal compiler error: in insert_into_preds_of_block, at tree-ssa-pre.c:3146 jerstlouis at gmail dot com
                   ` (6 preceding siblings ...)
  2010-01-14  9:46 ` jakub at gcc dot gnu dot org
@ 2010-01-14 12:09 ` jakub at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-01-14 12:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from jakub at gcc dot gnu dot org  2010-01-14 12:09 -------
Fixed.


-- 

jakub at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2010-01-14 12:09 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-09  6:05 [Bug c/42667] New: internal compiler error: in insert_into_preds_of_block, at tree-ssa-pre.c:3146 jerstlouis at gmail dot com
2010-01-09  6:08 ` [Bug c/42667] " jerstlouis at gmail dot com
2010-01-09 11:25 ` [Bug c/42667] [4.4/4.5 Regression] " rguenth at gcc dot gnu dot org
2010-01-09 12:07 ` [Bug middle-end/42667] " rguenth at gcc dot gnu dot org
2010-01-10 19:38 ` rguenth at gcc dot gnu dot org
2010-01-10 19:39 ` [Bug middle-end/42667] [4.4 " rguenth at gcc dot gnu dot org
2010-01-13 18:25 ` jakub at gcc dot gnu dot org
2010-01-14  9:46 ` jakub at gcc dot gnu dot org
2010-01-14 12:09 ` 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).