public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/18746] New: segfault with cc1 compiled with checking disabled
@ 2004-12-01  0:52 kazu at cs dot umass dot edu
  2004-12-01  0:55 ` [Bug tree-optimization/18746] " dnovillo at redhat dot com
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: kazu at cs dot umass dot edu @ 2004-12-01  0:52 UTC (permalink / raw)
  To: gcc-bugs

Build cc1 with checking disabled.
Then compile the following with ./cc1 -quiet -O2.

extern void abort (void) __attribute__ ((noreturn));
extern char *strcpy (char *__restrict __dest, __const char *__restrict __src);

int
foo (int aaa, int bbb)
{
  static char buf[30];
  const char *p;

  switch (aaa)
    {
    case 10:
      p = "hello";
      break;

    case 20:
      p = "world";
      break;

    default:
      abort ();
    }

  if (bbb)
    {
      strcpy (buf, "banana");
      return 1;
    }
  strcpy (buf, p);

  return 0;
}

I get "internal compiler error: Segmentation fault".

The testcase was reduced from i386.c.

-- 
           Summary: segfault with cc1 compiled with checking disabled
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kazu at cs dot umass dot edu
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: i686-pc-linux-gnu


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


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

* [Bug tree-optimization/18746] segfault with cc1 compiled with checking disabled
  2004-12-01  0:52 [Bug tree-optimization/18746] New: segfault with cc1 compiled with checking disabled kazu at cs dot umass dot edu
@ 2004-12-01  0:55 ` dnovillo at redhat dot com
  2004-12-01  0:55 ` [Bug tree-optimization/18746] New: " Diego Novillo
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: dnovillo at redhat dot com @ 2004-12-01  0:55 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dnovillo at redhat dot com  2004-12-01 00:55 -------
Subject: Re:  New: segfault with cc1 compiled
	with checking disabled

On Wed, 2004-12-01 at 00:51 +0000, kazu at cs dot umass dot edu wrote:

> I get "internal compiler error: Segmentation fault".
> 
> The testcase was reduced from i386.c.
> 
Hmm, does this happen after fold-all-builtins?


Diego.



-- 


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


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

* Re: [Bug tree-optimization/18746] New: segfault with cc1 compiled with checking disabled
  2004-12-01  0:52 [Bug tree-optimization/18746] New: segfault with cc1 compiled with checking disabled kazu at cs dot umass dot edu
  2004-12-01  0:55 ` [Bug tree-optimization/18746] " dnovillo at redhat dot com
@ 2004-12-01  0:55 ` Diego Novillo
  2004-12-01  1:00 ` [Bug tree-optimization/18746] [4.0 Regression] " pinskia at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Diego Novillo @ 2004-12-01  0:55 UTC (permalink / raw)
  To: gcc-bugzilla; +Cc: gcc-bugs

On Wed, 2004-12-01 at 00:51 +0000, kazu at cs dot umass dot edu wrote:

> I get "internal compiler error: Segmentation fault".
> 
> The testcase was reduced from i386.c.
> 
Hmm, does this happen after fold-all-builtins?


Diego.


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

* [Bug tree-optimization/18746] [4.0 Regression] segfault with cc1 compiled with checking disabled
  2004-12-01  0:52 [Bug tree-optimization/18746] New: segfault with cc1 compiled with checking disabled kazu at cs dot umass dot edu
  2004-12-01  0:55 ` [Bug tree-optimization/18746] " dnovillo at redhat dot com
  2004-12-01  0:55 ` [Bug tree-optimization/18746] New: " Diego Novillo
@ 2004-12-01  1:00 ` pinskia at gcc dot gnu dot org
  2004-12-01  1:04 ` kazu at cs dot umass dot edu
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-01  1:00 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-12-01 01:00 -------
Yes and I hear that it might be caused by my addition of a may_alias pass.
I will look into it unless Diego beats me fully.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org
           Keywords|                            |ice-on-valid-code
            Summary|segfault with cc1 compiled  |[4.0 Regression] segfault
                   |with checking disabled      |with cc1 compiled with
                   |                            |checking disabled
            Version|unknown                     |4.0.0


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


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

* [Bug tree-optimization/18746] [4.0 Regression] segfault with cc1 compiled with checking disabled
  2004-12-01  0:52 [Bug tree-optimization/18746] New: segfault with cc1 compiled with checking disabled kazu at cs dot umass dot edu
                   ` (2 preceding siblings ...)
  2004-12-01  1:00 ` [Bug tree-optimization/18746] [4.0 Regression] " pinskia at gcc dot gnu dot org
@ 2004-12-01  1:04 ` kazu at cs dot umass dot edu
  2004-12-01  1:33 ` pinskia at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: kazu at cs dot umass dot edu @ 2004-12-01  1:04 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From kazu at cs dot umass dot edu  2004-12-01 01:04 -------
Reduced a little more:

extern char *strcpy (char *__restrict __dest, __const char *__restrict __src);

void
foo (int a)
{
  static char buf[30];
  const char *p;

  if (a)
    p = "hello";
  else
    p = "world";

  strcpy (buf, p);
  strcpy (buf, p);
}


-- 


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


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

* [Bug tree-optimization/18746] [4.0 Regression] segfault with cc1 compiled with checking disabled
  2004-12-01  0:52 [Bug tree-optimization/18746] New: segfault with cc1 compiled with checking disabled kazu at cs dot umass dot edu
                   ` (3 preceding siblings ...)
  2004-12-01  1:04 ` kazu at cs dot umass dot edu
@ 2004-12-01  1:33 ` pinskia at gcc dot gnu dot org
  2004-12-01  2:12 ` kazu at cs dot umass dot edu
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-01  1:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-12-01 01:33 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-12-01 01:33:27
               date|                            |
   Target Milestone|---                         |4.0.0


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


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

* [Bug tree-optimization/18746] [4.0 Regression] segfault with cc1 compiled with checking disabled
  2004-12-01  0:52 [Bug tree-optimization/18746] New: segfault with cc1 compiled with checking disabled kazu at cs dot umass dot edu
                   ` (4 preceding siblings ...)
  2004-12-01  1:33 ` pinskia at gcc dot gnu dot org
@ 2004-12-01  2:12 ` kazu at cs dot umass dot edu
  2004-12-01  2:13 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: kazu at cs dot umass dot edu @ 2004-12-01  2:12 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From kazu at cs dot umass dot edu  2004-12-01 02:12 -------
With --enable-checking=release,

I get

pr18746.c:5: internal compiler error: in var_ann, at tree-flow-inline.h:34.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.0.0                       |---


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


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

* [Bug tree-optimization/18746] [4.0 Regression] segfault with cc1 compiled with checking disabled
  2004-12-01  0:52 [Bug tree-optimization/18746] New: segfault with cc1 compiled with checking disabled kazu at cs dot umass dot edu
                   ` (5 preceding siblings ...)
  2004-12-01  2:12 ` kazu at cs dot umass dot edu
@ 2004-12-01  2:13 ` pinskia at gcc dot gnu dot org
  2004-12-01  2:22 ` pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-01  2:13 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-12-01 02:13 -------
This does not make sense.  This looks like a latent bug.

With checking enabled we have the following for the statement:
#   bufD.1116_5 = V_MAY_DEF <bufD.1116_4>;
__builtin_memcpy (&bufD.1116, pD.1117_1, 6);

but with checking disabled we get:
#   bufD.1116_4 = V_MAY_DEF <bufD.1116_3>;
#   TMT.0D.1125 = V_MAY_DEF <TMT.0D.1125>;
__builtin_memcpy (&bufD.1116, pD.1117_1, 6);

Note the extra TMT.0D.1125.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.0.0


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


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

* [Bug tree-optimization/18746] [4.0 Regression] segfault with cc1 compiled with checking disabled
  2004-12-01  0:52 [Bug tree-optimization/18746] New: segfault with cc1 compiled with checking disabled kazu at cs dot umass dot edu
                   ` (6 preceding siblings ...)
  2004-12-01  2:13 ` pinskia at gcc dot gnu dot org
@ 2004-12-01  2:22 ` pinskia at gcc dot gnu dot org
  2004-12-01  2:31 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-01  2:22 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-12-01 02:22 -------
Adding a #define ENABLE_CHECKING on the top of tree-flow.h, makes this works so we know for sure 
that it is a ENABLE_CHECKING problem.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dnovillo at gcc dot gnu dot
                   |                            |org


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


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

* [Bug tree-optimization/18746] [4.0 Regression] segfault with cc1 compiled with checking disabled
  2004-12-01  0:52 [Bug tree-optimization/18746] New: segfault with cc1 compiled with checking disabled kazu at cs dot umass dot edu
                   ` (7 preceding siblings ...)
  2004-12-01  2:22 ` pinskia at gcc dot gnu dot org
@ 2004-12-01  2:31 ` pinskia at gcc dot gnu dot org
  2004-12-01  2:33 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-01  2:31 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-12-01 02:31 -------
defining ENABLE_CHECKING in tree-optimize.c makes this work.

-- 


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


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

* [Bug tree-optimization/18746] [4.0 Regression] segfault with cc1 compiled with checking disabled
  2004-12-01  0:52 [Bug tree-optimization/18746] New: segfault with cc1 compiled with checking disabled kazu at cs dot umass dot edu
                   ` (8 preceding siblings ...)
  2004-12-01  2:31 ` pinskia at gcc dot gnu dot org
@ 2004-12-01  2:33 ` pinskia at gcc dot gnu dot org
  2004-12-01  2:46 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-01  2:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-12-01 02:33 -------
having verify_ssa run even without checking turned on, makes this run.

-- 


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


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

* [Bug tree-optimization/18746] [4.0 Regression] segfault with cc1 compiled with checking disabled
  2004-12-01  0:52 [Bug tree-optimization/18746] New: segfault with cc1 compiled with checking disabled kazu at cs dot umass dot edu
                   ` (9 preceding siblings ...)
  2004-12-01  2:33 ` pinskia at gcc dot gnu dot org
