From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 5C2E93857C6D for ; Fri, 4 Mar 2022 18:20:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5C2E93857C6D Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 10B05143D; Fri, 4 Mar 2022 10:20:59 -0800 (PST) Received: from [192.168.1.19] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8F67E3F73D; Fri, 4 Mar 2022 10:20:58 -0800 (PST) Message-ID: Date: Fri, 4 Mar 2022 18:20:32 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: what is the difference with and without crc extension support Content-Language: en-GB To: Dongjiu Geng , gcc@gcc.gnu.org References: From: Richard Earnshaw In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3491.1 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Mar 2022 18:21:00 -0000 On 03/03/2022 13:41, Dongjiu Geng via Gcc wrote: > Hi, > My program does not use CRC instructions,but I find the compiled > binary has much difference between using "-march=armv8-a+crc" and > using "-march=armv8-a". Even stranger, when I use > "-march=armv8-a+crc", I find my compiled binary can not run. but when > I change -O2 to -O0 based on "-march=armv8-a+crc", it can run. I do > not know what is the reason.. can you answer it? Thanks. The most common reason for a program failing to run when the optimizer is turned on is that it contains undefined behaviour. Make sure that you turn on GCC's warning options and fix anything that these report. It's very unlikely that the change of -march=armv8-a to -march=armv8-a+crc is the reason for the differences in compiled code that you are seeing. Something else to try here is to identify an object file that is different between the two options and then rebuild it both ways, but add "-g". You can then use readelf -debug-dump=str to print out the real options used by the compiler (there may be some additional strings reported in the dump, but the options are the bit that is interesting). The only difference should be the -march option you mentioned above. R.