This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] Add type_unknown/type_executable/type_pic to output_type
- From: Alan Modra <amodra at gmail dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Mon, 24 Aug 2015 12:30:20 +0930
- Subject: Re: [PATCH] Add type_unknown/type_executable/type_pic to output_type
- Authentication-results: sourceware.org; auth=none
- References: <20150823020901 dot GA12630 at gmail dot com> <20150823135046 dot GC23693 at bubble dot grove dot modra dot org> <CAMe9rOp01ArKXbnZZ-FA4vqQMi87peWLeqzOCQGy2z9yYt0W5Q at mail dot gmail dot com>
On Sun, Aug 23, 2015 at 07:41:09AM -0700, H.J. Lu wrote:
> My patch improves the generated code by changing
>
> movzbl (%rax), %eax
> movl %eax, %edx
> andl $3, %edx
> cmpb $1, %dl
>
> to
>
> movzbl (%rax), %eax
> testb $1, %al
>
> for bfd_link_executable (flinfo->info).
This is due to gcc tree-ssa-reassoc.c not considering a single range
test for optimisation to a bit test. As I said previously, we could
work around this by using
#define bfd_link_executable(info) (((info)->type & 2) == 0)
That generates good code, and doesn't regress other places like your
patch does (I'm assuming regressions from the size increase), but it
just doesn't seem worth applying this sort of micro-optimisation.
--
Alan Modra
Australia Development Lab, IBM