public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Earnshaw <Richard.Earnshaw@foss.arm.com>
To: Dongjiu Geng <gengdongjiu1@gmail.com>, gcc@gcc.gnu.org
Subject: Re: what is the difference with and without crc extension support
Date: Fri, 4 Mar 2022 18:20:32 +0000	[thread overview]
Message-ID: <d0141361-2c35-22dd-7241-2c97b8af9d57@foss.arm.com> (raw)
In-Reply-To: <CABSBigQ5vBkj-CtQuDMfCVmYxVQ9est_2LXMZ8Heu5Y1Cixd+g@mail.gmail.com>

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 <object-file>

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.

      parent reply	other threads:[~2022-03-04 18:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-03 13:41 Dongjiu Geng
2022-03-03 13:48 ` Martin Liška
2022-03-03 13:52   ` Dongjiu Geng
2022-03-04 13:05     ` Martin Liška
2022-03-04 18:20 ` Richard Earnshaw [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d0141361-2c35-22dd-7241-2c97b8af9d57@foss.arm.com \
    --to=richard.earnshaw@foss.arm.com \
    --cc=gcc@gcc.gnu.org \
    --cc=gengdongjiu1@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).