From patchwork Fri May 4 11:05:46 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 156867 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 72BA5B6FAC for ; Fri, 4 May 2012 21:06:08 +1000 (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=1336734369; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Date: From:To:Subject:Message-ID:MIME-Version:Content-Type: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=J0AMKyqaz8enknBoOFel X+IP5G4=; b=W3wD1GOeJ1wfGrdO7ET3FwMAQlmCPREaCploHqsS+RiN7XnwP+4u ed8VzZJPf8odfEGXoVcgpSSzEjPNCKTWNvSl2rbU2YVfjZJxlljQcEg9+oKV7oDh pSfYhbOrcosHm0f/3X8yCiA4cxlOEDRzTFomvwEZMb97K/Md8O/4Gdc= 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:Date:From:To:Subject:Message-ID:MIME-Version:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=oJNd/hPdHBUNi1x0kMlcAUUiornUbF6Mhy93jx45Rd1qrL3vRp5nenAUgP3SNe katKfH8ZvjnX7KRVXg4YjNYhZC+dtJxjvhFyY1uqkH9ht3kDob+JHKC1MVlcYMak prFngKPCVq9UyL+ij92dwizpvzbJw2rAwrlsoZlSdgXBQ=; Received: (qmail 13543 invoked by alias); 4 May 2012 11:06:03 -0000 Received: (qmail 13534 invoked by uid 22791); 4 May 2012 11:06:03 -0000 X-SWARE-Spam-Status: No, hits=-5.3 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 04 May 2012 11:05:47 +0000 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 74CF389471 for ; Fri, 4 May 2012 13:05:46 +0200 (CEST) Date: Fri, 4 May 2012 13:05:46 +0200 (CEST) From: Richard Guenther To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix PR50602 Message-ID: MIME-Version: 1.0 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 -freg-struct-return and -fpcc-struct-return are two common ABI options which have to be consistent in all input files when doing LTO (inconsistencies may lead to ICEs and "miscompiles"). Their setting needs to be determined from the linker inputs and its best to ignore those on the linker command line (unless we want to bother diagnosing mismatches there). The following implements this (we'll have a hard time diagnosing frontend / target specific ABI option mismatches - at least without a new magic option file annotation). I'll commit this after some testing. Thanks, Richard. 2012-05-04 Richard Guenther PR lto/50602 * lto-wrapper.c (merge_and_complain): Complain about mismatches of -freg-struct-return and -fpcc-struct-return. (run_gcc): Pass through -freg-struct-return and -fpcc-struct-return from the input file options and ignore those from the link command line. Index: gcc/lto-wrapper.c =================================================================== --- gcc/lto-wrapper.c (revision 187148) +++ gcc/lto-wrapper.c (working copy) @@ -414,6 +414,16 @@ merge_and_complain (struct cl_decoded_op if (j == *decoded_options_count) append_option (decoded_options, decoded_options_count, foption); break; + + case OPT_freg_struct_return: + case OPT_fpcc_struct_return: + for (j = 0; j < *decoded_options_count; ++j) + if ((*decoded_options)[j].opt_index == foption->opt_index) + break; + if (j == *decoded_options_count) + fatal ("Option %s not used consistently in all LTO input files", + foption->orig_option_with_args_text); + break; } } } @@ -558,6 +568,8 @@ run_gcc (unsigned argc, char *argv[]) case OPT_fcommon: case OPT_fexceptions: case OPT_fgnu_tm: + case OPT_freg_struct_return: + case OPT_fpcc_struct_return: break; default: @@ -619,6 +631,12 @@ run_gcc (unsigned argc, char *argv[]) /* We've handled these LTO options, do not pass them on. */ continue; + case OPT_freg_struct_return: + case OPT_fpcc_struct_return: + /* Ignore these, they are determined by the input files. + ??? We fail to diagnose a possible mismatch here. */ + continue; + default: break; }