public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/55719] New: [4.8 Regression] ICE: Segmentation fault
@ 2012-12-17 10:04 rguenth at gcc dot gnu.org
  2012-12-17 10:05 ` [Bug c/55719] " rguenth at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-12-17 10:04 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 55719
           Summary: [4.8 Regression] ICE: Segmentation fault
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: rguenth@gcc.gnu.org
            Target: s390x-*-*


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

/usr/lib64/gcc/s390x-suse-linux/4.8/cc1 -fpreprocessed ma_control_file.i -quiet
-dumpbase ma_control_file.c -march=z10 -mtune=z196 -m64 -mzarch -auxbase-strip
CMakeFiles/aria_embedded.dir/ma_control_file.c.o -g -O2 -O3 -Wall
-Wno-unused-but-set-variable -Wno-unused-parameter -w -version
-fmessage-length=0 -fstack-protector -funwind-tables
-fasynchronous-unwind-tables -fno-strict-aliasing -fPIC -o ma_control_file.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
/home/abuild/rpmbuild/BUILD/mariadb-5.5.28/storage/maria/ma_control_file.c: In
function 'ma_control_file_open':
/home/abuild/rpmbuild/BUILD/mariadb-5.5.28/storage/maria/ma_control_file.c:452:1:
internal compiler error: Segmentation fault
 }
 ^
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] 12+ messages in thread

* [Bug c/55719] [4.8 Regression] ICE: Segmentation fault
  2012-12-17 10:04 [Bug c/55719] New: [4.8 Regression] ICE: Segmentation fault rguenth at gcc dot gnu.org
@ 2012-12-17 10:05 ` rguenth at gcc dot gnu.org
  2012-12-17 10:11 ` [Bug rtl-optimization/55719] " rguenth at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-12-17 10:05 UTC (permalink / raw)
  To: gcc-bugs


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

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

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


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

* [Bug rtl-optimization/55719] [4.8 Regression] ICE: Segmentation fault
  2012-12-17 10:04 [Bug c/55719] New: [4.8 Regression] ICE: Segmentation fault rguenth at gcc dot gnu.org
  2012-12-17 10:05 ` [Bug c/55719] " rguenth at gcc dot gnu.org
@ 2012-12-17 10:11 ` rguenth at gcc dot gnu.org
  2012-12-17 10:28 ` rguenth at gcc dot gnu.org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-12-17 10:11 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ra
          Component|c                           |rtl-optimization

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> 2012-12-17 10:10:44 UTC ---
Backtrace is:

> ./cc1 -quiet -O3 ma_control_file.i  -I include -march=z10 -mtune=z196  -fPIC
/home/abuild/rpmbuild/BUILD/mariadb-5.5.28/storage/maria/ma_control_file.c: In
function 'ma_control_file_open':
/home/abuild/rpmbuild/BUILD/mariadb-5.5.28/storage/maria/ma_control_file.c:452:1:
internal compiler error: Segmentation fault
0xa9ab75 crash_signal
        /space/rguenther/src/svn/trunk/gcc/toplev.c:334
0xa0ee4e find_reloads_address_part
        /space/rguenther/src/svn/trunk/gcc/reload.c:6140
0xa0c5a1 find_reloads_address
        /space/rguenther/src/svn/trunk/gcc/reload.c:5312
0xa0f112 find_reloads_subreg_address
        /space/rguenther/src/svn/trunk/gcc/reload.c:6233
0xa0b29a find_reloads_toplev
        /space/rguenther/src/svn/trunk/gcc/reload.c:4822
0xa0558f find_reloads(rtx_def*, int, int, int, short*)
        /space/rguenther/src/svn/trunk/gcc/reload.c:2910
0xa15eaa calculate_needs_all_insns
        /space/rguenther/src/svn/trunk/gcc/reload1.c:1519

reducing with a cross.


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

* [Bug rtl-optimization/55719] [4.8 Regression] ICE: Segmentation fault
  2012-12-17 10:04 [Bug c/55719] New: [4.8 Regression] ICE: Segmentation fault rguenth at gcc dot gnu.org
  2012-12-17 10:05 ` [Bug c/55719] " rguenth at gcc dot gnu.org
  2012-12-17 10:11 ` [Bug rtl-optimization/55719] " rguenth at gcc dot gnu.org
@ 2012-12-17 10:28 ` rguenth at gcc dot gnu.org
  2012-12-17 16:00 ` krebbel at gcc dot gnu.org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-12-17 10:28 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> 2012-12-17 10:27:42 UTC ---
Created attachment 28984
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28984
autoreduced testcase


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

* [Bug rtl-optimization/55719] [4.8 Regression] ICE: Segmentation fault
  2012-12-17 10:04 [Bug c/55719] New: [4.8 Regression] ICE: Segmentation fault rguenth at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2012-12-17 10:28 ` rguenth at gcc dot gnu.org
@ 2012-12-17 16:00 ` krebbel at gcc dot gnu.org
  2013-01-07 15:37 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: krebbel at gcc dot gnu.org @ 2012-12-17 16:00 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-12-17
     Ever Confirmed|0                           |1

