public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/48549] New: [4.6/4.7 Regression] Combiner ICE with -g
@ 2011-04-11  6:33 jakub at gcc dot gnu.org
  2011-04-11 10:01 ` [Bug rtl-optimization/48549] " rguenth at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-04-11  6:33 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: [4.6/4.7 Regression] Combiner ICE with -g
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: jakub@gcc.gnu.org
        ReportedBy: jakub@gcc.gnu.org


void
foo (void *from, void *to)
{
  long offset = reinterpret_cast <long>(to) - reinterpret_cast <long>(from);
  if (offset != static_cast <int>(offset))
    *(int *) 0xC0DE = 0;
  reinterpret_cast <int *>(from)[1] = offset;
}
struct A
{
  A () : a () {}
  A (void *x) : a (x) {}
  void *bar () { return a; }
  void *a;
};
struct C;
struct D;
struct E : public A
{
  C m1 (int);
  D m2 ();
  E () {}
  E (A x) : A (x) {}
};
struct C : public E
{
  C () {}
  C (void *x) : E (x) {}
};
struct D : public E
{
  D (void *x) : E (x) {}
};
C
E::m1 (int x)
{
  return (reinterpret_cast <char *>(bar ()) + x);
}
D
E::m2 ()
{
  return reinterpret_cast <char *>(bar ());
}
struct B
{
  E a;
  unsigned b : 16;
  unsigned c : 1;
};
void
baz (B *x)
{
  for (unsigned i = 0; i < 64; i++)
    {
      D d = x[i].a.m2 ();
      C c = x[i].a.m1 (x[i].c);
      foo (d.bar (), c.bar ());
    }
}

ICEs with -g -O2 on x86_64-linux, starting with 172109/172110.


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

* [Bug rtl-optimization/48549] [4.6/4.7 Regression] Combiner ICE with -g
  2011-04-11  6:33 [Bug rtl-optimization/48549] New: [4.6/4.7 Regression] Combiner ICE with -g jakub at gcc dot gnu.org
@ 2011-04-11 10:01 ` rguenth at gcc dot gnu.org
  2011-04-11 10:28 ` ebotcazou at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-04-11 10:01 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.6.1


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

* [Bug rtl-optimization/48549] [4.6/4.7 Regression] Combiner ICE with -g
  2011-04-11  6:33 [Bug rtl-optimization/48549] New: [4.6/4.7 Regression] Combiner ICE with -g jakub at gcc dot gnu.org
  2011-04-11 10:01 ` [Bug rtl-optimization/48549] " rguenth at gcc dot gnu.org
@ 2011-04-11 10:28 ` ebotcazou at gcc dot gnu.org
  2011-04-11 17:25 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2011-04-11 10:28 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011.04.11 10:28:32
                 CC|                            |ebotcazou at gcc dot
                   |                            |gnu.org
            Version|4.6.0                       |4.6.1
     Ever Confirmed|0                           |1

--- Comment #1 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2011-04-11 10:28:32 UTC ---
Confirmed.


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

* [Bug rtl-optimization/48549] [4.6/4.7 Regression] Combiner ICE with -g
  2011-04-11  6:33 [Bug rtl-optimization/48549] New: [4.6/4.7 Regression] Combiner ICE with -g jakub at gcc dot gnu.org
  2011-04-11 10:01 ` [Bug rtl-optimization/48549] " rguenth at gcc dot gnu.org
  2011-04-11 10:28 ` ebotcazou at gcc dot gnu.org
@ 2011-04-11 17:25 ` jakub at gcc dot gnu.org
  2011-04-12  6:29 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-04-11 17:25 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-04-11 17:25:40 UTC ---
http://gcc.gnu.org/ml/gcc-patches/2011-04/msg00738.html


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

* [Bug rtl-optimization/48549] [4.6/4.7 Regression] Combiner ICE with -g
  2011-04-11  6:33 [Bug rtl-optimization/48549] New: [4.6/4.7 Regression] Combiner ICE with -g jakub at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2011-04-11 17:25 ` jakub at gcc dot gnu.org
@ 2011-04-12  6:29 ` jakub at gcc dot gnu.org
  2011-04-12 10:54 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-04-12  6:29 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ojab at ojab dot ru

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-04-12 06:28:44 UTC ---
*** Bug 48567 has been marked as a duplicate of this bug. ***


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

* [Bug rtl-optimization/48549] [4.6/4.7 Regression] Combiner ICE with -g
  2011-04-11  6:33 [Bug rtl-optimization/48549] New: [4.6/4.7 Regression] Combiner ICE with -g jakub at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2011-04-12  6:29 ` jakub at gcc dot gnu.org
@ 2011-04-12 10:54 ` jakub at gcc dot gnu.org
  2011-04-12 13:44 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-04-12 10:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-04-12 10:53:50 UTC ---
