Turning off SRA

2021-01-21 Thread Alan Lehotsky
I’m working on performance tuning a gcc 8.3 port and wanted to turn off SRA for 
an experiment.  But passing both

 -fno-tree-sra
 -fno-ipa-sra

but it’s still tagging compiled functions with  a “_isra” suffix, which would 
seem to indicate that it’s still running that optimization.

Is there a bigger hammer I’m missing?


Alan Lehotsky
https://codegentllc.com





Re: Turning off SRA

2021-01-21 Thread Richard Biener via Gcc
On Thu, Jan 21, 2021 at 3:31 PM Alan Lehotsky  wrote:
>
> I’m working on performance tuning a gcc 8.3 port and wanted to turn off SRA 
> for an experiment.  But passing both
>
>  -fno-tree-sra
>  -fno-ipa-sra
>
> but it’s still tagging compiled functions with  a “_isra” suffix, which would 
> seem to indicate that it’s still running that optimization.
>
> Is there a bigger hammer I’m missing?

Nope, that should do the trick already.

Richard.

>
> Alan Lehotsky
> https://codegentllc.com
>
>
>


Re: RFC: Add GNU_PROPERTY_UINT32_AND_XXX/GNU_PROPERTY_UINT32_OR_XXX

2021-01-21 Thread H.J. Lu via Gcc
On Wed, Jan 13, 2021 at 9:06 AM H.J. Lu  wrote:
>
> 1. GNU_PROPERTY_UINT32_AND_LO..GNU_PROPERTY_UINT32_AND_HI
>
>  #define GNU_PROPERTY_UINT32_AND_LO 0xb000
>  #define GNU_PROPERTY_UINT32_AND_HI 0xb0007fff
>
> A bit in the output pr_data field is set only if it is set in all
> relocatable input pr_data fields.  If all bits in the the output
> pr_data field are zero, this property should be removed from output.
>
> If the bit is 1, all input relocatables have the feature.  If the
> bit is 0 or the property is missing, the info is unknown.
>
> 2. GNU_PROPERTY_UINT32_OR_LO..GNU_PROPERTY_UINT32_OR_HI
>
>  #define GNU_PROPERTY_UINT32_OR_LO 0xb0008000
>  #define GNU_PROPERTY_UINT32_OR_HI 0xb000
>
> A bit in the output pr_data field is set if it is set in any
> relocatable input pr_data fields. If all bits in the the output
> pr_data field are zero, this property should be removed from output.
>
> If the bit is 1, some input relocatables have the feature.  If the
> bit is 0 or the property is missing, the info is unknown.
>
> The PDF is at
>
> https://gitlab.com/x86-psABIs/Linux-ABI/-/wikis/uploads/0690db0a3b7e5d8a44e0271a4be54aa7/linux-gABI-and-or-2021-01-13.pdf
>
> --
> H.J.

Here is the binutils patch to implement it.

-- 
H.J.
From 347b7c47ac6c2149b7e6bfb318bd85a030ce2096 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" 
Date: Sat, 16 Jan 2021 05:35:46 -0800
Subject: [PATCH] elf: Add
 GNU_PROPERTY_UINT32_AND_XXX/GNU_PROPERTY_UINT32_OR_XXX

Implement GNU_PROPERTY_UINT32_AND_XXX/GNU_PROPERTY_UINT32_OR_XXX:

https://sourceware.org/pipermail/gnu-gabi/2021q1/000467.html

1. GNU_PROPERTY_UINT32_AND_LO..GNU_PROPERTY_UINT32_AND_HI

 #define GNU_PROPERTY_UINT32_AND_LO 0xb000
 #define GNU_PROPERTY_UINT32_AND_HI 0xb0007fff

A bit in the output pr_data field is set only if it is set in all
relocatable input pr_data fields.  If all bits in the the output
pr_data field are zero, this property should be removed from output.

If the bit is 1, all input relocatables have the feature.  If the
bit is 0 or the property is missing, the info is unknown.

2. GNU_PROPERTY_UINT32_OR_LO..GNU_PROPERTY_UINT32_OR_HI

 #define GNU_PROPERTY_UINT32_OR_LO 0xb0008000
 #define GNU_PROPERTY_UINT32_OR_HI 0xb000

A bit in the output pr_data field is set if it is set in any
relocatable input pr_data fields. If all bits in the the output
pr_data field are zero, this property should be removed from output.

If the bit is 1, some input relocatables have the feature.  If the
bit is 0 or the property is missing, the info is unknown.

bfd/

	* elf-properties.c (_bfd_elf_parse_gnu_properties): Handle
	GNU_PROPERTY_UINT32_AND_LO, GNU_PROPERTY_UINT32_AND_HI,
	GNU_PROPERTY_UINT32_OR_LO and GNU_PROPERTY_UINT32_OR_HI.
	(elf_merge_gnu_properties): Likewise.

