public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/60131] New: RTL check fail in rhs_regno
@ 2014-02-10  9:48 dcb314 at hotmail dot com
  2014-02-10  9:52 ` [Bug rtl-optimization/60131] [4.9 Regression] " rguenth at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: dcb314 at hotmail dot com @ 2014-02-10  9:48 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60131
           Summary: RTL check fail in rhs_regno
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com

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

I just compiled the attached code with gcc trunk dated 20140209 on a x86_64
box with flag -O2 and it said

/home/dcb/clang/llvm/lib/Target/R600/SIInstrInfo.cpp: In member function ‘const
llvm::TargetRegister
Class* llvm::SIInstrInfo::getOpRegClass(const llvm::MachineInstr&, unsigned
int) const’:
/home/dcb/clang/llvm/lib/Target/R600/SIInstrInfo.cpp:467:1: internal compiler
error: RTL check: expe
cted code 'reg', have 'sign_extend' in rhs_regno, at rtl.h:1125
 }
 ^
0xd530c7 rtl_check_failed_code1(rtx_def const*, rtx_code, char const*, int,
char const*)
    ../../src/trunk/gcc/rtl.c:773
0x6145f2 rhs_regno
    ../../src/trunk/gcc/rtl.h:1125
0x167748b rhs_regno
    ../../src/trunk/gcc/ree.c:388
0x167748b combine_reaching_defs
    ../../src/trunk/gcc/ree.c:703
0x16781e2 find_and_remove_re
    ../../src/trunk/gcc/ree.c:997
0x16781e2 rest_of_handle_ree
    ../../src/trunk/gcc/ree.c:1068
0x16781e2 execute
    ../../src/trunk/gcc/ree.c:1107
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.

The gcc trunk has been bootstrapped with --enable-check=rtl switched on.
>From gcc-bugs-return-443184-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Feb 10 09:48:17 2014
Return-Path: <gcc-bugs-return-443184-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 10529 invoked by alias); 10 Feb 2014 09:48:17 -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 10481 invoked by uid 48); 10 Feb 2014 09:48:14 -0000
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/60115] [4.8/4.9 Regression] wrong code at -O3 on x86_64-linux-gnu
Date: Mon, 10 Feb 2014 09:48:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: rguenth at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Priority: P1
X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.8.3
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: priority cf_known_to_work target_milestone short_desc cf_known_to_fail
Message-ID: <bug-60115-4-Ye1imxpbqV@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-60115-4@http.gcc.gnu.org/bugzilla/>
References: <bug-60115-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-02/txt/msg00941.txt.bz2
Content-length: 668

http://gcc.gnu.org/bugzilla/show_bug.cgi?id`115

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1
      Known to work|                            |4.8.2
   Target Milestone|4.9.0                       |4.8.3
            Summary|[4.9 Regression] wrong code |[4.8/4.9 Regression] wrong
                   |at -O3 on x86_64-linux-gnu  |code at -O3 on
                   |                            |x86_64-linux-gnu
      Known to fail|                            |4.8.3, 4.9.0


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

* [Bug rtl-optimization/60131] [4.9 Regression] RTL check fail in rhs_regno
  2014-02-10  9:48 [Bug c++/60131] New: RTL check fail in rhs_regno dcb314 at hotmail dot com
@ 2014-02-10  9:52 ` rguenth at gcc dot gnu.org
  2014-02-10 14:54 ` law at redhat dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-02-10  9:52 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |law at gcc dot gnu.org
   Target Milestone|---                         |4.9.0
            Summary|RTL check fail in rhs_regno |[4.9 Regression] RTL check
                   |                            |fail in rhs_regno

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
ree -> Jeff.


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

* [Bug rtl-optimization/60131] [4.9 Regression] RTL check fail in rhs_regno
  2014-02-10  9:48 [Bug c++/60131] New: RTL check fail in rhs_regno dcb314 at hotmail dot com
  2014-02-10  9:52 ` [Bug rtl-optimization/60131] [4.9 Regression] " rguenth at gcc dot gnu.org
@ 2014-02-10 14:54 ` law at redhat dot com
  2014-02-10 15:45 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: law at redhat dot com @ 2014-02-10 14:54 UTC (permalink / raw)
  To: gcc-bugs

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

Jeffrey A. Law <law at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |law at redhat dot com
           Assignee|unassigned at gcc dot gnu.org      |law at redhat dot com

--- Comment #2 from Jeffrey A. Law <law at redhat dot com> ---
Mine.  Fix ought to be trivial.


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

* [Bug rtl-optimization/60131] [4.9 Regression] RTL check fail in rhs_regno
  2014-02-10  9:48 [Bug c++/60131] New: RTL check fail in rhs_regno dcb314 at hotmail dot com
  2014-02-10  9:52 ` [Bug rtl-optimization/60131] [4.9 Regression] " rguenth at gcc dot gnu.org
  2014-02-10 14:54 ` law at redhat dot com
