From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19968 invoked by alias); 31 Jul 2002 23:56:02 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 19954 invoked by uid 71); 31 Jul 2002 23:56:01 -0000 Date: Wed, 31 Jul 2002 16:56:00 -0000 Message-ID: <20020731235601.19953.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Graham Stott Subject: Re: optimization/7460: gcc/g++ 3.1.1 20020714/20020718 (cygwin) segfault on __builtin_ia32_femms() Reply-To: Graham Stott X-SW-Source: 2002-07/txt/msg00827.txt.bz2 List-Id: The following reply was made to PR optimization/7460; it has been noted by GNATS. From: Graham Stott To: gcc@tbp.dyndns.org Cc: gcc-gnats@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: Re: optimization/7460: gcc/g++ 3.1.1 20020714/20020718 (cygwin) segfault on __builtin_ia32_femms() Date: Thu, 01 Aug 2002 00:53:36 +0100 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 * 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") -----------------------------------------------------------