This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch,testsuite] Support dg-require-effective-target label_offsets.
- From: Bernd Schmidt <bschmidt at redhat dot com>
- To: Georg-Johann Lay <avr at gjlay dot de>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Cc: Mike Stump <mikestump at comcast dot net>
- Date: Wed, 26 Oct 2016 18:51:14 +0200
- Subject: Re: [patch,testsuite] Support dg-require-effective-target label_offsets.
- Authentication-results: sourceware.org; auth=none
- References: <d9c9572d-b417-0588-36b3-1e4c19cbcaaf@gjlay.de>
On 10/26/2016 04:46 PM, Georg-Johann Lay wrote:
+ if { [istarget avr-*-*] } {
+ # If the value of a label does not fit into 16 bits, the linker
+ # will generate a stub (containing a direct jump) and we end up
+ # with the address of the stub instead of the address of the very
+ # label. Whereas it is legitimate to use such addresses for
+ # indirect jumps, it makes no sense to perform any arithmetic
+ # on such addresses.
+ return [check_no_compiler_messages label_offsets assembly {
+ #ifdef __AVR_3_BYTE_PC__
+ #error NO
+ #endif
+ }]
+ }
+ return 1;
I'm not sure I understand the failure mode. Sure, you're not getting the
address of the actual label, but the address of one that's equivalent -
so why can't you do arithmetic on it? Where does it go wrong?
Am I right in thinking that only the execution test actually fails?
Bernd