This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

p2align inconsistencies


I've noticed that p2align directives do not always get inserted at the top of
loops.  Taking as an example egcs-2.92.27/g77, with the g77 (first) version of
Livermore Fortran Kernel in ftp://members.aol.com/n8tm/lloops.shar.gz, there
is no .p2align at the head of the loop body for Kernel 6.  This makes no
difference today, as the position of the loop head exceeds the maximum padding
interval of 7 bytes from an even boundary, but this may explain why this loop
has given unexpectedly lower performance at times in the past.

With the options -O2 -malign-double -march=pentiumpro, g77 is transforming
Kernel 23 into a loop such as

go to 10
DO
	!swap registers
10	continue	! first time entry, compiler aligns this entry
	.....			!loop body
	IF(count==final)EXIT
END DO

and the .p2align is being applied to the first time entry point, so that there
is a padding gap right below the top of the loop on the repeated executions,
and the loop requires an extra cache line.  I couldn't measure any significant
performance difference according to whether this loop was aligned to eliminate
the padding gap or the extra cache line, so maybe there's nothing in this, and
g77 is doing fairly well on these loops.

BTW, I've wondered whether it's safe to ignore the problems which gcc has had
for several snapshots with combinations of -Os and -O2 with -march=pentiumpro
or hppa1.1, which haven't been seen to cause problems in g77 as long as the
compiler and/or libraries are built without these combinations.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]