This is the mail archive of the
mailing list for the GCC project.
r242477 - in /trunk/gcc: ChangeLog expr.c
- From: rsandifo at gcc dot gnu dot org
- To: gcc-cvs at gcc dot gnu dot org
- Date: Wed, 16 Nov 2016 10:21:22 -0000
- Subject: r242477 - in /trunk/gcc: ChangeLog expr.c
Date: Wed Nov 16 10:21:22 2016
New Revision: 242477
Optimise CONCAT handling in emit_group_load
The CONCAT handling in emit_group_load chooses between doing
an extraction from a single component or forcing the whole
thing to memory and extracting from there. The condition for
the former (more efficient) option was:
if ((bytepos == 0 && bytelen == slen0)
|| (bytepos != 0 && bytepos + bytelen <= slen))
On the one hand this seems dangerous, since the second line
allows bit ranges that start in the first component and leak
into the second. On the other hand it seems strange to allow
references that start after the first byte of the second
component but not those that start after the first byte
of the first component. This led to a pessimisation of
things like gcc.dg/builtins-54.c for hppa64-hp-hpux11.23.
This patch simply checks whether the reference is contained
within a single component. It also makes sure that we do
an extraction on anything that doesn't span the whole
component (even if it's constant).
2016-11-15 Richard Sandiford <firstname.lastname@example.org>
Alan Hayward <email@example.com>
David Sherwood <firstname.lastname@example.org>
* expr.c (emit_group_load_1): Tighten check for whether an
access involves only one operand of a CONCAT. Use extract_bit_field
for constants if the bit range does span the whole operand.