public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "regehr at cs dot utah.edu" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/47141] New: segfault
Date: Sat, 01 Jan 2011 01:47:00 -0000	[thread overview]
Message-ID: <bug-47141-4@http.gcc.gnu.org/bugzilla/> (raw)

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

           Summary: segfault
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: regehr@cs.utah.edu
                CC: chenyang@cs.utah.edu


Searching on "Segmentation fault" in the bugzilla returns hundreds of matches
so I can't really verify this is new, sorry!  But at least it's a small
testcase :).  

Valgrind talks about a read past the bound of a malloc'd block and also about a
null ptr dereference -- hard to tell what is the real problem.

[regehr@gamow tmp435]$ current-gcc -c small.c -O2

small.c: In function 'func_115':
small.c:30:1: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

[regehr@gamow tmp435]$ current-gcc -v

Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/uusoc/exports/scratch/regehr/z/compiler-install/gcc-r168380-install/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/compiler-install/gcc-r168380-install
--program-prefix=r168380- --enable-languages=c,c++
Thread model: posix
gcc version 4.6.0 20101231 (experimental) (GCC) 

[regehr@gamow tmp435]$ cat small.c

typedef signed char int8_t;
typedef int int32_t;
typedef unsigned int uint32_t;
static uint32_t
safe_add_func_uint32_t_u_u (uint32_t ui1, uint32_t ui2)
{
  return ui1 + ui2;
};

int8_t *const
func_112 (int32_t * p_113, int8_t p_114)
{
  func_115 (func_115, 0);
  return 0;
}

int32_t
func_115 (uint32_t p_116, uint32_t p_117, int8_t * p_118)
{
  int32_t l_141;
  int32_t *l_186 = &l_141;
  if (l_141)
    {
    }
  else
    for (l_141 = 0; l_141; l_141 = safe_add_func_uint32_t_u_u (l_141, 1))
      {
      }
  return *l_186;
}


             reply	other threads:[~2011-01-01  1:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-01  1:47 regehr at cs dot utah.edu [this message]
2011-01-01 13:36 ` [Bug tree-optimization/47141] [4.6 Regression] segfault jakub at gcc dot gnu.org
2011-01-01 17:09 ` hjl.tools at gmail dot com
2011-01-03 21:43 ` rguenth at gcc dot gnu.org
2011-01-06 23:38 ` law at redhat dot com
2011-01-07 16:17 ` law at redhat dot com
2011-01-07 19:48 ` law at redhat dot com
2011-01-10 13:59 ` law at redhat dot com
2011-01-10 17:00 ` law at gcc dot gnu.org
2011-01-10 17:01 ` law at redhat dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-47141-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).