Skip to content

Add support for access attribute #65

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
e71e473
Build and upload artifact on GitHub Actions
antoyo May 31, 2021
9756d27
Distribute version without 128-bit integers
antoyo Feb 16, 2024
4ddecdf
Add support for packed struct
antoyo Mar 29, 2022
2ecf9fd
Add support for try/catch
antoyo Oct 15, 2022
8a77be1
Fix bug related to the personality function
antoyo Apr 16, 2023
b370e57
Make new_array_type take unsigned long
antoyo Mar 4, 2023
b97aab6
Reorganize the CPU feature detection
antoyo Oct 11, 2024
3f4d5c8
Add ability to get CPU features
antoyo Jun 26, 2023
89fa083
Fix get_size of size_t
antoyo Nov 3, 2023
ca10c59
libgccjit: Do not treat warnings as errors
antoyo Feb 12, 2024
5f6f1ba
feat(gccjit): Allow set_loccation to various classes
tempdragon Feb 18, 2024
9a80c41
Add _Float16, _Float32, _Float64 and __float128 support for jit
Apr 3, 2024
981d370
Target Info extended with supported target dependent types
Apr 18, 2024
831fd1c
Add git_jit_type_is_floating_point() function
Apr 22, 2024
3b410e7
Some fixes and workaround for aarch64
antoyo Apr 24, 2024
e3f783d
Make is_same_type_as() supporting floating point types. Improve type …
Apr 29, 2024
28f9ae1
libgccjit: Add support for Aarch64 CPU features
antoyo Apr 26, 2024
f2ebb9d
Fix is_same_type_as for vector type
Jun 21, 2024
0aca03d
Add `gcc_jit_rvalue_set_type`
GuillaumeGomez Apr 21, 2024
0a2a245
Add support for the weak variable attribute
antoyo Sep 1, 2024
cbee246
Handle missing types in jit_langhook_type_for_mode
antoyo Oct 8, 2024
5919927
Fix licenses
GuillaumeGomez Jul 22, 2024
67ee612
jit: Fix volatile loads and stores
YakoYakoYokuYoku Jan 3, 2024
040b490
libgccjit: Allow sending a const pointer as argument
antoyo May 24, 2022
7eda24f
Remove wrong void type for sized floating-point types in tree_type_to…
antoyo Nov 26, 2024
f90e510
libgccjit: Allow casts between integers and pointers
antoyo Dec 10, 2024
9d75591
libgccjit: Fix infinite recursion in gt_ggc_mx_lang_tree_node
antoyo Jan 15, 2025
038c30d
libgccjit: Fix for -fanalyzer used in libgccjit
antoyo Mar 25, 2024
d6f5a70
libgccjit: Add the function attributes for setting the ABI
antoyo Feb 12, 2025
48664a6
libgccjit: Add support for the x87 CPU feature
antoyo Feb 14, 2025
320d91c
Add support for `access` attribute
GuillaumeGomez Mar 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: CI

permissions:
contents: write

on:
- push
- pull_request

jobs:
build:
runs-on: ubuntu-24.04

strategy:
fail-fast: false
matrix:
version:
- { use_patch: true, asset_name: "gcc-15-without-int128.deb" }
- { use_path: false, asset_name: "gcc-15.deb" }

steps:
- uses: actions/checkout@v2

- name: Install mpfr
run: sudo apt-get install gcc-10 libmpfr-dev libmpc-dev

- name: Apply patch to disable 128-bit integers
if: matrix.version.use_patch
run: git apply patches/0001-Disable-128-bit-integers-for-testing-purposes.patch

- name: Build libgccjit
run: |
cd ..
ls
mkdir build install
cd build
../gcc/configure --enable-host-shared --enable-languages=c,jit,lto --disable-bootstrap --disable-multilib --prefix=$(pwd)/../install/usr --libdir=$(pwd)/../install/usr/lib --libexecdir=$(pwd)/../install/usr/lib
make -j4
make install

- name: Build Debian package
run: |
cd ..
mkdir install/DEBIAN
cat > install/DEBIAN/control << EOF
Package: gcc-15
Version: 15
Architecture: amd64
Maintainer: Antoni Boucher <[email protected]>
Description: gcc 15 for rustc_codegen_gcc CI
EOF
dpkg-deb --root-owner-group --build install
mv install.deb gcc-15.deb

- name: Compute tag name
id: tag_name
run: |
git_hash=$(git rev-parse "$GITHUB_SHA")
echo "TAG_NAME=$git_hash" >> $GITHUB_OUTPUT

- name: Create tag
if: github.ref == 'refs/heads/master'
continue-on-error: true
uses: laputansoft/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
create_annotated_tag: true
tag: master-${{ steps.tag_name.outputs.TAG_NAME }}

