public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/63804] New: ice in find_oldest_value_reg with -g -O2
@ 2014-11-10 10:13 dcb314 at hotmail dot com
  2014-11-10 11:22 ` [Bug rtl-optimization/63804] [5 Regression] " mpolacek at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: dcb314 at hotmail dot com @ 2014-11-10 10:13 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63804

            Bug ID: 63804
           Summary: ice in find_oldest_value_reg with -g -O2
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com

Created attachment 33930
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33930&action=edit
gzipped C source code

I just tried to compile the attached code
on gcc trunk dated 20141109 on an AMD x86_64 box.

The compiler said

$ ../results/bin/gcc -c -g -O2 bug169.c
brw_eu_emit.c: In function ‘brw_oword_block_write_scratch’:
brw_eu_emit.c:2071:1: internal compiler error: Segmentation fault
0xa82d3c crash_signal(int)
    ../../src/trunk/gcc/toplev.c:358
0x9c07fe find_oldest_value_reg(reg_class, rtx_def*, value_data*)
    ../../src/trunk/gcc/regcprop.c:459
0x9c0ab1 replace_oldest_value_reg(rtx_def**, reg_class, rtx_insn*, value_data*)
    ../../src/trunk/gcc/regcprop.c:492
0x9bfbcc replace_oldest_value_addr(rtx_def**, reg_class, machine_mode, unsigned
char, rtx_insn*, value_data*)
    ../../src/trunk/gcc/regcprop.c:652
0x9be2a8 copyprop_hardreg_forward_1(basic_block_def*, value_data*)
    ../../src/trunk/gcc/regcprop.c:761
0x9be19a copyprop_hardreg_forward_bb_without_debug_insn(basic_block_def*)
    ../../src/trunk/gcc/regcprop.c:1145
0xa47dbb prepare_shrink_wrap(basic_block_def*)
    ../../src/trunk/gcc/shrink-wrap.c:439
0xa48f60 try_shrink_wrapping(edge_def**, edge_def*, bitmap_head*, rtx_insn*)
    ../../src/trunk/gcc/shrink-wrap.c:573
0x7f6709 thread_prologue_and_epilogue_insns()
    ../../src/trunk/gcc/function.c:5937
0x7f6709 rest_of_handle_thread_prologue_and_epilogue()
    ../../src/trunk/gcc/function.c:6476
0x7f6709 (anonymous
namespace)::pass_thread_prologue_and_epilogue::execute(function*)
    ../../src/trunk/gcc/function.c:6514
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.

Flags -g -O2 required.
>From gcc-bugs-return-466212-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Nov 10 10:20:02 2014
Return-Path: <gcc-bugs-return-466212-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 26129 invoked by alias); 10 Nov 2014 10:20:02 -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 26084 invoked by uid 48); 10 Nov 2014 10:19:59 -0000
From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/63804] [5 Regression] ice in find_oldest_value_reg with -g -O2
Date: Mon, 10 Nov 2014 10:20:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: rtl-optimization
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: mpolacek at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 5.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cf_known_to_work cf_reconfirmed_on component cc everconfirmed short_desc target_milestone cf_known_to_fail
Message-ID: <bug-63804-4-Jw0Mduwxfv@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-63804-4@http.gcc.gnu.org/bugzilla/>
References: <bug-63804-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: 2014-11/txt/msg00684.txt.bz2
Content-length: 990

https://gcc.gnu.org/bugzilla/show_bug.cgi?idc804

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
      Known to work|                            |4.9.2
   Last reconfirmed|                            |2014-11-10
          Component|c                           |rtl-optimization
                 CC|                            |mpolacek at gcc dot gnu.org
     Ever confirmed|0                           |1
            Summary|ice in                      |[5 Regression] ice in
                   |find_oldest_value_reg with  |find_oldest_value_reg with
                   |-g -O2                      |-g -O2
   Target Milestone|---                         |5.0
      Known to fail|                            |5.0

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed.


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

* [Bug rtl-optimization/63804] [5 Regression] ice in find_oldest_value_reg with -g -O2
  2014-11-10 10:13 [Bug c/63804] New: ice in find_oldest_value_reg with -g -O2 dcb314 at hotmail dot com
@ 2014-11-10 11:22 ` mpolacek at gcc dot gnu.org
  2014-11-10 11:49 ` trippels at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-11-10 11:22 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63804

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vmakarov at gcc dot gnu.org

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Started with r217265.


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

* [Bug rtl-optimization/63804] [5 Regression] ice in find_oldest_value_reg with -g -O2
  2014-11-10 10:13 [Bug c/63804] New: ice in find_oldest_value_reg with -g -O2 dcb314 at hotmail dot com
  2014-11-10 11:22 ` [Bug rtl-optimization/63804] [5 Regression] " mpolacek at gcc dot gnu.org
