https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #44 from Douglas Mencken <dougmencken at gmail dot com> ---
I got assembly of pr78468.c from various versions of GCC

• 7.3 produces absolutely the same as patched 8.2
• 6.4 produces slightly different assembly with stmw & lmw and different
sequence of instructions, but numbers like in “addi r2,r1,103” are the same
• 4.2.1 can’t compile it at all pr78468.c:9: error: expected ‘=’, ‘,’, ‘;’,
‘asm’ or ‘__attribute__’ before ‘uintptr_t’

(In reply to Wilco from comment #43)
> No the problem is not in this code. It's STACK_DYNAMIC_OFFSET which is wrong.

I can’t get where is the value of STACK_DYNAMIC_OFFSET in published assembly
and why do you think it is wrong

It seems that the problem is in fact that your version of
get_dynamic_stack_size from explow.c (introduced with r251713) gives out too
small values, for example in _t1_a8 it is fifteen “addi r3,r3,15” while ages
before that it worked as being “addi r3,r3,22”

-       addi r3,r3,15
+       addi r3,r3,22

And aligning looks okay, it is then handled by code for

#define RS6000_ALIGN(n,a) ROUND_UP ((n), (a))
#define ROUND_UP(x,y) (((x) + (y) - 1) & ~((y) - 1))

part of which is rlwinm and such

(16 + 15) & ~15 = 16
(16 + 22) & ~15 = 32

Thus for your version of get_dynamic_stack_size that size is 16 here, but for
previous ones it is 32. And eventually this leads to fail for such built-ins as
acos, floor, &c.

Reply via email to