- name: Create release
if: github.ref == 'refs/heads/master' && !matrix.version.use_patch
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: /home/runner/work/gcc/install/usr/lib/libgccjit.so.0.0.1
asset_name: libgccjit.so
tag: master-${{ steps.tag_name.outputs.TAG_NAME }}

- name: Create release
if: github.ref == 'refs/heads/master'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: /home/runner/work/gcc/gcc-15.deb
asset_name: ${{ matrix.version.asset_name }}
tag: master-${{ steps.tag_name.outputs.TAG_NAME }}
36 changes: 33 additions & 3 deletions gcc/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,8 @@ tm_d_file_list=@tm_d_file_list@
tm_d_include_list=@tm_d_include_list@
tm_rust_file_list=@tm_rust_file_list@
tm_rust_include_list=@tm_rust_include_list@
tm_jit_file_list=@tm_jit_file_list@
tm_jit_include_list=@tm_jit_include_list@
build_xm_file_list=@build_xm_file_list@
build_xm_include_list=@build_xm_include_list@
build_xm_defines=@build_xm_defines@
Expand Down Expand Up @@ -911,6 +913,7 @@ TCONFIG_H = tconfig.h $(xm_file_list)
TM_P_H = tm_p.h $(tm_p_file_list) $(TREE_H)
TM_D_H = tm_d.h $(tm_d_file_list)
TM_RUST_H = tm_rust.h $(tm_rust_file_list)
TM_JIT_H = tm_jit.h $(tm_jit_file_list)
GTM_H = tm.h $(tm_file_list) insn-constants.h
TM_H = $(GTM_H) insn-flags.h $(OPTIONS_H)

Expand Down Expand Up @@ -970,11 +973,13 @@ C_TARGET_DEF = c-family/c-target.def target-hooks-macros.h
COMMON_TARGET_DEF = common/common-target.def target-hooks-macros.h
D_TARGET_DEF = d/d-target.def target-hooks-macros.h
RUST_TARGET_DEF = rust/rust-target.def target-hooks-macros.h
JIT_TARGET_DEF = jit/jit-target.def target-hooks-macros.h
TARGET_H = $(TM_H) target.h $(TARGET_DEF) insn-modes.h insn-codes.h
C_TARGET_H = c-family/c-target.h $(C_TARGET_DEF)
COMMON_TARGET_H = common/common-target.h $(INPUT_H) $(COMMON_TARGET_DEF)
D_TARGET_H = d/d-target.h $(D_TARGET_DEF)
RUST_TARGET_H = rust/rust-target.h $(RUST_TARGET_DEF)
JIT_TARGET_H = jit/jit-target.h $(JIT_TARGET_DEF)
MACHMODE_H = machmode.h mode-classes.def
HOOKS_H = hooks.h
HOSTHOOKS_DEF_H = hosthooks-def.h $(HOOKS_H)
Expand Down Expand Up @@ -1288,6 +1293,9 @@ CXX_TARGET_OBJS=@cxx_target_objs@
# Target specific, D specific object file
D_TARGET_OBJS=@d_target_objs@

# Target specific, JIT specific object file
JIT_TARGET_OBJS=@jit_target_objs@

# Target specific, Fortran specific object file
FORTRAN_TARGET_OBJS=@fortran_target_objs@

Expand Down Expand Up @@ -2059,6 +2067,7 @@ tm.h: cs-tm.h ; @true
tm_p.h: cs-tm_p.h ; @true
tm_d.h: cs-tm_d.h ; @true
tm_rust.h: cs-tm_rust.h ; @true
tm_jit.h: cs-tm_jit.h ; @true

cs-config.h: Makefile
TARGET_CPU_DEFAULT="" \
Expand Down Expand Up @@ -2098,6 +2107,11 @@ cs-tm_rust.h: Makefile
HEADERS="$(tm_rust_include_list)" DEFINES="" \
$(SHELL) $(srcdir)/mkconfig.sh tm_rust.h

cs-tm_jit.h: Makefile
TARGET_CPU_DEFAULT="" \
HEADERS="$(tm_jit_include_list)" DEFINES="" \
$(SHELL) $(srcdir)/mkconfig.sh tm_jit.h

# Don't automatically run autoconf, since configure.ac might be accidentally
# newer than configure. Also, this writes into the source directory which
# might be on a read-only file system. If configured for maintainer mode
Expand Down Expand Up @@ -2563,6 +2577,12 @@ default-d.o: config/default-d.cc
$(COMPILE) $<
$(POSTCOMPILE)

# Files used by the JIT language front end.

default-jit.o: config/default-jit.cc
$(COMPILE) $<
$(POSTCOMPILE)

# Files used by the Rust language front end.

default-rust.o: config/default-rust.cc
Expand Down Expand Up @@ -2902,6 +2922,15 @@ s-rust-target-hooks-def-h: build/genhooks$(build_exeext)
rust/rust-target-hooks-def.h
$(STAMP) s-rust-target-hooks-def-h