@ 2014-11-10 11:49 ` trippels at gcc dot gnu.org
  2014-11-10 13:08 ` trippels at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: trippels at gcc dot gnu.org @ 2014-11-10 11:49 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63804

Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |trippels at gcc dot gnu.org

--- Comment #3 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
Somewhat reduced:

markus@x4 tmp % cat bug169.c
struct brw_context
{
  int gen;
} e;
enum brw_reg_type
{
  B
};
struct brw_reg
{
  enum brw_reg_type type : 1;
  int nr : 1;
  struct
  {
    unsigned ud;
  } dw1;
} fn1 ();
struct brw_reg a, c;
long b, d;
int
fn2 (struct brw_reg p2, unsigned p3)
{
  struct brw_reg f, g, h, l = g = p2, m, n = m;
  struct brw_context i = e;
  unsigned j;
  int k;
  if (i.gen)
    p3 = 0;
  p2 = g;
  if (b)
    j = k = 0;
  else
    j = k = 2;
  fn3 ();
  l.type = 0;
  c = a;
  fn4 (p2, 0);
  m = fn1 (0, 0, 0, 0, 0, 0);
  n.dw1.ud = p3;
  f = n;
  h = f;
  d = fn5 (p2.nr);
  fn4 (0, 0, f);
  if (i.gen)
    fn6 (p2, j, k);
}


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

* [Bug rtl-optimization/63804] [5 Regression] ice in find_oldest_value_reg with -g -O2
  2014-11-10 10:13 [Bug c/63804] New: ice in find_oldest_value_reg with -g -O2 dcb314 at hotmail dot com
  2014-11-10 11:22 ` [Bug rtl-optimization/63804] [5 Regression] " mpolacek at gcc dot gnu.org
  2014-11-10 11:49 ` trippels at gcc dot gnu.org
@ 2014-11-10 13:08 ` trippels at gcc dot gnu.org
  2014-11-10 13:11 ` trippels at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: trippels at gcc dot gnu.org @ 2014-11-10 13:08 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63804

--- Comment #4 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
trippels@gcc2-power8 status % cat freelist_test.ii
template <typename _Tp> struct A
{ 
  _Tp _M_i;
  void
  load ()
  { 
    _Tp a;
    __atomic_load (&_M_i, &a, 0);
  }
};
class B
{ 
  int *ptr;
  int tag;
};
class C
{
public:
  template <typename Allocator> C (Allocator, int);
  template <bool, int>
  void
  construct ()
  { 
    pool_.load ();
  }
  A<B> pool_;
};
class D
{ 
  int *px;
  int pn;
};
class F
{
public:
  F (int);
};
class G
{
public:
  G (int) : p_predicate_value (0) {}
  class readonly_property61 : F
  {
  public:
    readonly_property61 (int) : F (0) {}
  } p_predicate_value;
  D m_message;
};
void report_assertion (G);
template <typename, int threadsafe, int bounded>
void
run_test ()
{ 
  C b (0, 0);
  b.construct<threadsafe, bounded> ();
  report_assertion (0);
}
template <bool bounded>
void
run_tests ()
{ 
  run_test<C, 0, bounded> ();
}
void
freelist_teststest_method ()
{ 
  run_tests<false> ();
}


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

* [Bug rtl-optimization/63804] [5 Regression] ice in find_oldest_value_reg with -g -O2
  2014-11-10 10:13 [Bug c/63804] New: ice in find_oldest_value_reg with -g -O2 dcb314 at hotmail dot com
                   ` (2 preceding siblings ...)
  2014-11-10 13:08 ` trippels at gcc dot gnu.org
