public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "su at cs dot ucdavis.edu" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/58247] New: ICE in tree_unroll_loops_completely at -O3 (both 32-bit and 64-bit modes)
Date: Tue, 27 Aug 2013 04:56:00 -0000	[thread overview]
Message-ID: <bug-58247-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 58247
           Summary: ICE in tree_unroll_loops_completely at -O3 (both
                    32-bit and 64-bit modes)
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: su at cs dot ucdavis.edu

The following code causes an ICE when compiled with the current gcc trunk at
-O3 on x86_64-linux in both 32-bit and 64-bit modes. This is a regression from
4.8.x.

It is likely a duplicate of 57592, although the stack traces are somewhat
different.


$ gcc-trunk -v
gcc version 4.9.0 20130826 (experimental) [trunk revision 201986] (GCC) 
$ gcc-trunk -O2 -c reduced.c
$ gcc-4.8 -O3 -c reduced.c
$ gcc-trunk -O3 -c reduced.c
reduced.c: In function ‘foo’:
reduced.c:14:6: internal compiler error: Segmentation fault
 void foo ()
      ^
0x7e6a0f crash_signal
    ../../gcc-trunk/gcc/toplev.c:335
0x80f55b ssa_default_def(function*, tree_node*)
    ../../gcc-trunk/gcc/tree-dfa.c:314
0x80f820 get_or_create_ssa_default_def(function*, tree_node*)
    ../../gcc-trunk/gcc/tree-dfa.c:362
0x82924a get_reaching_def
    ../../gcc-trunk/gcc/tree-into-ssa.c:1184
0x82f1fa maybe_replace_use
    ../../gcc-trunk/gcc/tree-into-ssa.c:1784
0x82f1fa rewrite_update_stmt
    ../../gcc-trunk/gcc/tree-into-ssa.c:1967
0x82f1fa rewrite_update_enter_block
    ../../gcc-trunk/gcc/tree-into-ssa.c:2136
0xb4d77a walk_dominator_tree(dom_walk_data*, basic_block_def*)
    ../../gcc-trunk/gcc/domwalk.c:210
0x827f13 rewrite_blocks
    ../../gcc-trunk/gcc/tree-into-ssa.c:2216
0x82e4ae update_ssa(unsigned int)
    ../../gcc-trunk/gcc/tree-into-ssa.c:3319
0x8963fc rewrite_into_loop_closed_ssa(bitmap_head_def*, unsigned int)
    ../../gcc-trunk/gcc/tree-ssa-loop-manip.c:501
0xbb23fa tree_unroll_loops_completely(bool, bool)
    ../../gcc-trunk/gcc/tree-ssa-loop-ivcanon.c:1205
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
$ 


----------------------------------------------

int a, b, c;
unsigned int d;

void baz(); 

void bar ()
{
  int e;
  for (d = 1; d < 2; d = d - 1)
    for (e = 24; e; e = e - 3)
      a &= b >= e;
}

void foo ()
{
  for (;; b++)
    for (c = 0; c < 1; c++)
      {
    bar ();
    baz ();
      }
}
>From gcc-bugs-return-428422-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Aug 27 06:23:19 2013
Return-Path: <gcc-bugs-return-428422-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 4719 invoked by alias); 27 Aug 2013 06:23:19 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 4686 invoked by uid 48); 27 Aug 2013 06:23:15 -0000
From: "su at cs dot ucdavis.edu" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/58248] New: wrong code at -O3 on x86_64-linux-gnu
Date: Tue, 27 Aug 2013 06:23:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: su at cs dot ucdavis.edu
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter
Message-ID: <bug-58248-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-08/txt/msg01346.txt.bz2
Content-length: 1216

http://gcc.gnu.org/bugzilla/show_bug.cgi?idX248

            Bug ID: 58248
           Summary: wrong code at -O3 on x86_64-linux-gnu
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: su at cs dot ucdavis.edu

The current gcc trunk produces wrong code for the following testcase on
x86_64-linux when compiled at -O3 in both 32-bit and 64-bit modes.

This is a regression from 4.8.x.


$ gcc-trunk -v
gcc version 4.9.0 20130826 (experimental) [trunk revision 201986] (GCC)
$ gcc-trunk -O2 reduced.c
$ a.out
1
$ gcc-4.8 -O3 reduced.c
$ a.out
1
$ gcc-trunk -O3 reduced.c
$ a.out
0
$


----------------------------------------------


int printf (const char *, ...);

struct S
{
  int u;
};

int a = 1, b, c = 1, e, *f, *g;

static struct S d = {6};

void foo (int *p)
{
  c &= a != *p;
}

int main ()
{
  struct S h = d;
  int **i = &f;
  *i = g = &b;
  for (; h.u; h.u--)
    {
      for (e = 0; e < 2; e++)
        {
      foo (*i);
      *g = 0 > **i;
        }
      *f = 0;
    }
  printf ("%d\n", c);
  return 0;
}


             reply	other threads:[~2013-08-27  4:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-27  4:56 su at cs dot ucdavis.edu [this message]
2013-08-27  7:24 ` [Bug tree-optimization/58247] [4.9 Regression] " jakub at gcc dot gnu.org
2013-08-30  7:56 ` rguenth at gcc dot gnu.org

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-58247-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).