From patchwork Sat Nov 10 11:43:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 198179 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 312F32C007D for ; Sat, 10 Nov 2012 22:43:29 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1353152610; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Received:Date:Message-ID:Subject:From:To: Cc:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=LzoAJjH OuYaMAUluE3EywZIVsXU=; b=Vv2Of62ot8VsuFC3nFYqRuIIBK2M/09VRo3WBcV NEVQQoShE16yutA4cg6iXhfEq3I19PPm/RYZuEtlSFpPAeUnLyjES54EYXldMYFh ct9QtnPEavE6QFEvl1FrQL3pcsPgakXkwH6hp0EgwYkOJ0YSerFOV23mweXNCq1F S5uI= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:MIME-Version:Received:Received:Date:Message-ID:Subject:From:To:Cc:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=so8L+ENDepkAgkHHmVDoOlTxdV3v/ImT45EHI6iraMPi5dev1zQGFIinhbqeZT kDHL1EclwomCiJFkXPnMw+jrMfe9H6xbfJi2/VMI3NnJJRY3U7lpDY941W+xwyyp OBMlhKV1mubyxh+hbLJKOwFaOGEGAu8TFu9ZiGvUqxK28=; Received: (qmail 26118 invoked by alias); 10 Nov 2012 11:43:25 -0000 Received: (qmail 26110 invoked by uid 22791); 10 Nov 2012 11:43:24 -0000 X-SWARE-Spam-Status: No, hits=-4.2 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, TW_ZJ X-Spam-Check-By: sourceware.org Received: from mail-da0-f47.google.com (HELO mail-da0-f47.google.com) (209.85.210.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 10 Nov 2012 11:43:20 +0000 Received: by mail-da0-f47.google.com with SMTP id s35so1928223dak.20 for ; Sat, 10 Nov 2012 03:43:19 -0800 (PST) MIME-Version: 1.0 Received: by 10.68.197.71 with SMTP id is7mr35126326pbc.79.1352547799711; Sat, 10 Nov 2012 03:43:19 -0800 (PST) Received: by 10.66.246.232 with HTTP; Sat, 10 Nov 2012 03:43:19 -0800 (PST) Date: Sat, 10 Nov 2012 12:43:19 +0100 Message-ID: Subject: [PATCH, i386]: Fix PR 55247, ICE: Max. number of generated reload insns per insn is achieved From: Uros Bizjak To: gcc-patches@gcc.gnu.org Cc: "H.J. Lu" , Vladimir Makarov Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hello! Attached patch disparages riF->o alternative of *movti_internal_rex64 insn, as described by Vlad in comment #2 [1] The core of the problem however is, that gcc is unable to detect zero-extended address as offsetable. H.J. will propose a patch for this [2]. 2012-11-10 Vladimir Makarov Uros Bizjak PR target/55247 * config/i386/i386.md (*movti_internal_rex64): Add "!" to riF->o alternative. testsuite/ChangeLog: 2012-11-10 Uros Bizjak PR target/55247 * gcc.target/i386/pr55247.c: New test. Tested on x86_64-linux-gnu {,m32} and committed to mainline SVN. [1] gcc.gnu.org/bugzilla/show_bug.cgi?id=55247#c2 [2] http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55247#c6 Uros. Index: config/i386/i386.md =================================================================== --- config/i386/i386.md (revision 193387) +++ config/i386/i386.md (working copy) @@ -1874,7 +1874,7 @@ (const_string "OI")))]) (define_insn "*movti_internal_rex64" - [(set (match_operand:TI 0 "nonimmediate_operand" "=!r ,o ,x,x ,m") + [(set (match_operand:TI 0 "nonimmediate_operand" "=!r ,!o ,x,x ,m") (match_operand:TI 1 "general_operand" "riFo,riF,C,xm,x"))] "TARGET_64BIT && !(MEM_P (operands[0]) && MEM_P (operands[1]))" { Index: testsuite/gcc.target/i386/pr55247.c =================================================================== --- testsuite/gcc.target/i386/pr55247.c (revision 0) +++ testsuite/gcc.target/i386/pr55247.c (working copy) @@ -0,0 +1,38 @@ +/* { dg-do compile { target { ! { ia32 } } } } */ +/* { dg-options "-O2 -mx32 -maddress-mode=long -mno-sse" } */ + +typedef unsigned int uint32_t; +typedef unsigned int uintptr_t; +typedef uint32_t Elf32_Word; +typedef uint32_t Elf32_Addr; +typedef struct { + Elf32_Word st_name; + Elf32_Addr st_value; + Elf32_Word st_size; + unsigned char st_other; +} Elf32_Sym; +typedef struct { + Elf32_Word r_info; +} +Elf32_Rela; +typedef struct { + union { + Elf32_Addr d_ptr; + } + d_un; +} Elf32_Dyn; +struct link_map { + Elf32_Dyn *l_info[34]; +}; +typedef struct link_map *lookup_t; +extern void symbind32 (Elf32_Sym *); +void +_dl_profile_fixup (struct link_map *l, Elf32_Word reloc_arg) +{ + const Elf32_Sym *const symtab = (const void *) (l)->l_info[6]->d_un.d_ptr; + const Elf32_Rela *const reloc = (const void *) ((l)->l_info[23]->d_un.d_ptr + reloc_arg * sizeof (Elf32_Rela)); + const Elf32_Sym *refsym = &symtab[((reloc->r_info) >> 8)]; + const Elf32_Sym *defsym = refsym; + Elf32_Sym sym = *defsym; + symbind32 (&sym); +}