[Bug rtl-optimization/78580] [6/7 Regression] Segfault in gcc with multilib (-m32) and -ffixed-*

2016-12-21 Thread vmakarov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78580

--- Comment #5 from Vladimir Makarov  ---
Author: vmakarov
Date: Wed Dec 21 22:20:11 2016
New Revision: 243875

URL: https://gcc.gnu.org/viewcvs?rev=243875=gcc=rev
Log:
2016-12-21  Vladimir Makarov  

PR rtl-optimization/78580
* ira-costs.c (find_costs_and_classes): Make regno_aclass
translated into an allocno class.

2016-12-21  Vladimir Makarov  

PR rtl-optimization/78580
* gcc.target/i386/pr78580.c: New.


Added:
trunk/gcc/testsuite/gcc.target/i386/pr78580.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/ira-costs.c
trunk/gcc/testsuite/ChangeLog

[Bug rtl-optimization/78580] [6/7 Regression] Segfault in gcc with multilib (-m32) and -ffixed-*

2016-12-21 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78580

Jakub Jelinek  changed:

   What|Removed |Added

   Target Milestone|6.3 |6.4

--- Comment #4 from Jakub Jelinek  ---
GCC 6.3 is being released, adjusting target milestone.

[Bug rtl-optimization/78580] [6/7 Regression] Segfault in gcc with multilib (-m32) and -ffixed-*

2016-12-16 Thread vmakarov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78580

--- Comment #3 from Vladimir Makarov  ---
(In reply to Jakub Jelinek from comment #2)
>
> So, is the bug that i?86 needs Q_REGS to be an allocno class always (shall
> ix86_additional_allocno_class_p return true also for Q_REGS?  Just for -m32
> or always?), or is the bug that if Q_REGS is not an allocno class then there
> shouldn't be allocno with that class?

I believe there should be no allocno having reg class which is not an allocno
class.

I've been working on the issue for some time but still did not find the best
way and place (there are a few of them) to fix it especially when the target
code can change allocno class using a hook.

I am planning to have a patch on the next week.

[Bug rtl-optimization/78580] [6/7 Regression] Segfault in gcc with multilib (-m32) and -ffixed-*

2016-12-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78580

Richard Biener  changed:

   What|Removed |Added

 Target||i?86-*-*
   Priority|P3  |P2

[Bug rtl-optimization/78580] [6/7 Regression] Segfault in gcc with multilib (-m32) and -ffixed-*

2016-12-01 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78580

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org,
   ||uros at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek  ---
/* PR rtl-optimization/78580 */
/* { dg-do compile } */
/* { dg-options "-O0 -ffixed-ebx" } */

extern const signed char a;

int
foo (signed char x)
{
  return x;
}

int
main ()
{
  foo (a);
  return 0;
}

Apparently with just -m32 we have ira_allocno_classes of:
AREG,DREG,CREG,BREG,SIREG,DIREG,AD_REGS,CLOBBERED_REGS,Q_REGS,NON_Q_REGS,TLS_GOTBASE_REGS,GENERAL_REGS,FP_TOP_REG,FP_SECOND_REG,FLOAT_REGS,FLOAT_INT_REGS
while with -m32 -ffixed-ebx
AREG,DREG,CREG,SIREG,DIREG,AD_REGS,CLOBBERED_REGS,NON_Q_REGS,TLS_GOTBASE_REGS,GENERAL_REGS,FP_TOP_REG,FP_SECOND_REG,FLOAT_REGS,FLOAT_INT_REGS
i.e. BREG and Q_REGS is missing in the latter case.  update_bad_spill_attribute
only initializes dead_points for the allocno classes, but then we process
allocno with Q_REGS allocno class and in the latter case (sometimes) ICE
because dead_points[Q_REGS] is random garbage.
So, is the bug that i?86 needs Q_REGS to be an allocno class always (shall
ix86_additional_allocno_class_p return true also for Q_REGS?  Just for -m32 or
always?), or is the bug that if Q_REGS is not an allocno class then there
shouldn't be allocno with that class?

[Bug rtl-optimization/78580] [6/7 Regression] Segfault in gcc with multilib (-m32) and -ffixed-*

2016-11-29 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78580

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
  Known to work||5.4.1
   Keywords||ice-on-valid-code, ra
   Last reconfirmed||2016-11-29
  Component|c   |rtl-optimization
 CC||vmakarov at gcc dot gnu.org
 Ever confirmed|0   |1
Summary|Segfault in gcc with|[6/7 Regression] Segfault
   |multilib (-m32) and |in gcc with multilib (-m32)
   |-ffixed-*   |and -ffixed-*
   Target Milestone|--- |6.3
  Known to fail||6.2.1, 7.0

--- Comment #1 from Richard Biener  ---
Confirmed.

> gcc-6  t.i -S -m32 -ffixed-ebx -B /abuild/rguenther/gcc6-g/gcc
t.i: In function ‘StartOS’:
t.i:4:2: internal compiler error: Segmentation fault
  int StartOS(signed char f) { return f; }
  ^~~
0xe3af12 crash_signal
/space/rguenther/src/svn/gcc-6-branch/gcc/toplev.c:333
0x8a275d bitmap_element_allocate
/space/rguenther/src/svn/gcc-6-branch/gcc/bitmap.c:133
0x8a3461 bitmap_set_bit(bitmap_head*, int)
/space/rguenther/src/svn/gcc-6-branch/gcc/bitmap.c:605
0xc03b81 update_bad_spill_attribute
/space/rguenther/src/svn/gcc-6-branch/gcc/ira-build.c:2650
0xc05cce ira_build()
/space/rguenther/src/svn/gcc-6-branch/gcc/ira-build.c:3424
0xbfc1c1 ira
/space/rguenther/src/svn/gcc-6-branch/gcc/ira.c:5261
0xbfc9da execute
/space/rguenther/src/svn/gcc-6-branch/gcc/ira.c:5566
Please submit a full bug report,
with preprocessed source if appropriate.