public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ipa/63571] New: Local functions with only local aliases not regparm optimized on i686-linux
@ 2014-10-17 8:40 jakub at gcc dot gnu.org
2015-02-09 21:58 ` [Bug ipa/63571] " jakub at gcc dot gnu.org
0 siblings, 1 reply; 2+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-10-17 8:40 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63571
Bug ID: 63571
Summary: Local functions with only local aliases not regparm
optimized on i686-linux
Product: gcc
Version: 5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: ipa
Assignee: unassigned at gcc dot gnu.org
Reporter: jakub at gcc dot gnu.org
CC: hubicka at gcc dot gnu.org, jakub at gcc dot gnu.org,
jakub at redhat dot com, mliska at suse dot cz, uros at gcc dot gnu.org
Depends on: 63566
+++ This bug was initially created as a clone of Bug #63566 +++
#define A \
x += y * z; \
y = (y << ((z & 2) + 1)) \
^ (y >> (__SIZEOF_INT__ * __CHAR_BIT__ - (z & 2) - 1)); \
z *= 7;
#define B A A A A A A A A A A
#define C B B B B B B B B B B
static unsigned int
f2 (unsigned int x, unsigned int y, unsigned int z)
{
C
return x + y + z;
}
static __typeof (f2) f1 __attribute__((alias ("f2")));
__attribute__((noinline, noclone)) unsigned int
f3 (unsigned int x, unsigned int y, unsigned int z)
{
return f1 (x, z, y) + 6;
}
__attribute__((noinline, noclone)) unsigned int
f4 (unsigned int x, unsigned int y, unsigned int z)
{
return f2 (y, x, z) + 7;
}
__attribute__((noinline, noclone, used)) unsigned int
f5 (unsigned int x, unsigned int y, unsigned int z)
{
return f1 (2 * x, z / 2, y + 3) - 6;
}
__attribute__((noinline, noclone, used)) unsigned int
f6 (unsigned int x, unsigned int y, unsigned int z)
{
return f2 (y + 2, x | 1, z / 73) + 1;
}
int
main ()
{
unsigned int x = f3 (0x173214, 0x182172, 0x9314);
unsigned int y = f4 (0x173214, 0x182172, 0x9314);
#if __SIZEOF_INT__ * __CHAR_BIT__ == 32
if (x != 0xd8e56f78U || y != 0x494c6699U)
__builtin_abort ();
#endif
return 0;
}
on i?86 -m32 -O2 doesn't use regparm calling convention for f1/f2, because f2
has alias, but as all the aliases are local too, there is no reason why it
couldn't be optimized too.
And the PR63566 testcase should for ICF merging use local regparm calling
convention too.
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug ipa/63571] Local functions with only local aliases not regparm optimized on i686-linux
2014-10-17 8:40 [Bug ipa/63571] New: Local functions with only local aliases not regparm optimized on i686-linux jakub at gcc dot gnu.org
@ 2015-02-09 21:58 ` jakub at gcc dot gnu.org
0 siblings, 0 replies; 2+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-02-09 21:58 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63571
Bug 63571 depends on bug 63566, which changed state.
Bug 63566 Summary: [5 Regression] i686 bootstrap fails: ICE RTL flag check: INSN_UID used with unexpected rtx code 'set' in INSN_UID, at rtl.h:1326
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63566
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-02-09 21:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-17 8:40 [Bug ipa/63571] New: Local functions with only local aliases not regparm optimized on i686-linux jakub at gcc dot gnu.org
2015-02-09 21:58 ` [Bug ipa/63571] " jakub 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).