public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/55718] New: [4.8 Regression] ICE in gen_reg_rtx, at emit-rtl.c:866
@ 2012-12-17  9:45 rguenth at gcc dot gnu.org
  2012-12-17  9:46 ` [Bug middle-end/55718] " rguenth at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-12-17  9:45 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 55718
           Summary: [4.8 Regression] ICE in gen_reg_rtx, at emit-rtl.c:866
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: rguenth@gcc.gnu.org
            Target: s390x-*-*


Created attachment 28981
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28981
preprocessed source

/usr/lib64/gcc/s390x-suse-linux/4.8/cc1 -fpreprocessed ansi.i -quiet -dumpbase
ansi.c -march=z10 -mtune=z196 -m64 -mzarch -auxbase-strip ../obj_s/ansi.o -g
-O2 -Wall -version -fmessage-length=0 -fstack-protector -funwind-tables
-fasynchronous-unwind-tables -fPIC --param max-inline-insns-single=1200 -o
ansi.s
GNU C (SUSE Linux) version 4.8.0 20121214 [trunk revision 194496]
(s390x-suse-linux)
        compiled by GNU C version 4.8.0 20121214 [trunk revision 194496], GMP
version 5.0.5, MPFR version 3.1.1, MPC version 1.0
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU C (SUSE Linux) version 4.8.0 20121214 [trunk revision 194496]
(s390x-suse-linux)
        compiled by GNU C version 4.8.0 20121214 [trunk revision 194496], GMP
version 5.0.5, MPFR version 3.1.1, MPC version 1.0
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 5b6417fa43f8bdfcc36ee141d0370571
../tack/ansi.c: In function 'terminal_state':
../tack/ansi.c:566:1: internal compiler error: in gen_reg_rtx, at
emit-rtl.c:866
 }
 ^
libbacktrace could not find executable to open
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugs.opensuse.org/> for instructions.


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

* [Bug middle-end/55718] [4.8 Regression] ICE in gen_reg_rtx, at emit-rtl.c:866
  2012-12-17  9:45 [Bug middle-end/55718] New: [4.8 Regression] ICE in gen_reg_rtx, at emit-rtl.c:866 rguenth at gcc dot gnu.org
@ 2012-12-17  9:46 ` rguenth at gcc dot gnu.org
  2012-12-17 10:31 ` [Bug target/55718] " rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-12-17  9:46 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.8.0


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

* [Bug target/55718] [4.8 Regression] ICE in gen_reg_rtx, at emit-rtl.c:866
  2012-12-17  9:45 [Bug middle-end/55718] New: [4.8 Regression] ICE in gen_reg_rtx, at emit-rtl.c:866 rguenth at gcc dot gnu.org
  2012-12-17  9:46 ` [Bug middle-end/55718] " rguenth at gcc dot gnu.org