@ 2004-12-01  2:46 ` pinskia at gcc dot gnu dot org
  2004-12-01  3:01 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-01  2:46 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-12-01 02:46 -------
The problem is really in fab.

Question is how should modify_stmt work because that is what is causing the problem.
This patch fix the problem:
Index: tree-ssa-ccp.c
===============================================================
====
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-ccp.c,v
retrieving revision 2.53
diff -u -p -r2.53 tree-ssa-ccp.c
--- tree-ssa-ccp.c	29 Nov 2004 01:15:39 -0000	2.53
+++ tree-ssa-ccp.c	1 Dec 2004 02:45:17 -0000
@@ -2196,7 +2180,7 @@ execute_fold_all_builtins (void)
 	      if (result && !set_rhs (stmtp, result))
 		abort ();
 	    }
-	  modify_stmt (*stmtp);
+	  mark_new_vars_to_rename (*stmtp, vars_to_rename);
 	  if (maybe_clean_eh_stmt (*stmtp)
 	      && tree_purge_dead_eh_edges (bb))
 	    cfg_changed = true;


-- 


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


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

* [Bug tree-optimization/18746] [4.0 Regression] segfault with cc1 compiled with checking disabled
  2004-12-01  0:52 [Bug tree-optimization/18746] New: segfault with cc1 compiled with checking disabled kazu at cs dot umass dot edu
                   ` (10 preceding siblings ...)
  2004-12-01  2:46 ` pinskia at gcc dot gnu dot org
@ 2004-12-01  3:01 ` pinskia at gcc dot gnu dot org
  2004-12-01 23:53 ` cvs-commit at gcc dot gnu dot org
  2004-12-01 23:54 ` pinskia at gcc dot gnu dot org
  13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-01  3:01 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-12-01 03:01 -------
Patch here: <http://gcc.gnu.org/ml/gcc-patches/2004-12/msg00004.html>.

Mine.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |pinskia at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
           Keywords|                            |build, patch


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


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

* [Bug tree-optimization/18746] [4.0 Regression] segfault with cc1 compiled with checking disabled
  2004-12-01  0:52 [Bug tree-optimization/18746] New: segfault with cc1 compiled with checking disabled kazu at cs dot umass dot edu
                   ` (11 preceding siblings ...)
  2004-12-01  3:01 ` pinskia at gcc dot gnu dot org
@ 2004-12-01 23:53 ` cvs-commit at gcc dot gnu dot org
  2004-12-01 23:54 ` pinskia at gcc dot gnu dot org
  13 siblings, 0 replies; 15+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-12-01 23:53 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-12-01 23:53 -------
Subject: Bug 18746

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	pinskia@gcc.gnu.org	2004-12-01 23:53:17

Modified files:
	gcc            : ChangeLog tree-ssa-alias.c 

Log message:
	2004-12-01  Andrew Pinski  <pinskia@physics.uc.edu>
	
	PR tree-opt/18763
	PR tree-opt/18746
	* tree-ssa-alias.c (init_alias_info): Get statement operands for all
	the statements if aliases_computed_p is true.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.6666&r2=2.6667
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-ssa-alias.c.diff?cvsroot=gcc&r1=2.60&r2=2.61



-- 


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


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

* [Bug tree-optimization/18746] [4.0 Regression] segfault with cc1 compiled with checking disabled
  2004-12-01  0:52 [Bug tree-optimization/18746] New: segfault with cc1 compiled with checking disabled kazu at cs dot umass dot edu
                   ` (12 preceding siblings ...)
  2004-12-01 23:53 ` cvs-commit at gcc dot gnu dot org
@ 2004-12-01 23:54 ` pinskia at gcc dot gnu dot org
  13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-01 23:54 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-12-01 23:53 -------
Fixed.

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


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


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

end of thread, other threads:[~2004-12-01 23:54 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-01  0:52 [Bug tree-optimization/18746] New: segfault with cc1 compiled with checking disabled kazu at cs dot umass dot edu
2004-12-01  0:55 ` [Bug tree-optimization/18746] " dnovillo at redhat dot com
2004-12-01  0:55 ` [Bug tree-optimization/18746] New: " Diego Novillo
2004-12-01  1:00 ` [Bug tree-optimization/18746] [4.0 Regression] " pinskia at gcc dot gnu dot org
2004-12-01  1:04 ` kazu at cs dot umass dot edu
2004-12-01  1:33 ` pinskia at gcc dot gnu dot org
2004-12-01  2:12 ` kazu at cs dot umass dot edu
2004-12-01  2:13 ` pinskia at gcc dot gnu dot org
2004-12-01  2:22 ` pinskia at gcc dot gnu dot org
2004-12-01  2:31 ` pinskia at gcc dot gnu dot org
2004-12-01  2:33 ` pinskia at gcc dot gnu dot org
2004-12-01  2:46 ` pinskia at gcc dot gnu dot org
2004-12-01  3:01 ` pinskia at gcc dot gnu dot org
2004-12-01 23:53 ` cvs-commit at gcc dot gnu dot org
2004-12-01 23:54 ` 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).