]> git.ipfire.org Git - thirdparty/gcc.git/commit
pru: Enable section anchoring by default
authorDimitar Dimitrov <dimitar@dinux.eu>
Sun, 14 Jul 2024 16:45:09 +0000 (19:45 +0300)
committerDimitar Dimitrov <dimitar@dinux.eu>
Wed, 31 Jul 2024 16:45:05 +0000 (19:45 +0300)
commitdcdefe47e18fabc340f9862a27ebd521dfa3d38c
treebb1da7458a62d22b23e961dc1079e74b42c072f9
parentf2fac502097f75e4a098a3321f216523b59030be
pru: Enable section anchoring by default

Loading an arbitrary constant address in a register is expensive for
PRU.  So enable section anchoring by default to utilize the unsigned
byte constant offset operand of load/store instructions.

gcc/ChangeLog:

* common/config/pru/pru-common.cc
(TARGET_OPTION_OPTIMIZATION_TABLE): New definition.
* config/pru/pru.cc (TARGET_MIN_ANCHOR_OFFSET): Set minimal
anchor offset.
(TARGET_MAX_ANCHOR_OFFSET): Set maximum anchor offset.

gcc/testsuite/ChangeLog:

* gcc.target/pru/section-anchors-1.c: New test.
* gcc.target/pru/section-anchors-2.c: New test.

Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
gcc/common/config/pru/pru-common.cc
gcc/config/pru/pru.cc
gcc/testsuite/gcc.target/pru/section-anchors-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/pru/section-anchors-2.c [new file with mode: 0644]