This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: optimization/7460: gcc/g++ 3.1.1 20020714/20020718 (cygwin) segfaulton __builtin_ia32_femms()
- From: Graham Stott <graham dot stott at btinternet dot com>
- To: gcc at tbp dot dyndns dot org
- Cc: gcc-gnats at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Thu, 01 Aug 2002 00:53:36 +0100
- Subject: Re: optimization/7460: gcc/g++ 3.1.1 20020714/20020718 (cygwin) segfaulton __builtin_ia32_femms()
- References: <20020731222120.6687.qmail@sources.redhat.com>
All,
Confirmed also present CVS mainline and not cygwin specific.
The problem here is the define_attr "memory" in i386.md assumes that an insn always has two operands
which is not the case for femms so when get_attr_memory tries to determine the "memory" attribute
for the femms insn it tries to access operand 2 which doesn't exist.
The patch fixes this problem for femms by explicitly specifying the "memory" attrib on the insn itself
so that get_attr_memory nevers gets called for this insn.
This doesn't fix the generic problem with the define_attr "memory" definition which is assuming an insn
always has two operands.
bootstrapped i686-pc-linux-gnu all languages no regressions.
OK for mainline and 3.2?
Graham
ChangeLog
2002-07-31 Graham Stott <graham.stott@btinternet.com>
* config/i386/i386.md ("femms"): Add "memory" attr "none".
-------------------------------------------------------------
Index: i386.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.md,v
retrieving revision 1.378
diff -c -p -r1.378 i386.md
*** i386.md 16 Jul 2002 10:24:11 -0000 1.378
--- i386.md 31 Jul 2002 23:35:13 -0000
*** 19819,19825 ****
(clobber (reg:DI 36))]
"TARGET_3DNOW"
"femms"
! [(set_attr "type" "mmx")])
(define_insn "pf2id"
[(set (match_operand:V2SI 0 "register_operand" "=y")
--- 19819,19826 ----
(clobber (reg:DI 36))]
"TARGET_3DNOW"
"femms"
! [(set_attr "type" "mmx")
! (set_attr "memory" "none")])
(define_insn "pf2id"
[(set (match_operand:V2SI 0 "register_operand" "=y")
-----------------------------------------------------------