@ 2014-02-10 15:45 ` jakub at gcc dot gnu.org
  2014-02-10 19:03 ` law at redhat dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-02-10 15:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Reduced testcase for -O2:

struct A { short a; };
int **b;
unsigned long c;

bool foo ();
unsigned bar (unsigned i);
extern void baz () __attribute__((noreturn));

int *
test (unsigned x, struct A *y)
{
  unsigned v;
  if (foo () || y[x].a == -1)
    {
      c = bar (x);
      return 0;
    }
  v = y[x].a;
  if (v >= 23)
    baz ();
  return b[v];
}


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

* [Bug rtl-optimization/60131] [4.9 Regression] RTL check fail in rhs_regno
  2014-02-10  9:48 [Bug c++/60131] New: RTL check fail in rhs_regno dcb314 at hotmail dot com
                   ` (2 preceding siblings ...)
  2014-02-10 15:45 ` jakub at gcc dot gnu.org
@ 2014-02-10 19:03 ` law at redhat dot com
  2014-02-14 20:27 ` law at gcc dot gnu.org
  2014-02-14 20:31 ` law at redhat dot com
  5 siblings, 0 replies; 7+ messages in thread
From: law at redhat dot com @ 2014-02-10 19:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jeffrey A. Law <law at redhat dot com> ---
The problem here is we first have the following candidate and defining insn:

gdb) p debug_rtx (cand->insn)
(insn 24 23 25 6 (set (reg:DI 0 ax [orig:100 D.2269 ] [100])
        (zero_extend:DI (reg/v:SI 0 ax [orig:91 v ] [91]))) j.c:22 133
{*zero_extendsidi2}
     (nil))
$13 = void
(gdb) p debug_rtx (curr_insn)
(insn 33 32 35 7 (set (reg/v:SI 0 ax [orig:91 v ] [91])
        (sign_extend:SI (reg:HI 0 ax [orig:88 D.2271 ] [88]))) j.c:19 146
{extendhisi2}
     (nil))

We eliminate insn 24 by changing insn 33 into:

(insn 33 32 35 7 (set (reg:DI 0 ax)
        (zero_extend:DI (sign_extend:SI (reg:HI 0 ax [orig:88 D.2271 ] [88]))))
j.c:19 -1
     (nil))


Later we call combine_reaching_defs to see if we can eliminate insn 33.  It now
has an unexpected form and we trigger the checking fault.


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

* [Bug rtl-optimization/60131] [4.9 Regression] RTL check fail in rhs_regno
  2014-02-10  9:48 [Bug c++/60131] New: RTL check fail in rhs_regno dcb314 at hotmail dot com
                   ` (3 preceding siblings ...)
  2014-02-10 19:03 ` law at redhat dot com
@ 2014-02-14 20:27 ` law at gcc dot gnu.org
  2014-02-14 20:31 ` law at redhat dot com
  5 siblings, 0 replies; 7+ messages in thread
From: law at gcc dot gnu.org @ 2014-02-14 20:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jeffrey A. Law <law at gcc dot gnu.org> ---
Author: law
Date: Fri Feb 14 20:26:31 2014
New Revision: 207792

URL: http://gcc.gnu.org/viewcvs?rev=207792&root=gcc&view=rev
Log:
    PR rtl-optimization/60131
    * ree.c (get_extended_src_reg): New function.
    (combine_reaching_defs): Use it rather than assuming location
    of REG.
    (find_and_remove_re): Verify first operand of extension is
    a REG before adding the insns to the copy list.

    PR rtl-optimization/60131
    * g++.dg/torture/pr60131.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/torture/pr60131.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/ree.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug rtl-optimization/60131] [4.9 Regression] RTL check fail in rhs_regno
  2014-02-10  9:48 [Bug c++/60131] New: RTL check fail in rhs_regno dcb314 at hotmail dot com
                   ` (4 preceding siblings ...)
  2014-02-14 20:27 ` law at gcc dot gnu.org
@ 2014-02-14 20:31 ` law at redhat dot com
  5 siblings, 0 replies; 7+ messages in thread
From: law at redhat dot com @ 2014-02-14 20:31 UTC (permalink / raw)
  To: gcc-bugs

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

Jeffrey A. Law <law at redhat dot com> changed:

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

--- Comment #6 from Jeffrey A. Law <law at redhat dot com> ---
Fixed by latest trunk commit.


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

end of thread, other threads:[~2014-02-14 20:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-10  9:48 [Bug c++/60131] New: RTL check fail in rhs_regno dcb314 at hotmail dot com
2014-02-10  9:52 ` [Bug rtl-optimization/60131] [4.9 Regression] " rguenth at gcc dot gnu.org
2014-02-10 14:54 ` law at redhat dot com
2014-02-10 15:45 ` jakub at gcc dot gnu.org
2014-02-10 19:03 ` law at redhat dot com
2014-02-14 20:27 ` law at gcc dot gnu.org
2014-02-14 20:31 ` law at redhat dot com

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