jit/jit-target-hooks-def.h: s-jit-target-hooks-def-h; @true

s-jit-target-hooks-def-h: build/genhooks$(build_exeext)
$(RUN_GEN) build/genhooks$(build_exeext) "JIT Target Hook" \
> tmp-jit-target-hooks-def.h
$(SHELL) $(srcdir)/../move-if-change tmp-jit-target-hooks-def.h \
jit/jit-target-hooks-def.h
$(STAMP) s-jit-target-hooks-def-h

# check if someone mistakenly only changed tm.texi.
# We use a different pathname here to avoid a circular dependency.
s-tm-texi: $(srcdir)/doc/../doc/tm.texi
Expand Down Expand Up @@ -3096,7 +3125,7 @@ s-gtype: $(EXTRA_GTYPE_DEPS) build/gengtype$(build_exeext) \
-r gtype.state
$(STAMP) s-gtype

generated_files = config.h tm.h $(TM_P_H) $(TM_D_H) $(TM_H) multilib.h \
generated_files = config.h tm.h $(TM_P_H) $(TM_D_H) $(TM_JIT_H) $(TM_H) multilib.h \
$(simple_generated_h) specs.h \
tree-check.h genrtl.h insn-modes.h insn-modes-inline.h \
tm-preds.h tm-constrs.h \
Expand All @@ -3108,6 +3137,7 @@ generated_files = config.h tm.h $(TM_P_H) $(TM_D_H) $(TM_H) multilib.h \
c-family/c-target-hooks-def.h d/d-target-hooks-def.h \
$(TM_RUST_H) rust/rust-target-hooks-def.h \
case-cfn-macros.h \
jit/jit-target-hooks-def.h case-cfn-macros.h \
cfn-operators.pd omp-device-properties.h

#
Expand Down Expand Up @@ -3241,8 +3271,8 @@ build/genrecog.o : genrecog.cc $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
$(CORETYPES_H) $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H) \
$(HASH_TABLE_H) inchash.h
build/genhooks.o : genhooks.cc $(TARGET_DEF) $(C_TARGET_DEF) \
$(COMMON_TARGET_DEF) $(D_TARGET_DEF) $(RUST_TARGET_DEF) $(BCONFIG_H) \
$(SYSTEM_H) errors.h
$(COMMON_TARGET_DEF) $(D_TARGET_DEF) $(RUST_TARGET_DEF) $(JIT_TARGET_DEF) \
$(BCONFIG_H) $(SYSTEM_H) errors.h
build/genmddump.o : genmddump.cc $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
$(CORETYPES_H) $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H)
build/genmatch.o : genmatch.cc $(BCONFIG_H) $(SYSTEM_H) $(CORETYPES_H) \
Expand Down
2 changes: 2 additions & 0 deletions gcc/analyzer/checker-event.h
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,8 @@ class inlined_call_event : public checker_event
m_apparent_callee_fndecl (apparent_callee_fndecl),
m_apparent_caller_fndecl (apparent_caller_fndecl)
{
gcc_assert (apparent_callee_fndecl != NULL);
gcc_assert (apparent_caller_fndecl != NULL);
gcc_assert (LOCATION_BLOCK (loc) == NULL);
}

Expand Down
3 changes: 1 addition & 2 deletions gcc/c-family/c-attribs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ static tree handle_expected_throw_attribute (tree *, tree, tree, int, bool *);
static tree handle_cleanup_attribute (tree *, tree, tree, int, bool *);
static tree handle_warn_unused_result_attribute (tree *, tree, tree, int,
bool *);
static tree handle_access_attribute (tree *, tree, tree, int, bool *);

static tree handle_sentinel_attribute (tree *, tree, tree, int, bool *);
static tree handle_type_generic_attribute (tree *, tree, tree, int, bool *);
Expand Down Expand Up @@ -5399,7 +5398,7 @@ append_access_attr_idxs (tree node[3], tree attrs, const char *attrstr,
representing a VLA bound. To speed up parsing, the handler transforms
the attribute and its arguments into a string. */

static tree
tree
handle_access_attribute (tree node[3], tree name, tree args, int flags,
bool *no_add_attrs)
{
Expand Down
1 change: 1 addition & 0 deletions gcc/c-family/c-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -1668,6 +1668,7 @@ extern tree handle_musttail_attribute (tree *, tree, tree, int, bool *);
extern bool has_attribute (location_t, tree, tree, tree (*)(tree));
extern tree build_attr_access_from_parms (tree, bool);
extern void set_musttail_on_return (tree, location_t, bool);
extern tree handle_access_attribute (tree *, tree, tree, int, bool *);

/* In c-format.cc. */
extern bool valid_format_string_type_p (tree);
Expand Down
Loading