--- Comment #3 from Andreas Krebbel <krebbel at gcc dot gnu.org> 2012-12-17 16:00:17 UTC ---
Reghunt revealed r187064 as the culprit. This was the patch which enabled the
sched-pressure scheduling by default on s390.


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

* [Bug rtl-optimization/55719] [4.8 Regression] ICE: Segmentation fault
  2012-12-17 10:04 [Bug c/55719] New: [4.8 Regression] ICE: Segmentation fault rguenth at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2012-12-17 16:00 ` krebbel at gcc dot gnu.org
@ 2013-01-07 15:37 ` rguenth at gcc dot gnu.org
  2013-01-09 17:48 ` aldyh at gcc dot gnu.org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-01-07 15:37 UTC (permalink / raw)
  To: gcc-bugs


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

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

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


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

* [Bug rtl-optimization/55719] [4.8 Regression] ICE: Segmentation fault
  2012-12-17 10:04 [Bug c/55719] New: [4.8 Regression] ICE: Segmentation fault rguenth at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2013-01-07 15:37 ` rguenth at gcc dot gnu.org
@ 2013-01-09 17:48 ` aldyh at gcc dot gnu.org
  2013-01-09 18:46 ` aldyh at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: aldyh at gcc dot gnu.org @ 2013-01-09 17:48 UTC (permalink / raw)
  To: gcc-bugs


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

Aldy Hernandez <aldyh at gcc dot gnu.org> changed:

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

--- Comment #4 from Aldy Hernandez <aldyh at gcc dot gnu.org> 2013-01-09 17:48:10 UTC ---
My brain's too small for such a big testcase.  Further reduced testcase, and
reduced arguments.

// ./cc1 -quiet -O2 a.c  -march=z10   -fPIC -I /tmp
static int glob_a, glob_b;

int foobar()
{
  char buffer[100];

  glob_a = 0;
  glob_b = 0;

  bar (buffer);

  __builtin_memcpy(buffer, "abc", 3);

  buffer[7] = (char)(glob_a >> 8);
  buffer[11] = (char)glob_b;
  buffer[13] = (char)glob_a;
  buffer[17] = (char)(glob_a >> 8);

  return foo(0, 0, 0, 0);
}


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

* [Bug rtl-optimization/55719] [4.8 Regression] ICE: Segmentation fault
  2012-12-17 10:04 [Bug c/55719] New: [4.8 Regression] ICE: Segmentation fault rguenth at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2013-01-09 17:48 ` aldyh at gcc dot gnu.org
@ 2013-01-09 18:46 ` aldyh at gcc dot gnu.org
  2013-01-10  7:42 ` krebbel at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: aldyh at gcc dot gnu.org @ 2013-01-09 18:46 UTC (permalink / raw)
  To: gcc-bugs


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

Aldy Hernandez <aldyh at gcc dot gnu.org> changed:

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

--- Comment #5 from Aldy Hernandez <aldyh at gcc dot gnu.org> 2013-01-09 18:45:34 UTC ---
I'm out of my depth here, but perhaps someone can give me a hint on how to
debug this further.

As alluded to earlier, this ICE only happens with sched-pressure scheduling.

The actual ICE happens in find_reloads_address_part(), where we have are
analyzing X=:

(const:DI (plus:DI (symbol_ref:DI ("glob_b"))
        (const_int 3 [0x3])))

prefer_reload_class() returns NO_REGS, because legitimate_reload_constant_p()
returns false for the X above.  So when we call force_const_mem() in
find_reloads_address_part...

  if (CONSTANT_P (x)
      && (!targetm.legitimate_constant_p (mode, x)
      || targetm.preferred_reload_class (x, rclass) == NO_REGS))
    {
      x = force_const_mem (mode, x);   <-- HERE

force_const_mem() returns NULL because s390_cannot_force_const_mem() returns
true for the SYMBOL_REF in -fPIC mode.

Bottom line-- force_const_mem() returns NULL for a (const (plus SYMBOL_REF
CONST)) with -fPIC, and then we dereference this NULL.

Is the RTL correct?

Any hints?


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

* [Bug rtl-optimization/55719] [4.8 Regression] ICE: Segmentation fault
  2012-12-17 10:04 [Bug c/55719] New: [4.8 Regression] ICE: Segmentation fault rguenth at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2013-01-09 18:46 ` aldyh at gcc dot gnu.org
@ 2013-01-10  7:42 ` krebbel at gcc dot gnu.org
  2013-01-10  7:56 ` krebbel at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: krebbel at gcc dot gnu.org @ 2013-01-10  7:42 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |krebbel at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #6 from Andreas Krebbel <krebbel at gcc dot gnu.org> 2013-01-10 07:41:46 UTC ---