binutils/

	* readelf.c (print_gnu_property_note): Handle
	GNU_PROPERTY_UINT32_AND_LO, GNU_PROPERTY_UINT32_AND_HI,
	GNU_PROPERTY_UINT32_OR_LO and GNU_PROPERTY_UINT32_OR_HI.

include/

	* elf/common.h (GNU_PROPERTY_UINT32_AND_LO): New.
	(GNU_PROPERTY_UINT32_AND_HI): Likewise.
	(GNU_PROPERTY_UINT32_OR_LO): Likewise.
	(GNU_PROPERTY_UINT32_OR_HI): Likewise.

ld/

	* testsuite/ld-elf/property-and-1.d: New file.
	* testsuite/ld-elf/property-and-1.s: Likewise.
	* testsuite/ld-elf/property-and-2.d: Likewise.
	* testsuite/ld-elf/property-and-2.s: Likewise.
	* testsuite/ld-elf/property-and-3.d: Likewise.
	* testsuite/ld-elf/property-and-3.s: Likewise.
	* testsuite/ld-elf/property-and-4.d: Likewise.
	* testsuite/ld-elf/property-and-empty.s: Likewise.
	* testsuite/ld-elf/property-or-1.d: Likewise.
	* testsuite/ld-elf/property-or-1.s: Likewise.
	* testsuite/ld-elf/property-or-2.d: Likewise.
	* testsuite/ld-elf/property-or-2.s: Likewise.
	* testsuite/ld-elf/property-or-3.d: Likewise.
	* testsuite/ld-elf/property-or-3.s: Likewise.
	* testsuite/ld-elf/property-or-4.d: Likewise.
	* testsuite/ld-elf/property-or-empty.s: Likewise.
---
 bfd/elf-properties.c | 90 
 binutils/readelf.c   | 15 
 include/elf/common.h | 10 +++
 ld/testsuite/ld-elf/property-and-1.d |  7 ++
 ld/testsuite/ld-elf/property-and-1.s | 15 
 ld/testsuite/ld-elf/property-and-2.d |  8 +++
 ld/testsuite/ld-elf/property-and-2.s | 15 
 ld/testsuite/ld-elf/property-and-3.d |  8 +++
 ld/testsuite/ld-elf/property-and-3.s | 15 
 ld/testsuite/ld-elf/property-and-4.d | 12 
 ld/testsuite/ld-elf/property-and-empty.s | 15 
 ld/testsuite/ld-elf/property-or-1.d  | 11 +++
 ld/testsuite/ld-elf/property-or-1.s  | 15 
 ld/testsuite/ld-elf/property-or-2.d  | 12 
 ld/testsuite/ld-elf/property-or-2.s  | 15 
 ld/testsuite/ld-elf/property-or-3.d  | 12 
 ld/testsuite/ld-elf/property-or-3.s  | 15 
 ld/testsuite/ld-elf/property-or-4.d  | 12 
 ld/testsuite/ld-elf/property-or-empty.s  | 15 
 19 files changed, 317 insertions(+)
 create mode 100644 ld/testsuite/ld-elf/property-and-1.d
 create

Request for contribution to your project

2021-01-21 Thread divyanshu jamloki via Gcc
Ma'am

I am a 1st year computer science engineering undergraduate student at
krishna engineering college (affiliated to Dr. A.P.J. Abdul Kalam Technical
University (AKTU)) . I am actively looking for some GSoC organisation to
contribute . I actively contribute 2 years to a website name
livecultureofindia.com ( WordPress ) and have worked with html , c ,c++ . I
am interested to contribute in your project and your view to change world
by making others life easy .

I saw your organisation in GSoC and thought of asking you if system can be
a good organisation for me to start . If yes please guide me how to begin
and let me know how can I contact you for further help.


Hoping to hear from you soon

 Thank you


Re: RFC: Add GNU_PROPERTY_UINT32_AND_XXX/GNU_PROPERTY_UINT32_OR_XXX

2021-01-21 Thread Fangrui Song

On 2021-01-21, H.J. Lu via Gnu-gabi wrote:

On Wed, Jan 13, 2021 at 9:06 AM H.J. Lu  wrote:


1. GNU_PROPERTY_UINT32_AND_LO..GNU_PROPERTY_UINT32_AND_HI

 #define GNU_PROPERTY_UINT32_AND_LO 0xb000
 #define GNU_PROPERTY_UINT32_AND_HI 0xb0007fff

A bit in the output pr_data field is set only if it is set in all
relocatable input pr_data fields.  If all bits in the the output
pr_data field are zero, this property should be removed from output.

If the bit is 1, all input relocatables have the feature.  If the
bit is 0 or the property is missing, the info is unknown.