@ 2012-12-17 10:31 ` rguenth at gcc dot gnu.org
  2012-12-17 10:40 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-12-17 10:31 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ra
          Component|middle-end                  |target

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> 2012-12-17 10:31:03 UTC ---
Looks like a target issue:

> ./cc1 -quiet -O2 ansi.i -I include -fPIC -march=z10
../tack/ansi.c: In function 'terminal_state':
../tack/ansi.c:566:1: internal compiler error: in gen_reg_rtx, at
emit-rtl.c:866
0x77a668 gen_reg_rtx(machine_mode)
        /space/rguenther/src/svn/trunk/gcc/emit-rtl.c:866
0x9aaa63 maybe_legitimize_operand
        /space/rguenther/src/svn/trunk/gcc/optabs.c:8057
0x9aadc9 maybe_legitimize_operands(insn_code, unsigned int, unsigned int,
expand_operand*)
        /space/rguenther/src/svn/trunk/gcc/optabs.c:8130
0x9aae5d maybe_gen_insn(insn_code, unsigned int, expand_operand*)
        /space/rguenther/src/svn/trunk/gcc/optabs.c:8148
0x99a58f expand_binop_directly
        /space/rguenther/src/svn/trunk/gcc/optabs.c:1452
0x99a7f6 expand_binop(machine_mode, optab_tag, rtx_def*, rtx_def*, rtx_def*,
int, optab_methods)
        /space/rguenther/src/svn/trunk/gcc/optabs.c:1521
0x999f65 expand_simple_binop(machine_mode, rtx_code, rtx_def*, rtx_def*,
rtx_def*, int, optab_methods)
        /space/rguenther/src/svn/trunk/gcc/optabs.c:1269
0x7b8478 force_operand(rtx_def*, rtx_def*)
        /space/rguenther/src/svn/trunk/gcc/expr.c:7042
0xd4471f legitimize_pic_address(rtx_def*, rtx_def*)
        /space/rguenther/src/svn/trunk/gcc/config/s390/s390.c:3669
0xd458f8 emit_symbolic_move(rtx_def**)
        /space/rguenther/src/svn/trunk/gcc/config/s390/s390.c:3925
0xd855ce gen_movdi(rtx_def*, rtx_def*)
        /space/rguenther/src/svn/trunk/gcc/config/s390/s390.md:1339
0x7abfaf emit_move_insn_1(rtx_def*, rtx_def*)
        /space/rguenther/src/svn/trunk/gcc/expr.c:3417
0x9a2e06 gen_move_insn(rtx_def*, rtx_def*)
        /space/rguenther/src/svn/trunk/gcc/optabs.c:4785
0xa28c8a gen_reload
        /space/rguenther/src/svn/trunk/gcc/reload1.c:8707
0xa254b5 emit_input_reload_insns
        /space/rguenther/src/svn/trunk/gcc/reload1.c:7593

reducing.


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

* [Bug target/55718] [4.8 Regression] ICE in gen_reg_rtx, at emit-rtl.c:866
  2012-12-17  9:45 [Bug middle-end/55718] New: [4.8 Regression] ICE in gen_reg_rtx, at emit-rtl.c:866 rguenth at gcc dot gnu.org
  2012-12-17  9:46 ` [Bug middle-end/55718] " rguenth at gcc dot gnu.org
  2012-12-17 10:31 ` [Bug target/55718] " rguenth at gcc dot gnu.org
@ 2012-12-17 10:40 ` rguenth at gcc dot gnu.org
  2012-12-18 11:30 ` krebbel at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-12-17 10:40 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> 2012-12-17 10:40:30 UTC ---
Reduced testcase:

extern char temp[];
short ansi_value[256];
void terminal_state(void)
{
  static const char *puc[] = { "", "<", "=", ">", "?", 0};
  int i, j, k, l, modes_found;
  char buf[256];
  k = (int) __builtin_strlen(temp);
  for (j = l = 0; j < 255 && j - l < 50; j++)
    {
      __builtin_sprintf(temp, "\033[%s%d$p", puc[i], j);
      if (ansi_value[1])
        {
          l = j;
          buf[k] = '\0';
          put_crlf();
          ptextln(buf);
          buf[k++] = ' ';
          k = (int) __builtin_strlen(temp);
        }
    }
  for (i = j = 0; j < modes_found; j = ++i >> 1)
    ;
}

(gdb) bt
#0  fancy_abort (
    file=0x1170a20 "/space/rguenther/src/svn/trunk/gcc/emit-rtl.c", line=866, 
    function=0x1171ab9 <gen_reg_rtx(machine_mode)::__FUNCTION__> "gen_reg_rtx")
    at /space/rguenther/src/svn/trunk/gcc/diagnostic.c:1146
#1  0x000000000077a669 in gen_reg_rtx (mode=DImode)
    at /space/rguenther/src/svn/trunk/gcc/emit-rtl.c:866
#2  0x00000000009aaa64 in maybe_legitimize_operand (icode=CODE_FOR_adddi3, 
    opno=0, op=0x7fffffffd040)
    at /space/rguenther/src/svn/trunk/gcc/optabs.c:8057
#3  0x00000000009aadca in maybe_legitimize_operands (icode=CODE_FOR_adddi3, 
    opno=0, nops=3, ops=0x7fffffffd040)
    at /space/rguenther/src/svn/trunk/gcc/optabs.c:8130
#4  0x00000000009aae5e in maybe_gen_insn (icode=CODE_FOR_adddi3, nops=3, 
    ops=0x7fffffffd040) at /space/rguenther/src/svn/trunk/gcc/optabs.c:8148
#5  0x000000000099a590 in expand_binop_directly (mode=DImode, 
    binoptab=add_optab, op0=0x7ffff6e1f5a0, op1=0x7ffff6d074b0, target=0x0, 
    unsignedp=1, methods=OPTAB_LIB_WIDEN, last=0x0)
    at /space/rguenther/src/svn/trunk/gcc/optabs.c:1452
#6  0x000000000099a7f7 in expand_binop (mode=DImode, binoptab=add_optab, 
    op0=0x7ffff6e1f5a0, op1=0x7ffff6d074b0, target=0x0, unsignedp=1, 
    methods=OPTAB_LIB_WIDEN)
    at /space/rguenther/src/svn/trunk/gcc/optabs.c:1521
#7  0x0000000000999f66 in expand_simple_binop (mode=DImode, code=PLUS, 
    op0=0x7ffff6e1f5a0, op1=0x7ffff6d074b0, target=0x0, unsignedp=1, 
    methods=OPTAB_LIB_WIDEN)
    at /space/rguenther/src/svn/trunk/gcc/optabs.c:1269
#8  0x00000000007b8479 in force_operand (value=0x7ffff6e1f600, target=0x0)
    at /space/rguenther/src/svn/trunk/gcc/expr.c:7042
#9  0x0000000000d44720 in legitimize_pic_address (orig=0x7ffff6e19a70, 
    reg=0x7ffff6e20220)
    at /space/rguenther/src/svn/trunk/gcc/config/s390/s390.c:3669
#10 0x0000000000d458f9 in emit_symbolic_move (operands=0x7fffffffd4f0)
    at /space/rguenther/src/svn/trunk/gcc/config/s390/s390.c:3925
#11 0x0000000000d855cf in gen_movdi (operand0=0x7ffff6e20220, 
    operand1=0x7ffff6e19a70)
    at /space/rguenther/src/svn/trunk/gcc/config/s390/s390.md:1339
#12 0x00000000007abfb0 in emit_move_insn_1 (x=0x7ffff6e20220, y=0x7ffff6e19a70)
    at /space/rguenther/src/svn/trunk/gcc/expr.c:3417
#13 0x00000000009a2e07 in gen_move_insn (x=0x7ffff6e20220, y=0x7ffff6e19a70)
    at /space/rguenther/src/svn/trunk/gcc/optabs.c:4785
#14 0x0000000000a28c8b in gen_reload (out=0x7ffff6e20220, in=0x7ffff6e19a70, 
    opnum=2, type=RELOAD_FOR_OPERAND_ADDRESS)
    at /space/rguenther/src/svn/trunk/gcc/reload1.c:8707


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

* [Bug target/55718] [4.8 Regression] ICE in gen_reg_rtx, at emit-rtl.c:866
  2012-12-17  9:45 [Bug middle-end/55718] New: [4.8 Regression] ICE in gen_reg_rtx, at emit-rtl.c:866 rguenth at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2012-12-17 10:40 ` rguenth at gcc dot gnu.org