(In reply to comment #5)
> I'm out of my depth here, but perhaps someone can give me a hint on how to
> debug this further.
> 
> As alluded to earlier, this ICE only happens with sched-pressure scheduling.
> 
> The actual ICE happens in find_reloads_address_part(), where we have are
> analyzing X=:
> 
> (const:DI (plus:DI (symbol_ref:DI ("glob_b"))
>         (const_int 3 [0x3])))
> 
> prefer_reload_class() returns NO_REGS, because legitimate_reload_constant_p()
> returns false for the X above.  So when we call force_const_mem() in
> find_reloads_address_part...
> 
>   if (CONSTANT_P (x)
>       && (!targetm.legitimate_constant_p (mode, x)
>       || targetm.preferred_reload_class (x, rclass) == NO_REGS))
>     {
>       x = force_const_mem (mode, x);   <-- HERE
> 
> force_const_mem() returns NULL because s390_cannot_force_const_mem() returns
> true for the SYMBOL_REF in -fPIC mode.
> 
> Bottom line-- force_const_mem() returns NULL for a (const (plus SYMBOL_REF
> CONST)) with -fPIC, and then we dereference this NULL.
> 
> Is the RTL correct?
> 
> Any hints?

I'm already testing a patch. We have an instruction (larl) which is able to
handle pc-relative symbol references. But it only allows even addends. symref +
odd addend is handled via secondary reload. I think it is invalid that
preferred reload class returns NO_REGS here.


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

* [Bug rtl-optimization/55719] [4.8 Regression] ICE: Segmentation fault
  2012-12-17 10:04 [Bug c/55719] New: [4.8 Regression] ICE: Segmentation fault rguenth at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2013-01-10  7:42 ` krebbel at gcc dot gnu.org
@ 2013-01-10  7:56 ` krebbel at gcc dot gnu.org
  2013-01-11 16:44 ` krebbel at gcc dot gnu.org
  2013-01-11 16:46 ` krebbel at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: krebbel at gcc dot gnu.org @ 2013-01-10  7:56 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #7 from Andreas Krebbel <krebbel at gcc dot gnu.org> 2013-01-10 07:55:32 UTC ---
Created attachment 29137
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29137
Experimental fix

This patch fixes the problem for me. I will use Aldys testcase when comitting
since he reduced it a bit further.


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

* [Bug rtl-optimization/55719] [4.8 Regression] ICE: Segmentation fault
  2012-12-17 10:04 [Bug c/55719] New: [4.8 Regression] ICE: Segmentation fault rguenth at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2013-01-10  7:56 ` krebbel at gcc dot gnu.org
@ 2013-01-11 16:44 ` krebbel at gcc dot gnu.org
  2013-01-11 16:46 ` krebbel at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: krebbel at gcc dot gnu.org @ 2013-01-11 16:44 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #8 from Andreas Krebbel <krebbel at gcc dot gnu.org> 2013-01-11 16:43:56 UTC ---
Author: krebbel
Date: Fri Jan 11 16:43:49 2013
New Revision: 195109

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

    PR target/55719
    * config/s390/s390.c (s390_preferred_reload_class): Do not return
    NO_REGS for larl operands.
    (s390_reload_larl_operand): Use s390_load_address instead of
    emit_move_insn.

2013-01-11  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

    PR target/55719
    * gcc.target/s390/pr55719.c: New testcase.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/s390/s390.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug rtl-optimization/55719] [4.8 Regression] ICE: Segmentation fault
  2012-12-17 10:04 [Bug c/55719] New: [4.8 Regression] ICE: Segmentation fault rguenth at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2013-01-11 16:44 ` krebbel at gcc dot gnu.org
@ 2013-01-11 16:46 ` krebbel at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: krebbel at gcc dot gnu.org @ 2013-01-11 16:46 UTC (permalink / raw)
  To: gcc-bugs


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

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

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

--- Comment #9 from Andreas Krebbel <krebbel at gcc dot gnu.org> 2013-01-11 16:45:15 UTC ---
Fixed with commit above.


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

end of thread, other threads:[~2013-01-11 16:46 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-17 10:04 [Bug c/55719] New: [4.8 Regression] ICE: Segmentation fault rguenth at gcc dot gnu.org
2012-12-17 10:05 ` [Bug c/55719] " rguenth at gcc dot gnu.org
2012-12-17 10:11 ` [Bug rtl-optimization/55719] " rguenth at gcc dot gnu.org
2012-12-17 10:28 ` rguenth at gcc dot gnu.org
2012-12-17 16:00 ` krebbel at gcc dot gnu.org
2013-01-07 15:37 ` rguenth at gcc dot gnu.org
2013-01-09 17:48 ` aldyh at gcc dot gnu.org
2013-01-09 18:46 ` aldyh at gcc dot gnu.org
2013-01-10  7:42 ` krebbel at gcc dot gnu.org
2013-01-10  7:56 ` krebbel at gcc dot gnu.org
2013-01-11 16:44 ` krebbel at gcc dot gnu.org
2013-01-11 16:46 ` 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).