2. GNU_PROPERTY_UINT32_OR_LO..GNU_PROPERTY_UINT32_OR_HI

 #define GNU_PROPERTY_UINT32_OR_LO 0xb0008000
 #define GNU_PROPERTY_UINT32_OR_HI 0xb000

A bit in the output pr_data field is set if it is set in any
relocatable input pr_data fields. If all bits in the the output
pr_data field are zero, this property should be removed from output.

If the bit is 1, some input relocatables have the feature.  If the
bit is 0 or the property is missing, the info is unknown.

The PDF is at

https://gitlab.com/x86-psABIs/Linux-ABI/-/wikis/uploads/0690db0a3b7e5d8a44e0271a4be54aa7/linux-gABI-and-or-2021-01-13.pdf

--
H.J.


Here is the binutils patch to implement it.

--
H.J.


Hi, H.J.

Thank you for CCing llvm-dev:) In the past various GNU ABI proposals
went unnoticed by LLVM folks who don't happen to subscribe to GNU lists.
(A lot! I personally subscribe to some lists and check the discussion
just in case I miss something important:) )

I have researched a bit and observed that the following GNU_PROPERTY
values are currently used by compilers/linkers:

Bitwise OR for relocatable links. Bitwise AND for executable/shared
object links.

* GNU_PROPERTY_X86_FEATURE_1_AND = GNU_PROPERTY_X86_UINT32_AND_LO + 0,
* used by Intel Indirect branch tracking and Shadow Stack
* GNU_PROPERTY_AARCH64_FEATURE_1_AND, used by AArch64 Branch Target
* Identification and Pointer Authentication

Bitwise OR for all links.

* GNU_PROPERTY_X86_ISA_1_NEEDED = GNU_PROPERTY_X86_UINT32_OR_LO + 2,
* used by GCC -mneeded (for -march=x86-64-v[234])

There appear to be another type of AND/OR bits which are not defined in
ABIs (AFAICT):

* GNU_PROPERTY_X86_ISA_1_USED = GNU_PROPERTY_X86_UINT32_OR_AND_LO + 2
* GNU_PROPERTY_X86_FEATURE_2_USED = GNU_PROPERTY_X86_UINT32_OR_AND_LO +
* 1


I think generalizing the AND/OR idea to all architectures probably
requires us to think about these questions:

* What's the impending usage of the generic AND/OR ranges? ifunc? :)
* Does the concept generalize well to other architectures? If we
* consider AArch64/x86 FEATURE_1_AND to be the same thing, the current
* usage is purely x86 specific.
* Is AND/OR encoding expressive enough to represent the required states?
* I've asked two folks and they expressed concerns. I think the three
* AND/OR usage above speak for themselves.
* Szabolcs Nagy mentioned that GNU_PROPERTY is an OS-specific mechanism
* (GNU), but the features are oftentimes arch specific which make sense
* to other OSes or bare-metal.
* Szabolcs: Do we need any versioning mechanism?

The feature selection and compatibility checking mechanism has some
overlap with GNU/arch-specific attributes (e.g .ARM.attributes,
.riscv.attributes).  If I understand correctly, GNU_PROPERTY has an
associated program header so it can be checked by loaders
(kernel/ld.so/emulator) while Attributes don't have program headers so
they are largely assembler/linker protocols. In an inflexible way that
such feature bits can affect observable states to loaders as well, e.g.
.ARM.attributes can affect e_flags (soft/hard float).  .MIPS.abiflags
has an associated program header PT_MIPS_ABIFLAGS (I know nearly nothing
about mips) Some thoughts from mips folks would be useful.

Last, I think a feature selection and compatibility checking mechanism
is assuredly useful, but whether the current AND/OR scheme can perfectly
satisfy that goal I am unsure. Having the proposal is a very good start,
though:) Thanks a lot for driving the discussion:)


gcc-8-20210121 is now available

2021-01-21 Thread GCC Administrator via Gcc
Snapshot gcc-8-20210121 is now available on
  https://gcc.gnu.org/pub/gcc/snapshots/8-20210121/
and on various mirrors, see http://gcc.gnu.org/mirrors.html for details.

This snapshot has been generated from the GCC 8 git branch
with the following options: git://gcc.gnu.org/git/gcc.git branch releases/gcc-8 
revision c9569046bd8ba2671833d600b3bdbdb7de593873

You'll find:

 gcc-8-20210121.tar.xzComplete GCC

  SHA256=7b0afce5e5ca8643adfdd69dd88af7603389868c33b40be6d70c4b6d6b94272f
  SHA1=0192d83e0e85e27eccd8f8f4825055a484f03f4c

Diffs from 8-20210114 are available in the diffs/ subdirectory.

When a particular snapshot is ready for public consumption the LATEST-8
link is updated and a message is sent to the gcc list.  Please do not use
a snapshot before it has been announced that way.