[Bug rtl-optimization/55719] [4.8 Regression] ICE: Segmentation fault

2013-01-11 Thread krebbel at gcc dot gnu.org


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=gccview=revrev=195109

Log:

2013-01-11  Andreas Krebbel  andreas.kreb...@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.kreb...@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


[Bug rtl-optimization/55719] [4.8 Regression] ICE: Segmentation fault

2013-01-11 Thread krebbel at gcc dot gnu.org


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.


[Bug rtl-optimization/55719] [4.8 Regression] ICE: Segmentation fault

2013-01-09 Thread aldyh at gcc dot gnu.org


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

}


[Bug rtl-optimization/55719] [4.8 Regression] ICE: Segmentation fault

2013-01-09 Thread aldyh at gcc dot gnu.org


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?


[Bug rtl-optimization/55719] [4.8 Regression] ICE: Segmentation fault

2013-01-09 Thread krebbel at gcc dot gnu.org


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.


[Bug rtl-optimization/55719] [4.8 Regression] ICE: Segmentation fault

2013-01-09 Thread krebbel at gcc dot gnu.org


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.


[Bug rtl-optimization/55719] [4.8 Regression] ICE: Segmentation fault

2013-01-07 Thread rguenth at gcc dot gnu.org


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


[Bug rtl-optimization/55719] [4.8 Regression] ICE: Segmentation fault

2012-12-17 Thread rguenth at gcc dot gnu.org


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.


[Bug rtl-optimization/55719] [4.8 Regression] ICE: Segmentation fault

2012-12-17 Thread rguenth at gcc dot gnu.org


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


[Bug rtl-optimization/55719] [4.8 Regression] ICE: Segmentation fault

2012-12-17 Thread krebbel at gcc dot gnu.org


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.