@ 2012-12-18 11:30 ` krebbel at gcc dot gnu.org
  2013-01-07 15:36 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: krebbel at gcc dot gnu.org @ 2012-12-18 11:30 UTC (permalink / raw)
  To: gcc-bugs


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

Andreas Krebbel <krebbel at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2012-12-18
         AssignedTo|unassigned at gcc dot       |krebbel at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1

--- Comment #3 from Andreas Krebbel <krebbel at gcc dot gnu.org> 2012-12-18 11:30:06 UTC ---
Created attachment 28993
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28993
Experimental fix

Starting with http://gcc.gnu.org/ml/gcc-patches/2012-09/msg00088.html UNSPEC
GOTENTs are accepted as legitimate address what leads to this error.

For the strlen implementation we subtract the result from the source pointer.
In the testcase the subtraction is done in a mode smaller than pointer size
(SImode). The source pointer is the address of a global symbol in the GOT.
Resolving the subreg on the address reload generates:

(const:DI (plus:DI (unspec:DI [
                     (symbol_ref:DI ("temp") [flags 0x440]  <var_decl
0x200060095f0 temp>)
                               ] UNSPEC_GOTENT)
                              (const_int 4 [0x4])))

Instead of just letting it pass legitmize_pic_address tries to generate code
for the add what needs an additional register.  The attached patch fixes this.


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

* [Bug target/55718] [4.8 Regression] ICE in gen_reg_rtx, at emit-rtl.c:866
  2012-12-17  9:45 [Bug middle-end/55718] New: [4.8 Regression] ICE in gen_reg_rtx, at emit-rtl.c:866 rguenth at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2012-12-18 11:30 ` krebbel at gcc dot gnu.org
