Skip to content
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

Improve handling of function inlining a bit more #32

Open
wants to merge 59 commits into
base: master
Choose a base branch
from

Conversation

GuillaumeGomez
Copy link
Member

No description provided.

antoyo and others added 30 commits January 7, 2023 09:45
… when generating some code using target-specific builtins
gcc/config/i386:
	PR jit/TODO
	* i386-builtins.cc: New function (clear_builtin_types).

gcc/jit:
	PR jit/TODO
	* dummy-frontend.cc: Include headers target.h, jit-recording.h,
	unordered_map and string, new variables (target_function_types, and
	target_builtins_ctxt), new function (tree_type_to_jit_type).
	* jit-builtins.cc: Specify that the function types are not from
	target builtins.
	* jit-playback.cc: New argument is_target_builtin to new_function.
	* jit-playback.h
	* jit-recording.cc
	* jit-recording.h
	* libgccjit.cc
	* libgccjit.h
	* libgccjit.map

gcc/testsuite/jit.dg:
	PR jit/TODO
	* all-non-failing-tests.h
	* test-target-builtins.c
Fix compilation error when bfloat is unsupported
Add test for cold attribute in libgccjit
fixup! WIP: Add support for function attributes
Add support for returns_twice attribute in libgccjit
antoyo and others added 2 commits October 10, 2023 17:45
GuillaumeGomez pushed a commit to GuillaumeGomez/gcc that referenced this pull request Jan 10, 2024
…-int (PR target/112413)

On m68k the compiler assumes that the PC-relative jump-via-jump-table
instruction and the jump table are adjacent with no padding in between.

When -mlong-jump-table-offsets is combined with -malign-int, a 2-byte
nop may be inserted before the jump table, causing the jump to add the
fetched offset to the wrong PC base and thus jump to the wrong address.

Fixed by referencing the jump table via its label. On the test case
in the PR the object code change is (the moveal at 16 is the nop):

    a:  6536            bcss 42 <f+0x42>
    c:  e588            lsll rust-lang#2,%d0
    e:  203b 0808       movel %pc@(18 <f+0x18>,%d0:l),%d0
-  12:  4efb 0802       jmp %pc@(16 <f+0x16>,%d0:l)
+  12:  4efb 0804       jmp %pc@(18 <f+0x18>,%d0:l)
   16:  284c            moveal %a4,%a4
   18:  0000 0020       orib rust-lang#32,%d0
   1c:  0000 002c       orib rust-lang#44,%d0

Bootstrapped and tested on m68k-linux-gnu, no regressions.

Note: I don't have commit rights to I would need assistance applying this.

	PR target/112413
gcc/

	* config/m68k/linux.h (ASM_RETURN_CASE_JUMP): For
	TARGET_LONG_JUMP_TABLE_OFFSETS, reference the jump table
	via its label.
	* config/m68k/m68kelf.h (ASM_RETURN_CASE_JUMP): Likewise.
	* config/m68k/netbsd-elf.h (ASM_RETURN_CASE_JUMP): Likewise.
@antoyo antoyo force-pushed the master branch 8 times, most recently from a2d83f6 to 3988ccc Compare February 8, 2024 15:13
@antoyo antoyo force-pushed the master branch 2 times, most recently from 51fa28a to be000af Compare February 9, 2024 14:12
@antoyo antoyo force-pushed the master branch 2 times, most recently from cdd8978 to ad4ffde Compare February 16, 2024 21:34
@antoyo antoyo force-pushed the master branch 3 times, most recently from 9cec8ab to c4ee893 Compare October 3, 2024 21:55
@antoyo antoyo force-pushed the master branch 6 times, most recently from 1e817bd to b4002fd Compare October 17, 2024 14:21
@antoyo antoyo force-pushed the master branch 4 times, most recently from 2e49eb4 to 85e56c5 Compare November 14, 2024 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants