public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* what is the difference with and without crc extension support
@ 2022-03-03 13:41 Dongjiu Geng
  2022-03-03 13:48 ` Martin Liška
  2022-03-04 18:20 ` Richard Earnshaw
  0 siblings, 2 replies; 5+ messages in thread
From: Dongjiu Geng @ 2022-03-03 13:41 UTC (permalink / raw)
  To: gcc

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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: what is the difference with and without crc extension support
  2022-03-03 13:41 what is the difference with and without crc extension support Dongjiu Geng
@ 2022-03-03 13:48 ` Martin Liška
  2022-03-03 13:52   ` Dongjiu Geng
  2022-03-04 18:20 ` Richard Earnshaw
  1 sibling, 1 reply; 5+ messages in thread
From: Martin Liška @ 2022-03-03 13:48 UTC (permalink / raw)
  To: Dongjiu Geng, gcc

On 3/3/22 14: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.

Hello.

Please report bug here:
https://gcc.gnu.org/bugzilla/

and attach a pre-processed source file:
https://gcc.gnu.org/bugs/

Martin

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: what is the difference with and without crc extension support
  2022-03-03 13:48 ` Martin Liška
@ 2022-03-03 13:52   ` Dongjiu Geng
  2022-03-04 13:05     ` Martin Liška
  0 siblings, 1 reply; 5+ messages in thread
From: Dongjiu Geng @ 2022-03-03 13:52 UTC (permalink / raw)
  To: Martin Liška; +Cc: gcc

Thanks for the answer, my source file is complex,it is not convenient
attach,  because it is company code.  According to your  experience,
what is the reason about it?

Martin Liška <mliska@suse.cz> 于2022年3月3日周四 21:48写道:
>
> On 3/3/22 14: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.
>
> Hello.
>
> Please report bug here:
> https://gcc.gnu.org/bugzilla/
>
> and attach a pre-processed source file:
> https://gcc.gnu.org/bugs/
>
> Martin

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: what is the difference with and without crc extension support
  2022-03-03 13:52   ` Dongjiu Geng
@ 2022-03-04 13:05     ` Martin Liška
  0 siblings, 0 replies; 5+ messages in thread
From: Martin Liška @ 2022-03-04 13:05 UTC (permalink / raw)
  To: Dongjiu Geng; +Cc: gcc

On 3/3/22 14:52, Dongjiu Geng wrote:
> Thanks for the answer, my source file is complex,it is not convenient
> attach,  because it is company code.

I see. So then you can try -fdump-tree-optimized and compare the corresponding dump file.
Or you can use -fdump-tree-all -fdump-rtl-all and do the same.

> According to your  experience,
> what is the reason about it?

Dunno.

Cheers,
Martin

> 
> Martin Liška <mliska@suse.cz> 于2022年3月3日周四 21:48写道:
>>
>> On 3/3/22 14: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.
>>
>> Hello.
>>
>> Please report bug here:
>> https://gcc.gnu.org/bugzilla/
>>
>> and attach a pre-processed source file:
>> https://gcc.gnu.org/bugs/
>>
>> Martin


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: what is the difference with and without crc extension support
  2022-03-03 13:41 what is the difference with and without crc extension support Dongjiu Geng
  2022-03-03 13:48 ` Martin Liška
@ 2022-03-04 18:20 ` Richard Earnshaw
  1 sibling, 0 replies; 5+ messages in thread
From: Richard Earnshaw @ 2022-03-04 18:20 UTC (permalink / raw)
  To: Dongjiu Geng, gcc

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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-03-04 18:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-03 13:41 what is the difference with and without crc extension support 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 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).