@ 2013-01-07 15:36 ` rguenth at gcc dot gnu.org
  2013-01-10  8:16 ` krebbel at gcc dot gnu.org
  2013-01-10  8:22 ` krebbel at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-01-07 15:36 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1


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

* [Bug target/55718] [4.8 Regression] ICE in gen_reg_rtx, at emit-rtl.c:866
  2012-12-17  9:45 [Bug middle-end/55718] New: [4.8 Regression] ICE in gen_reg_rtx, at emit-rtl.c:866 rguenth at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2013-01-07 15:36 ` rguenth at gcc dot gnu.org
@ 2013-01-10  8:16 ` krebbel at gcc dot gnu.org
  2013-01-10  8:22 ` krebbel at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: krebbel at gcc dot gnu.org @ 2013-01-10  8:16 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #4 from Andreas Krebbel <krebbel at gcc dot gnu.org> 2013-01-10 08:15:23 UTC ---
Author: krebbel
Date: Thu Jan 10 08:15:07 2013
New Revision: 195078

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=195078
Log:
2013-01-10  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

    PR target/55718
    * config/s390/s390.c (s390_symref_operand_p)
    (s390_loadrelative_operand_p): Merge the two functions.
    (s390_check_qrst_address, print_operand_address): Add parameters
    to s390_loadrelative_operand_p invokation.
    (s390_check_symref_alignment): Use s390_loadrelative_operand_p.
    (s390_reload_larl_operand, s390_secondary_reload): Use
    s390_loadrelative_operand_p instead of s390_symref_operand_p.
    (legitimize_pic_address): Handle @GOTENT and @PLT + addend.


Added:
    trunk/gcc/testsuite/gcc.target/s390/pr55718.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/s390/s390.c


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

* [Bug target/55718] [4.8 Regression] ICE in gen_reg_rtx, at emit-rtl.c:866
  2012-12-17  9:45 [Bug middle-end/55718] New: [4.8 Regression] ICE in gen_reg_rtx, at emit-rtl.c:866 rguenth at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2013-01-10  8:16 ` krebbel at gcc dot gnu.org
@ 2013-01-10  8:22 ` krebbel at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: krebbel at gcc dot gnu.org @ 2013-01-10  8:22 UTC (permalink / raw)
  To: gcc-bugs


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

Andreas Krebbel <krebbel at gcc dot gnu.org> changed:

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

--- Comment #5 from Andreas Krebbel <krebbel at gcc dot gnu.org> 2013-01-10 08:21:30 UTC ---
Fixed per commit above.


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

end of thread, other threads:[~2013-01-10  8:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-17  9:45 [Bug middle-end/55718] New: [4.8 Regression] ICE in gen_reg_rtx, at emit-rtl.c:866 rguenth at gcc dot gnu.org
2012-12-17  9:46 ` [Bug middle-end/55718] " rguenth at gcc dot gnu.org
2012-12-17 10:31 ` [Bug target/55718] " rguenth at gcc dot gnu.org
2012-12-17 10:40 ` rguenth at gcc dot gnu.org
2012-12-18 11:30 ` krebbel at gcc dot gnu.org
2013-01-07 15:36 ` rguenth at gcc dot gnu.org
2013-01-10  8:16 ` krebbel at gcc dot gnu.org
2013-01-10  8:22 ` krebbel 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).