public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/63596] New: Saving of GPR/FPRs for stdarg even though the variable argument is not used
@ 2014-10-19 18:59 pinskia at gcc dot gnu.org
2014-10-20 12:51 ` [Bug target/63596] " rguenth at gcc dot gnu.org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2014-10-19 18:59 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63596
Bug ID: 63596
Summary: Saving of GPR/FPRs for stdarg even though the variable
argument is not used
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: pinskia at gcc dot gnu.org
Target: aarch64
Take a function like:
int f(int a, ...)
{
return a;
}
Currently with the top of the trunk we get:
f:
sub sp, sp, #192
stp x1, x2, [sp, 136]
stp x3, x4, [sp, 152]
stp x5, x6, [sp, 168]
str x7, [sp, 184]
str q0, [sp]
str q1, [sp, 16]
str q2, [sp, 32]
str q3, [sp, 48]
str q4, [sp, 64]
str q5, [sp, 80]
str q6, [sp, 96]
str q7, [sp, 112]
add sp, sp, 192
ret
--- CUT ---
But we can optimize this down to just
f:
ret
--- CUT ---
The .stdarg debug dump says:
f: va_list escapes 0, needs to save 0 GPR units and 0 FPR units.
But nowhere in aarch64.c uses cfun->va_list_gpr_size or cfun->va_list_fpr_size
to figure out how many registers need to be saved.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug target/63596] Saving of GPR/FPRs for stdarg even though the variable argument is not used
2014-10-19 18:59 [Bug target/63596] New: Saving of GPR/FPRs for stdarg even though the variable argument is not used pinskia at gcc dot gnu.org
@ 2014-10-20 12:51 ` rguenth at gcc dot gnu.org
2014-12-30 17:00 ` jiwang at gcc dot gnu.org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-10-20 12:51 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63596
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2014-10-20
Ever confirmed|0 |1
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug target/63596] Saving of GPR/FPRs for stdarg even though the variable argument is not used
2014-10-19 18:59 [Bug target/63596] New: Saving of GPR/FPRs for stdarg even though the variable argument is not used pinskia at gcc dot gnu.org
2014-10-20 12:51 ` [Bug target/63596] " rguenth at gcc dot gnu.org
@ 2014-12-30 17:00 ` jiwang at gcc dot gnu.org
2014-12-30 18:24 ` pinskia at gcc dot gnu.org
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: jiwang at gcc dot gnu.org @ 2014-12-30 17:00 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63596
--- Comment #2 from Jiong Wang <jiwang at gcc dot gnu.org> ---
we are also lack of initialization for va_list_gpr_counter_field and
va_list_vpr_counter_field, thus currently the whole tree-stdarg optimization
doesn't work for AArch64, and lots of other targets, like arm, sparc, mips etc
are lack of this vaarg opt tuning also.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug target/63596] Saving of GPR/FPRs for stdarg even though the variable argument is not used
2014-10-19 18:59 [Bug target/63596] New: Saving of GPR/FPRs for stdarg even though the variable argument is not used pinskia at gcc dot gnu.org
2014-10-20 12:51 ` [Bug target/63596] " rguenth at gcc dot gnu.org
2014-12-30 17:00 ` jiwang at gcc dot gnu.org
@ 2014-12-30 18:24 ` pinskia at gcc dot gnu.org
2015-01-03 22:01 ` pinskia at gcc dot gnu.org
2015-01-06 18:26 ` jiwang at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2014-12-30 18:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63596
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Jiong Wang from comment #2)
> we are also lack of initialization for va_list_gpr_counter_field and
> va_list_vpr_counter_field, thus currently the whole tree-stdarg optimization
> doesn't work for AArch64, and lots of other targets, like arm, sparc, mips
> etc are lack of this vaarg opt tuning also.
Yes but the two other server targets (x86 and PowerPC) don't lack this
optimization.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug target/63596] Saving of GPR/FPRs for stdarg even though the variable argument is not used
2014-10-19 18:59 [Bug target/63596] New: Saving of GPR/FPRs for stdarg even though the variable argument is not used pinskia at gcc dot gnu.org
` (2 preceding siblings ...)
2014-12-30 18:24 ` pinskia at gcc dot gnu.org
@ 2015-01-03 22:01 ` pinskia at gcc dot gnu.org
2015-01-06 18:26 ` jiwang at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2015-01-03 22:01 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63596
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |enhancement
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug target/63596] Saving of GPR/FPRs for stdarg even though the variable argument is not used
2014-10-19 18:59 [Bug target/63596] New: Saving of GPR/FPRs for stdarg even though the variable argument is not used pinskia at gcc dot gnu.org
` (3 preceding siblings ...)
2015-01-03 22:01 ` pinskia at gcc dot gnu.org
@ 2015-01-06 18:26 ` jiwang at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: jiwang at gcc dot gnu.org @ 2015-01-06 18:26 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63596
Jiong Wang <jiwang at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-01-06 18:26 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-19 18:59 [Bug target/63596] New: Saving of GPR/FPRs for stdarg even though the variable argument is not used pinskia at gcc dot gnu.org
2014-10-20 12:51 ` [Bug target/63596] " rguenth at gcc dot gnu.org
2014-12-30 17:00 ` jiwang at gcc dot gnu.org
2014-12-30 18:24 ` pinskia at gcc dot gnu.org
2015-01-03 22:01 ` pinskia at gcc dot gnu.org
2015-01-06 18:26 ` jiwang at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).