Author: jakub
Date: Tue Apr 12 10:53:47 2011
New Revision: 172311

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=172311
Log:
    PR rtl-optimization/48549
    * combine.c (propagate_for_debug): Also stop after BB_END of
    this_basic_block.  Process LAST and just stop processing after it.
    (combine_instructions): If last_combined_insn has been deleted,
    set last_combined_insn to its PREV_INSN.

    * g++.dg/opt/pr48549.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/opt/pr48549.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/combine.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug rtl-optimization/48549] [4.6/4.7 Regression] Combiner ICE with -g
  2011-04-11  6:33 [Bug rtl-optimization/48549] New: [4.6/4.7 Regression] Combiner ICE with -g jakub at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2011-04-12 10:54 ` jakub at gcc dot gnu.org
@ 2011-04-12 13:44 ` jakub at gcc dot gnu.org
  2011-04-12 13:45 ` jakub at gcc dot gnu.org
  2012-11-30 13:54 ` steven at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-04-12 13:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-04-12 13:44:35 UTC ---
Author: jakub
Date: Tue Apr 12 13:44:33 2011
New Revision: 172319

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=172319
Log:
    PR rtl-optimization/48549
    * combine.c (propagate_for_debug): Also stop after BB_END of
    this_basic_block.  Process LAST and just stop processing after it.
    (combine_instructions): If last_combined_insn has been deleted,
    set last_combined_insn to its PREV_INSN.

    * g++.dg/opt/pr48549.C: New test.

Added:
    branches/gcc-4_6-branch/gcc/testsuite/g++.dg/opt/pr48549.C
Modified:
    branches/gcc-4_6-branch/gcc/ChangeLog
    branches/gcc-4_6-branch/gcc/combine.c
    branches/gcc-4_6-branch/gcc/testsuite/ChangeLog


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

* [Bug rtl-optimization/48549] [4.6/4.7 Regression] Combiner ICE with -g
  2011-04-11  6:33 [Bug rtl-optimization/48549] New: [4.6/4.7 Regression] Combiner ICE with -g jakub at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2011-04-12 13:44 ` jakub at gcc dot gnu.org
@ 2011-04-12 13:45 ` jakub at gcc dot gnu.org
  2012-11-30 13:54 ` steven at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-04-12 13:45 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-04-12 13:45:23 UTC ---
Fixed.


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

* [Bug rtl-optimization/48549] [4.6/4.7 Regression] Combiner ICE with -g
  2011-04-11  6:33 [Bug rtl-optimization/48549] New: [4.6/4.7 Regression] Combiner ICE with -g jakub at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2011-04-12 13:45 ` jakub at gcc dot gnu.org
@ 2012-11-30 13:54 ` steven at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: steven at gcc dot gnu.org @ 2012-11-30 13:54 UTC (permalink / raw)
  To: gcc-bugs


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

Steven Bosscher <steven at gcc dot gnu.org> changed:

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

--- Comment #7 from Steven Bosscher <steven at gcc dot gnu.org> 2012-11-30 13:54:10 UTC ---
A patch to get rid of BARRIERs runs into this one. Here's an alternative fix:

Index: combine.c
===================================================================
--- combine.c   (revision 193989)
+++ combine.c   (working copy)
@@ -1223,11 +1223,10 @@ combine_instructions (rtx f, unsigned int nregs)
          if (NONDEBUG_INSN_P (insn))
            {
              while (last_combined_insn
-                    && INSN_DELETED_P (last_combined_insn))
+                    && INSN_DELETED_P (last_combined_insn)
+                    && last_combined_insn != BB_HEAD (this_basic_block))
                last_combined_insn = PREV_INSN (last_combined_insn);
              if (last_combined_insn == NULL_RTX
-                 || BARRIER_P (last_combined_insn)
-                 || BLOCK_FOR_INSN (last_combined_insn) != this_basic_block
                  || DF_INSN_LUID (last_combined_insn) <= DF_INSN_LUID (insn))
                last_combined_insn = insn;


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

end of thread, other threads:[~2012-11-30 13:54 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-11  6:33 [Bug rtl-optimization/48549] New: [4.6/4.7 Regression] Combiner ICE with -g jakub at gcc dot gnu.org
2011-04-11 10:01 ` [Bug rtl-optimization/48549] " rguenth at gcc dot gnu.org
2011-04-11 10:28 ` ebotcazou at gcc dot gnu.org
2011-04-11 17:25 ` jakub at gcc dot gnu.org
2011-04-12  6:29 ` jakub at gcc dot gnu.org
2011-04-12 10:54 ` jakub at gcc dot gnu.org
2011-04-12 13:44 ` jakub at gcc dot gnu.org
2011-04-12 13:45 ` jakub at gcc dot gnu.org
2012-11-30 13:54 ` steven 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).