@ 2014-11-10 13:11 ` trippels at gcc dot gnu.org
  2014-11-20 11:54 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: trippels at gcc dot gnu.org @ 2014-11-10 13:11 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63804

--- Comment #5 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
Please ignore comment 4.

Testcase without implicit functions:

markus@x4 tmp % cat bug169.c
struct brw_context
{
  int gen;
} e;
int a, d;
long b;
enum brw_reg_type
{
  BRW_REGISTER_TYPE_Q
};
struct brw_reg
{
  enum brw_reg_type type : 1;
  int nr : 1;
  struct
  {
    unsigned ud;
  } dw1;
};
enum brw_reg_type c;
void
fn1 (int p1)
{
  b = p1 & a;
}

int fn2 ();
void fn3 ();
void
fn4 (struct brw_reg p1, unsigned p2, int p3)
{
  struct brw_reg f, g, h, j = p1, l, m = l;
  struct brw_context i = e;
  if (i.gen)
    p2 = 0;
  j.type = c;
  g = j;
  p1 = g;
  fn3 ();
  int k = p2, v = p1.nr, p = v;
  m.dw1.ud = k;
  f = m;
  h = f;
  struct brw_reg n = h;
  fn3 (n);
  {
    d = fn2 ();
    int o = d;
    fn1 (o);
  }
  if (i.gen)
    fn3 (p1);
  b = p & a;
  fn3 (p3);
}


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

* [Bug rtl-optimization/63804] [5 Regression] ice in find_oldest_value_reg with -g -O2
  2014-11-10 10:13 [Bug c/63804] New: ice in find_oldest_value_reg with -g -O2 dcb314 at hotmail dot com
                   ` (3 preceding siblings ...)
  2014-11-10 13:11 ` trippels at gcc dot gnu.org
@ 2014-11-20 11:54 ` jakub at gcc dot gnu.org
  2014-11-20 12:51 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-11-20 11:54 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63804

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
This no longer reproduces after r217588.  Vlad, do you think that is the real
fix for that or just made the bug latent?


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

* [Bug rtl-optimization/63804] [5 Regression] ice in find_oldest_value_reg with -g -O2
  2014-11-10 10:13 [Bug c/63804] New: ice in find_oldest_value_reg with -g -O2 dcb314 at hotmail dot com
                   ` (4 preceding siblings ...)
  2014-11-20 11:54 ` jakub at gcc dot gnu.org
@ 2014-11-20 12:51 ` rguenth at gcc dot gnu.org
  2014-12-15 18:41 ` jakub at gcc dot gnu.org
  2014-12-15 19:07 ` jakub at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-11-20 12:51 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63804

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING


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

* [Bug rtl-optimization/63804] [5 Regression] ice in find_oldest_value_reg with -g -O2
  2014-11-10 10:13 [Bug c/63804] New: ice in find_oldest_value_reg with -g -O2 dcb314 at hotmail dot com
                   ` (5 preceding siblings ...)
  2014-11-20 12:51 ` rguenth at gcc dot gnu.org
@ 2014-12-15 18:41 ` jakub at gcc dot gnu.org
  2014-12-15 19:07 ` jakub at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-12-15 18:41 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63804

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Mon Dec 15 18:40:35 2014
New Revision: 218758

URL: https://gcc.gnu.org/viewcvs?rev=218758&root=gcc&view=rev
Log:
    PR rtl-optimization/63804
    * gcc.dg/pr63804.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/pr63804.c
Modified:
    trunk/gcc/testsuite/ChangeLog


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

* [Bug rtl-optimization/63804] [5 Regression] ice in find_oldest_value_reg with -g -O2
  2014-11-10 10:13 [Bug c/63804] New: ice in find_oldest_value_reg with -g -O2 dcb314 at hotmail dot com
                   ` (6 preceding siblings ...)
  2014-12-15 18:41 ` jakub at gcc dot gnu.org
@ 2014-12-15 19:07 ` jakub at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-12-15 19:07 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63804

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Assuming fixed.  Vlad, if you think this should be kept open, please reopen it.


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

end of thread, other threads:[~2014-12-15 19:07 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-10 10:13 [Bug c/63804] New: ice in find_oldest_value_reg with -g -O2 dcb314 at hotmail dot com
2014-11-10 11:22 ` [Bug rtl-optimization/63804] [5 Regression] " mpolacek at gcc dot gnu.org
2014-11-10 11:49 ` trippels at gcc dot gnu.org
2014-11-10 13:08 ` trippels at gcc dot gnu.org
2014-11-10 13:11 ` trippels at gcc dot gnu.org
2014-11-20 11:54 ` jakub at gcc dot gnu.org
2014-11-20 12:51 ` rguenth at gcc dot gnu.org
2014-12-15 18:41 ` jakub at gcc dot gnu.org
2014-12-15 19:07 ` jakub at gcc dot gnu.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).