Bug 43763 - segfault when using by -mwarn-cell-microcode
Summary: segfault when using by -mwarn-cell-microcode
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.4.3
: P3 normal
Target Milestone: ---
Assignee: Segher Boessenkool
URL:
Keywords: FIXME, ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2010-04-16 00:45 UTC by gcc_bz
Modified: 2017-09-21 19:24 UTC (History)
3 users (show)

See Also:
Host:
Target: powerpc*-*-*
Build:
Known to work:
Known to fail:
Last reconfirmed: 2010-04-16 00:52:30


Attachments
snippet that triggers the segfault (227 bytes, text/plain)
2010-04-16 00:47 UTC, gcc_bz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gcc_bz 2010-04-16 00:45:43 UTC
Compiler segfaults in some cases when using -mwarn-cell-microcode.
Comment 1 gcc_bz 2010-04-16 00:47:53 UTC
Created attachment 20390 [details]
snippet that triggers the segfault

Segfaults when compiled with -O3 -mcpu=cell -mwarn-cell-microcode.
Comment 2 Andrew Pinski 2010-04-16 00:52:30 UTC
Confirmed.  The problem is from:
  /* Vector constant 0 is handled as a splitter of V2SI, and in the
     pattern of V1DI, V4HI, and V2SF.

     FIXME: We should probably return # and add post reload
     splitters for these, but this way is so easy ;-).  */
Comment 3 Segher Boessenkool 2015-11-22 12:01:21 UTC
Still happens.
Comment 4 Segher Boessenkool 2017-03-03 17:01:21 UTC
Author: segher
Date: Fri Mar  3 17:00:50 2017
New Revision: 245880

URL: https://gcc.gnu.org/viewcvs?rev=245880&root=gcc&view=rev
Log:
rs6000: Fix for -mwarn-cell-microcode (PR43763)

If using -mwarn-cell-microcode, rs6000_final_prescan_insn calls
get_insn_template to get the name of the machine instruction.  But,
get_insn_template calls the output template if that is code, and that
then can modify recog_data (it is normal to change the operands, for
example).

This patch saves and restores recog_data around the call to
get_insn_template to fix the problems this causes.


	PR target/43763
	* config/rs6000/rs6000.c (rs6000_final_prescan_insn): Save and
	restore recog_data (including the operand rtxes inside it) around
	the call to get_insn_template.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/rs6000/rs6000.c
Comment 5 Segher Boessenkool 2017-09-21 19:24:03 UTC
-mwarn-cell-microcode was removed in r248695 (it's in GCC 7).

No backports planned.